Home

Awesome

Etcd Package

This is a Kurtosis Starlark Package that allows you to spin up an etcd instance.

Run

This assumes you have the Kurtosis CLI installed

Simply run

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

Configuration

<details> <summary>Click to see configuration</summary>

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!):

{
    // 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:

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 file in this repo:

kurtosis run github.com/kurtosis-tech/etcd-package --enclave etcd "$(cat args.json)"
</details>

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

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"]))
    ...