Provisioners

Provisioners are responsible for creating and deleting clusters. Sugarkube delegates to other binaries to actually interact with clusters since there’s little point in reimplementing e.g. kops/minikube ourselves.

When you configure a stack you need to declare the provisioner to use. Currently supported choices are:

  • eks
  • kops
  • minikube
  • none

YAML for provisioners must be placed under the provisioner key. Each provisioner supports different options as explained below.

EKS

Sugarkube orchestrates the eksctl binary under-the-hood to set up EKS clusters.

  • binary - path to the eksctl binary. This can be useful if you want to pin to a specific version
  • params - parameters for Kops command line options:
    • global - applied to all commands
    • get_cluster - CLI args for eksctl get cluster
    • create_cluster - CLI args for eksctl create cluster
    • delete_cluster - CLI args for eksctl delete cluster
    • update_cluster - CLI args for eksctl update cluster
    • utils - args for the eksctl utils command. This is a YAML map accepting the following:
    • write_kubeconfig - CLI args for eksctl utils write-kubeconfig
    • config_file - YAML to write to an eksctl config file and pass to commands

Values for create_cluster, delete_cluster, etc can be found by running e.g. eksctl create cluster -h. Remove the leading ‘–’ and change hyphens to underscores. E.g. --vpc-cidr=10.100.0.0/16 should be defined as vpc_cidr: 10.100.0.0/16.

You can see a sample EKS config in our sample project.

Kops

Kops supports creating clusters using a public or private topology. Ones created with a private topology use an internal load balancer for the API server and a private hosted zone for DNS records to it. It supports creating a bastion as a jump box to gain access to the VPC the cluster is created in. Creating clusters using the private topology is undoubtedly safer since the API server isn’t exposed to the Internet by default.

Sugarkube provides first-class support for private Kops clusters by setting up SSH port forwarding between your local machine and the bastion. It will set up port forwarding under several circumstances:

  • A new cluster is created with a private topology and a bastion
  • You pass the --connect flag to commands that support it (e.g. kapps install or kapps delete).

Kops configuration

  • binary - path to the kops binary. This can be useful if you want to pin to a specific version
  • ssh_private_key - path to the private SSH key. Used to set up SSH port forwarding if required
  • bastion_user - username to SSH to the bastion as when setting up SSH port forwarding
  • local_port_forwarding_port - local port to use for SSH port forwarding
  • params - parameters for Kops command line options:
    • global - applied to all commands
    • create_cluster - CLI args for kops create cluster
    • delete_cluster - CLI args for kops delete cluster
    • update_cluster - CLI args for kops update cluster
    • get_clusters - CLI args for kops get clusters
    • get_instance_groups - CLI args for kops get instancegroups
    • rolling_update - CLI args for kops rolling-update
    • replace - CLI args for kops replace

Values for create_cluster, delete_cluster, etc can be found by running e.g. kops create cluster -h. Remove the leading ‘–’ and change hyphens to underscores. E.g. --master-count=3 should be defined as master_count: 3.

Booleans can be specified (e.g. for the bastion option) by declaring a key without a value, i.e. bastion:

You can see a sample kops config in our sample project.

Minikube configuration

  • binary - path to the minikube binary if you want to pin to a specific version (optional)
  • params:
    • global - applied to all commands
    • start - CLI args for minikube start
    • delete - CLI args for minikube delete

Values for start, delete can be found by running minikube start -h, removing the leading ‘–’ and replacing hyphens with underscores. E.g. --disk-size=20g should be defined as disk_size: 20g.

You can see a sample Minikube config in our sample project.

None

This is a no-op provisioner that doesn’t do anything. Use it if you’re not using Kubernetes or don’t want to use Sugarkube to create clusters for you.