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/
This configuration requires terraform-provider-cloudca
installed.
api_key
: your cloud.ca API keyorganization_code
: name used to connect to cloud.ca - \admin
: a list of users in your organization who will have the Environment Admin
roleread_only
: a list of users in your organization who wil have the Read Only
roleservice_code
: compute-qc
or compute-on
(default: compute-qc
)zone_id
: QC-1
or QC-2
when using compute-qc
, ON-1
when using compute-on
(default: QC-2
)prefix
: a prefix for all resources created (default: k8s
)username
: the username you will use to connect to the machines (default: kubernetes
)terraform init
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).
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:
os_username
: Object storage User name
in cloud.caos_project
: Object Storage Tenant name
in cloud.caos_password
: Object Storage Password
in cloud.caos_auth_url
: Object Storage Authentication endpoint
in cloud.cacontainer
: Container used to store Vault datadeploy_vault
: Set this to trueThis 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.
kubectl get deployments
will show the deploymentkubectl get pods -o wide
will show the 3 replicas of the vault podskubectl get svc -l app-vault
will show the node port that was assign for this deployment