vilisseranen / terraform-kubeadm

Deploy a Kubernetes cluster with Terraform and kubeadm on cloud.ca
4 stars 2 forks source link

Kubernetes deployment on cloud.ca with Terraform and kubeadm

This configuration will deploy a Kubernetes cluster with:

The configuration was built from the instructions found on this page: https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/

Prerequisite

This configuration requires terraform-provider-cloudca installed.

How to use

Use Kubernetes

Terraform will output a command to connect to the bastion node at the end of the run. The Kubernetes configuration was copied on the bastion node to the user's home directory. With this user, you should be able to run kubectl commands. For example, at the end of the Terraform run, try executing kubectl get nodes to see if all workers have joined the cluster successfully, and kubectl get pods --namespace kube-system to make sure all system components started properly (give it time, it takes a few minutes to fully initialize).

Kubernetes resource creation example

This configuration also contains the necessary configuration to create a basic Vault deployment. If you want to create the Vault deployment, you will need to:

This will write a vault.yaml manifest in the manifests/ folder, upload it to the Kubernetes cluster and start the deployment. You will need to take care of the Vault initialization. Note that this manifest will create 3 replicas of a non-HA Vault servers connected to the same storage backend. You can access this container by creating a public IP and a load balancing rule that will redirect requests to the right NodePort that was reserved by Kubernetes.