/diving-bell

Primary LanguageGoApache License 2.0Apache-2.0

diving-bell

Diving bell uses kubectl, terraform, and skuba to manage k8s clusters

Usage

Manage a k8s cluster using kubectl, terraform, and skuba

Usage:
  diving-bell [command]

Available Commands:
  bootstrap   Bootstrap the cluster using skuba
  config      Config related actions
  deploy      Deploy a cluster with one command
  help        Help about any command
  provision   Provision the cluster using terraform
  status      Get the current status of the cluster

Flags:
      --config string   config file (default is {working directory}/.diving-bell.yaml)
  -h, --help            help for diving-bell

Use "diving-bell [command] --help" for more information about a command.

Bootstrapping

You bootstrap a pre provisioned cluster as long as you already have a config locally with diving-bell bootstrap. This uses skuba to bootstrap the cluster and kubectl to make sure the cluster is ready.

For more about the config read below

Config

Example config for a cluster:

clusterName: "test-cluster"
controlPlaneTarget: "10.17.1.0"
terraformWorkspacePath: "~/github/skuba/ci/infra/libvirt"
managers:
        - user: "sles"
          target: "10.17.2.0"
          hostName: "testing-master-0"
        - user: "sles"
          target: "10.17.2.1"
          hostName: "testing-master-1"
        - user: "sles"
          target: "10.17.2.2"
          hostName: "testing-master-2"

workers:
        - user: "sles"
          target: "10.17.3.0"
          hostName: "testing-worker-0"

        - user: "sles"
          target: "10.17.3.1"
          hostName: "testing-worker-1"

Gen

To generate a config run diving-bell config gen [cluster name] [terraform workspace path]. This will use the output from terraform to generate a config and print it to the console. You can add the --write flag and it will write the config to the default location. You can also specify the k8s version to use with --kubernetes-version.

Retrieve

To retrieve the config from the cluster diving-bell config retrieve [cluster name]. This will use the kubeconfig in the cluster dir generated by skuba to retrieve the config.

Update

To update/store the config in the cluster as a configmap diving-bell config update [cluster name] This will use the skuba cluster dir and a locally written config to update the one stored in the cluster.

Deployment

To provision and bootstrap a cluster with one command you can run diving-bell deploy [cluster name] [terraform workspace path]. This use terraform to provision a cluster and skuba to bootstrap it. If a skuba cluster dir with the same cluster name exists this command will fail. You can override that behavior using the --redeploy flag. You can also specify the k8s version to use with --kubernetes-version.

To do this all one step at a time you would run all these commands

diving-bell provision [terraform workspace path]
diving-bell config gen [cluster name] [terraform workspace path] --write
diving-bell bootstrap
diving-bell config update [cluster name]

Provisioning

To provision a cluster diving-bell provision [terraform workspace path] this requires you to have all your terraform file filled out and ready.