CKA Reloading Flashcards
What are the components of a control plane?
MASTER:
ETCD (Key-Value store)
kube-scheduler (identify the right node to place the pod on), controllers (node-controller, replication-controller, controller-manager)
kube-apiserver (primary management component - orchestrates all operations within the cluster)
WORKER:
container run-time engine (e.g. docker, rkt, containerd)
kubelet (captain - runs on each node, listens for instructions from kube-apiserver, creates the pod on the node)
kubeproxy (communication between worker nodes are enabled by this service)
How does kubernetes support other container run times e.g. rkt, containerd?
CRI (Container Runtime Interface) and should follow OCI standards (Open Container Initiative) - imagespec, runtimespec
dockershim (to still support docker) - REMOVED as containerd (deamon) supports CRI
How is the information stored in a key-value store
In form of documents/pages. Each individual entry gets a document. Changes to one file does not affect the others. Dataformats: json or yaml
What information is stored in etcd
Nodes
PODS
Configs
Secrets
Accounts
Roles
Bindings
Others
How does kubeadm deploy a kubernetes cluster control plane components?
As pods in kube-system namespace. you can check using
kubectl get pods -n kube-system
What happens when I type kubectl get nodes. Explain the workflow.
The kube-apiserver authenticates the request and validates it
The data is then retrieved from etcd cluster and responds back
Explain the workflow for a pod creation
The kube-apiserver updates the information in etcd cluster
updates user that a pod is created
kube-scheduler continuously monitors the apiserver and realizes there is a pod with no node assigned
scheduler identifies the right node to put the pod on and communicates back to the kube-apiserver
kube-apiserver then updates the information in etcd cluster
apiserver then passes the information to kubelet in the appropriate worker node
kubelet then creates the pod and instructs the container-engine to deploy the application image
Once done, kubelet updates the status back to the apiserver which in turn updates the data back in etcd cluster
kube-apiserver is the only component that interacts directly with the etcd data store
- Authenticate User
- Validate Request
- Retrieve data
- Update ETCD
- Scheduler
- Kubelet
What does kube-controller manager do?
Watch status e.g. every 5 secs for nodes
Remediate Situation
e.g. Node controller, replication controller (ensures desired no. of pods are present)
Which folder has all the config files for control plane components deployed using kubeadm
cat /etc/kubernetes/manifests/kube-controller-manager.yaml
cat /etc/kubernetes/manifests/kube-scheduler.yaml
What does kubelet do?
Registers the node with the kubernetes cluster
Create PODs
Requests container-engine to deploy the application in the POD
Monitor Mode & PODs and reports to kube-apiserver
KUBEADM does not deploy kubelet.. It should be manually installed
When is a service created?
To expose an application to other PODs. The other PODs can access the application using the name of the service. The service also gets an IP.
Service does not join the POD network.
Enable loose coupling between microservices application
What does kubeproxy do?
Runs on each node in the kubernetes cluster. It looks for new services and creates appropriate rules on each node to forward traffic to the POD using iptables rules
Single POD is always deployed on each node in the cluster (deployed as deamonset - e.g. logging)
What is a POD?
A single instance of an application. Containers are encapsulated in PODs
How to deploy a POD using kubectl?
kubectl run pod_name –image image_name
This command deploys a docker container by creating a POD
How to see a list of pods available?
kubectl get pods