Multi-Cloud infrastructure orchestrator for Kubernetes first development. One tool to rule them all. To administer the cluster and retrieve kubeconfig, no need to utilise aws, azure, or any other vendor-specific cli.
- Multi cloud infrastructure orchestrator for kubernetes.
- Manage cluster kubeconfig for different provider.
- Provision nodes with on demand or spot instances.
- Access control built right into spawner, it will not access your existing clusters if it wasn't created by spawner unless your resources tagged as per spawner policy.
- Supported providers aws, azure and gcp.
- Golang v1.17 or later.
git clone [email protected]:netbook-devs/spawner-service.git
Spawner comes with following two packages
- spawner-service - gRPC service to manage cloud provider infra
- spawner - command line interface to interact with service
-
update config.env with the cloud provider credentials, gRPC ports.
-
run the service
Spawner is a gRPC service, so spin up a terminal and run the following command
make run
this will start the service in the specified ports in config.env
spin up another terminal/tab and run the following in spawner-service repo directory
make build-client
The previous build will generate the client binary named spawner
in the current working directory. Copy that to your PATH or use it with relative execution path ./spawner
as per your convenience.
For all the commands you need to pass spawner host address, default value is set to localhost:8083
, if you need to change that, pass in using --addr
or -a
.
Example:
spawner cluster-status clustername --addr=192.168.1.78:8080 --provider=aws --region=us-west-2
To create a cluster we need more information on the cluster and node specification which can be passed to command as a file by specifying --request
or -r
spawner create-cluster clustername -r request.json
request.json should contain the following
{
"provider": "aws",
"region": "us-east-1",
"labels": {
"created_at": "morning"
},
"node": {
"name": "proident",
"diskSize": 10,
"labels": {
"created_by": "alex"
},
"instance": "m5.xlarge",
"gpuEnabled": false
}
}
Note : This wil create a cluster and attach new node to it as per spec, the time taken by this operation completely depends on how fast provider responds.
Get the cluster status such as CREATING, ACTIVE, DELETING
spawner cluster-status clustername --provider "aws" -r=region
Delete the existing cluster
spawner delete-cluster clustername --provider "aws" -r=region
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
spawner delete-cluster clustername --provider "aws" -r=region --force
Create new nodepool in a given cluster
spawner nodepool add clustername --request request.json
request.json will contain the nodespec for the new nodepool,
@request.json
{
"nodeSpec": {
"diskSize": 31,
"name": "prosint",
"count": 3,
"instance": "Standard_A2_V2",
"labels": {
"created_by": "cli"
}
},
"region": "eastus2",
"clusterName": "my-cluster",
"provider": "azure"
}
spawner nodepool delete clustername --provider "aws" -r=region --nodepool nodepoolname
spawner kubeconfig clustername --provider "aws" -r=region
this will read existing kube config from ~/.kube/config
and merges new cluster config to it, sets the current context as the requested cluster
Some of the things we want to bring in the near future, there will be more to come mean time if you have any more ideas/thoughts, please drop in issues or discussion. Happy to address.
- Documentation to spin Spot Instances
- Support for bare metal servers
- Attaching existing user clusters by adding spawner policy requirement in user cluster.
Also if you like to contribute...
Refer our contributing guidelines contributing.md
This code is licensed under GPL-3.0 License