Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kurtosis-tech/etcd-package


https://github.com/kurtosis-tech/etcd-package

kurtosis kurtosis-package

Last synced: about 7 hours ago
JSON representation

Awesome Lists containing this project

README

        

## Etcd Package

This is a [Kurtosis Starlark Package](https://docs.kurtosis.com/quickstart) that allows you to spin up an etcd instance.

### Run

This assumes you have the [Kurtosis CLI](https://docs.kurtosis.com/cli) installed

Simply run

```bash
kurtosis run github.com/kurtosis-tech/etcd-package
```

#### Configuration

Click to see configuration

You can configure this package using a JSON structure as an argument to the `kurtosis run` function. The full structure that this package accepts is as follows, with default values shown (note that the `//` lines are not valid JSON and should be removed!):

```javascript
{
// The name to give the new etcd service
"etcd_name": "etcd",

// The image to run
"etcd_image": "softlang/etcd-alpine:v3.4.14",

// The client port number to listen on and advertise
"etcd_client_port": 2379,

// Additional environment variables that will be set on the container
"etcd_env_vars": {}
}
```

These arguments can either be provided manually:

```bash
kurtosis run github.com/kurtosis-tech/etcd-package '{"etcd_image":"softlang/etcd-alpine:v3.4.14"}'
```

or by loading via a file, for instance using the [args.json](args.json) file in this repo:

```bash
kurtosis run github.com/kurtosis-tech/etcd-package --enclave etcd "$(cat args.json)"
```

### Using this in your own package

Kurtosis Packages can be used within other Kurtosis Packages, through what we call composition internally. Assuming you want to spin up etcd and your own service
together you just need to do the following

```py
etcd_module = import_module("github.com/kurtosis-tech/etcd-package/main.star")

# main.star of your package
def run(plan, argument_1, optional_argument=""):
plan.print("spinning up the etcd service inside the enclave")
# this will spin up etcd and return the output of the etcd package
optional_etcd_args = {}
etcd_service = etcd_module.run(plan, optional_etcd_args)

plan.print("etcd is running on {}:{}".format(etcd_service["hostname"], etcd_service["port"]))
...
```