Kubernetes Assessment
Kubernetes Assessment
Hands-on
Assessment
SENTHIL RAJA CHERMAPANDIAN
Evaluation Procedure
• Google cloud free-tier subscription
• Docker Hub and Github Accounts
Prerequisites • Confirm by starring the kube-fledged github repository
2. Create a Pod named “nginx” with one container running nginx version 1.15.11
1. Find out the IP address of the Pod.
2. Find out in which node the Pod is running
3. Find out the events generates for the Pod.
4. Find out the labels and annotations attached to the Pod.
2. Expose the Pods in “rs-nginx” ReplicaSet using Service type NodePort (port 31575)
1. Find out the IP address of the Service. Scale ReplicaSet to 3 Pods
2. Access the Service using <Node IP>:<Node port> on Browser
3. Delete the NodePort Service
2. Create a Pod using “alpine” image that mounts my-data-disk in mountPath = /var/simple
1. Run an infinite sh loop within the container that keeps appending the current date to /var/simple/file.txt every 5
seconds
2. Log into the alpine container and verify the contents of file.txt. Use command kubectl exec <pod name> -i -t -- sh –
il
3. Exit the container. Delete the Pod.
3. Re-create the same Pod. Log into the container. Verify if the contents written by previous Pod are intact.
4. ConfigMap (45 mins)
1. Refer: https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/
1. Create ConfigMap from files in a directory
2. Create ConfigMap from individual files
3. Create ConfigMap from env files
4. Define the key to use when creating a ConfigMap from a file
5. Create ConfigMaps from literal values
6. Define a container environment variable with data from a single ConfigMap
7. Define container environment variables with data from multiple ConfigMaps
8. Populate a Volume with data stored in a ConfigMap
9. Add ConfigMap data to a specific path in the Volume
5. Secrets (30 mins)
1. Refer: https://kubernetes.io/docs/concepts/configuration/secret/
1. Creating a Secret Using kubectl create secret
2. Creating a Secret Manually
3. Decoding a Secret
4. Using Secrets as Files from a Pod
5. Consuming Secret Values from Volumes
6. Using Secrets as Environment Variables
6. Creating a Deployment (30 mins)
1. Create a Deployment that has one nginx:1.14.2 Pod. Add Pod anti-affinity to ensure one Pod per node.
5. Refer: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#creating-a-
deployment
7. Updating/Rolling back a
Deployment (45 mins)
1. Update the image version of the Deployment to nginx:1.15.11
2. Check out the status of rollout
3. Verify that the rollout created a new ReplicaSet with 3 replicas. And the old ReplicaSet was scaled down to 0
replicas.
4. Verify you are able to access the application successfully
5. Rollback the Deployment to nginx:1.14.2
6. Check the rollout history of a Deployment
7. Rollback to a previous revision in the history
8. Pause and Resume a Deployment
9. Perform both Recreate and RollingUpdate strategies
10.Refer: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/
8. Kube-fledged Add-on (45 mins)
1. A kubernetes add-on for creating and managing a cache of container images directly on the cluster worker
nodes, so application pods start almost instantly
2. Refer to: https://github.com/senthilrch/kube-fledged
3. Deploy the add-on (Quick install using YAML Manifests)
4. Create image cache for nginx and redis images
5. View the status of image cache
6. Add/remove images in image cache
7. On-demand refresh of the image cache
8. Purge the image cache
9. Delete the image cache
10. Remove the add-on
Thank You