Kubernetes
Kubernetes
Introduction
Kubernetes The Hard Way is a guide for setting up a Kubernetes cluster from scratch.
(b) How are the instances created for the controllers and the workers different?
(c) Provide an example of the kubeconfig file for one of your worker nodes. What do the
different sections represent?
(a) What are Kubernetes Secrets? What are they used for?
(b) List the members of your etcd cluster from one of the controllers.
(a) Check the value of $REGION. If incorrect, use the previously defined region or set it
using:
REGION=$(curl -s -H "Metadata-Flavor: Google"
http://metadata.google.internal/computeMetadata/v1/instance/zone | cut -d/ -f 4 | sed
's/.{2}$//')
(b) What services do you install on the Control Plane? What are their roles?
(e) In the "Provision a Load Balancer" section, what do the different commands do?
(a) What are the new routes you are creating used for?
(b) What is a Kubernetes Service? What is a Service NodePort, and how does it differ from
a LoadBalancer service?
(c) Important: Do not perform the Cleanup section immediately. You will still need to use
your cluster.
For this section, provide the YAML files and the commands you used.
(b) On your local machine, create the following file and create a ConfigMap that uses it:
$ cat conf.d/nginx-basic.conf
server {
location / {
return 200 'Hello World!';
add_header Content-Type text/plain;
}
}
(c) Create a pod using the image nginx:1.14.2 and using your ConfigMap. How can you
verify that the ConfigMap is added to the Pod?
(d) Now create a deployment with 2 replicas of the pod you defined (delete the pod before
creating the deployment). Describe the deployment and list its pods.
(e) Expose your deployment with a service and check that you can see the content of your
ConfigMap.
(f) Update your deployment to use the image nginx:1.16.1. Describe your changes. (
g) Update your deployment to use the image nginx:1.16.3. What happens? How can you fix
the issue?
(h) Modify your deployment to have 4 pods. Provide two ways to make this change, and list
your pods.
14. Cleaning Up