Usage examples

How to Use Spawner CLI

How to use Spawner for different Cloud providers

AWS

Create Cluster

To create a cluster. Make sure that you have completed the below steps

  1. Added Access Key and Secrets in your config.env file in spawner folder

  2. To easily manage configurations, you can use JSON files to provide cluster configuration and node configuration needed. You can refer to examples folder in the repo to find a sample cluster creation JSON files.

  3. Here is a sample request.json for creating a cluster

// Some code
{
    "provider": "aws",
    "region": "us-west-2",
    "labels": {
        "fugiat8f": "laboris magna Duis amet"
    },
    "node": {
        "name": "proident",
        "diskSize": 10,
        "labels": {
            "created_by": "alex"
        },
        "instance": "m5.xlarge",
        "gpuEnabled": false
    }
}

Once you have the request.json ready, run the below command to create the cluster

Do keep a note of the cluster name. This will be used for the following steps to create nodes

Once you have a cluster created, you can add any type of node to the cluster based on the availability of node types in the region.

Add Node pools to the cluster

Similar to cluster, to create node pool, you can use sample JSON to add different types of nodes that are needed to be added to your cluster

NOTE: you can provide nodepool name in nodespec and the labels can be used to track costs

To add node pools, execute the below command

Get cluster status

To get the cluster status, run the below command

Delete Cluster

Delete the existing cluster

If the cluster has the nodes attached to it, this operation will fail, you can force delete the cluster which deletes attached node and then deletes the cluster.

To force delete set the --force or -f

Delete nodepool from existing cluster

Finally, once you have the cluster created, to use the cluster from normal Kubectl command,, you need to add cluster configuration to kubeconfig file. With spawner, you need not do it manually, you can just follow the below steps to do it automatically.

Get kubeconfg for the cluster

This will read the existing kube-config from ~/.kube/config and merges new cluster config to it, sets the current context as the requested cluster.

Last updated