Skip to content

Latest commit

 

History

History
84 lines (60 loc) · 3.11 KB

File metadata and controls

84 lines (60 loc) · 3.11 KB

Cherryservers Terraform Kubeone Example

Terraform template to automatically deploy High-Available (HA) Kubernetes cluster on Cherryservers infrastructure. This example will create HA cluster with three control plane nodes.

                                       +--------------+
                                  +----|control-plane1|
                                  |    +--------------+
                 +-------------+  |    +--------------+
   kubectl-->----|load-balancer|--+--- |control-plane2|
                 +-------------+  |    +--------------+
                                  |    +--------------+
                                  +----|control-plane3|
                                       +--------------+

The load balancing is powered by http://gobetween.io/

Prerequisites

Before you start

You will need cherrservers.com account with the credit in balance, which will be used to order services with hourly billing.

Create API key https://portal.cherryservers.com/#/settings/api-keys/ and export it to variables.tf file:

provider "cherryservers" {
  auth_token = "amalkaad23asd4a8awd43a32e3492"
}

Other important variables:

  • "team_id" can be optained once logged into client portal
  • "region" default is "EU-East-1". "EU-West-1" supports only Bare-metal E5-1620v4
  • "lb_plan_id" default is "93" SSD Smart8
  • "node_plan_id" default is "96" SSD Smart16, all plans are available here
  • "private_key" & "public_key" are your private and public SSH keys needed for the deployment

Kubernetes version

You can define required Kubernetes version at "config.yaml" file. The default is "v1.14", but latest now is "v1.15".

How to use

terraform apply -auto-approve
terraform output -json > tf.json
kubeone install config.yaml -t tf.json

If you get no errors here then you have succesfully have created HA kubernetes cluster.

Control remote Kubernetes cluster locally

Make sure you have installed Kubernetes CLI tools localy.

kubectl version

Copy kubernetes cluster config to local workstation

scp -r -i ~/.ssh/deployment root@control_plane_ip:/root/.kube $HOME

Replace "control_plane_ip" with the one of nodes public IP.

kubectl get nodes
kubectl describe nodes

Web UI (Dashboard)

The Dashboard UI is not deployed by default. To deploy Kubernetes Dashboard go here