Using the CLI tool

sym is a command-line utility that allows you to easily manage your Symbiosis resources. With the CLI tool you can make daily operations easier and integrate Symbiosis into your CI/CD workflows.

Mac logo Homebrew (Mac OSX)

If you have Homebrew installed, you can install the Symbiosis CLI by running:

brew install symbiosis-cloud/tap/sym

If you don't have Homebrew installed you can also use the installer script:

curl -s https://raw.githubusercontent.com/symbiosis-cloud/cli/main/install.sh | sh

Linux logo Linux

Run the CLI installation script by issuing the following command.

curl -s https://raw.githubusercontent.com/symbiosis-cloud/cli/main/install.sh | sh

The installer may prompt for sudo rights in order to install the binary.

Windows logo Windows

We currently do not have an installer for Windows. However, binaries for Windows can be downloaded from our GitHub releases.

Authentication

The CLI offers two options for authentication, signing in through the web UI or by using an API key.

You can log in using your own access token by issuing the following command:

sym login

You will be prompted to login to Symbiosis using your browser.

Alternatively, you can also authenticate the CLI using an API key:

sym config init <api key>

You can generate a suitable API key from the web UI.

Listing clusters

sym cluster list

ID                                    NAME                VERSION
b568c426-6fab-41ce-8313-4e7284af52eb  my-prod-cluster     1.24.4
21c5e526-8f8d-4483-9506-b658e924709c  my-staging-cluster  1.24.4

You can change the output format of commands by using the -o flag to print the output in json or yaml format.

$ sym cluster describe -o json my-prod-cluster
{
  "id": b568c426-6fab-41ce-8313-4e7284af52eb,
  "name": "my-prod-cluster",
  ...
}

Creating a Cluster

With our CLI you can easily create new clusters and get started with them right away.

Let's create a simple autoscaling cluster with two to four general-2 nodes.

Note The --merge flag installs the kube context of the new cluster so it can be used for kubectl and other local tools (issuing --merge will require confirmation).

sym cluster create my-cluster --autoscaling --min-nodes=2 --max-nodes=4 -t general-2 --merge

ID                                    NAME        VERSION  NODE TYPE  # NODES
af558bb8-8f86-4c4f-8c80-136d56667b61  my-cluster  1.24.4   general-2        2

You can see all available flags by running sym cluster create --help

The kubeconfig file can also be exported or installed manually:

# output the kubeconfig to stdout
sym cluster identity my-cluster

# output the kubeconfig to a specific file
sym cluster identity my-cluster -i /path/to/file

# Install the kubeconfig into your existing .kube/config
sym cluster identity my-cluster --merge

In order to delete the cluster you can run:

sym cluster delete my-cluster

Adding a node pool to an existing cluster

To add a new node-pool to an existing cluster you can issue the following command:

sym node-pool create new-pool my-cluster -n 1 -t general-1

ID                                    NAME      TYPE       QUANTITY
224e3ce9-142f-4434-999d-329c05ad992f  new-pool  general-1         1

Creating an autoscaling node-pool

The following command can be used to create a node-pool that scales automatically between 1 and 5 nodes:

sym node-pool create new-pool my-cluster --autoscaling --min-nodes 1 --max-nodes 5 1 -t general-1

ID                                    NAME      TYPE       QUANTITY
224e3ce9-142f-4434-999d-329c05ad992f  new-pool  general-1         1