This lab guides the student through the final component of the proof-of-concept. This lab uses kops to scale a cluster after a Python program edits the cluster configuration YAML file. This is all done from a Bastion Host.
Successfully complete this lab by achieving the following learning objectives:
- Create a cluster with kops.
To create a Kubernetes Cluster from the Bastion Host, input the following command:
$ . ./k8s-create.sh
You may view the default YAML templates created by kops with any of the following commands:
kops edit cluster
Or to look at the instance group for the nodes:
kops edit ig nodes
After looking at the base installation, you may create the cluster by entering:
kops update cluster --yes
- Validate the cluster that was created.
To validate the newly created cluster:
kops validate cluster
And eventually, after the EC2 servers are up:
kubectl get nodes
- Use Python to increase the nodes in the instance group.
You may view the files below from the GitHub site, or by simply using
The link for the GitHub repo is:
To look at the Python source code in
Also look at the template YAML for the instance group:
Also, look at the
edit_cluster.shscript that edits the
Now execute the command to scale the cluster:
Tell kops to commit the changes to the cluster:
kops rolling-update cluster --yes
- Validate that the cluster was scaled.
You may simply validate the number of worker nodes running by entering:
kubectl get node