Cluster Management Flashcards
What is meant by “Stacked Etcd?”
Each control plane node has its own Etcd instance in a cluster with multiple control plane nodes.
What is meant by “External Etcd?”
In a Kubernetes cluster with multiple control plane nodes, Etcd for each control plane runs on a completely separate node, and there may be multiple Etcd nodes for multiple control plane nodes.
What command would you use to drain a node called “node1” in a K8s cluster?
kubectl drain node1
How would you drain a node that is running DaemonSet pods?
kubectl drain <node-name> --ignore-daemonsets</node-name>
What is a DaemonSet?
In Kubernetes, a DaemonSet is a pod tied specifically to a node.
After maintenance of a K8s node is complete, what command would you use to tell Kubernetes that it can run pods again?
kubectl uncordon <node-name></node-name>
What command would you use to see which node each pod is running on?
kubectl get pods -o wide
What command would you use to return a node to service after maintenance?
kubectl uncordon <node-name></node-name>
How would you backup Etcd?
ETCDCTL_API=3 etcdctl –endpoints $ENDPOINT snapshot save <file-name></file-name>
How would you restore Etcd?
ETCDCTL_API=3 etcdctl snapshot restore <file-name></file-name>
What command can you use to allow Pods to be scheduled on a previously-drained node after Node maintenance is complete?
A. kubectl undrain
B. kubectl enable
C. kubectl uncordon
D. kubectl add node
C. kubectl uncordon
This command will allow Pods to be scheduled on a previously-drained Node.
What software does Kubernetes use to store data about the state of the cluster?
A. kube-system
B. Redis
C. MySQL
D. Etcd
D. Etcd
Etcd is the Backend data store or Kubernetes.
Which tool provides a command-line interface for Kubernetes?
A. kubeadm
B. Minikube
C. kubectl
D. k3s
C. kubectl
kubectl provides a command-line interface to the Kubernetes API.
How can you make Kubernetes highly available?
A. Have one control plane node.
B. Use HTTPS for Kubernetes API Server traffic.
C. Have multiple control plane nodes.
D. Have multiple replicas of each Application’s Pod.
C. Have multiple control plane nodes.
An HA setup for Kubernetes involved multiple control plane nodes.
Which command allows you to upgrade control plane components?
A. kubeadm upgrade plan
B. kubeadm upgrade apply
C. kubeadm version set
D. kubectl upgrade
B. kubeadm upgrade apply
This command will upgrade the control plane.
Which tool can help you perform a Kubernetes upgrade?
A. kubeupgrd
B. kube-scheduler
C. kubeadm
D. kube-controller-manager
C. kubeadm
kubeadm includes functionality to help you upgrade Kubernetes clusters.
Which command is used to safely evict your pods from a node before maintenance on the node?
A. kubectl delete node.
B. kubectl drain
C. kubectl cordon
D. kubectl remove
B. kubectl drain
kubectl drain is used to take a node down for maintenance.
Which tool(s) allow you to create Kubernetes clusters?
Choose 2
A. Helm
B. kubeadm
C. kubectl
D. Minikube
B. kubeadm
D. Minikube
kubeadm allows you to build Kubernetes clusters.
Minikube allows you to easily create single-node clusters.
Which command-line tool allows you to interact with Etcd and perform backups?
A. kubeadm
B. etcdctl
C. etcdadm
D. kube-backup
B. etcdctl
etcdctl is the command-line tool for Etcd.
Which of the following are options for a highly-available Etcd architecture?
Choose 2
A. Layered Etcd
B. External Etcd
C. Stacked Etcd
D. Single Etcd Server
B. External Etcd
C. Stacked Etcd
External etcd, or managing Etcd separately from other control plane components, is one option for an HA setup.
Stacked etcd, or managing Etcd alongside other control plane components, is one option for an HA setup.
What is kubectl?
kubectl is a command-line tool that allows your to interact with Kubernetes. kubectl uses the Kubernetes API to communicate with the cluster and carry out your commands.
You can use kubectl to deploy applications, inspect and manage cluster resources, and view logs.
What are the options for the ‘kubectl get’ command?
-o : set output format
–sort-by : sort output using a JSONPath expression
–selector : filter results by label
$ kubectl get <object-type> <object-name> -o <output> --sort-by <JSONPath> --selector <selector></selector></JSONPath></output></object-name></object-type>
What does kubectl describe
do?
Allows you to get detailed information about specific Kubernetes objects using kubectl describe.
$ kubectl describe <object-type> <object-name></object-name></object-type>
What does kubectl create
do?
Use ‘kubectl create’ to create objects.
Supply a YAML file with -f to create an object from a YAML descriptor stored in the file.
$ kubectl create -f <filename></filename>
If you try to use ‘kubectl create’ in a cluster that contains an object with the same name, you will get an error.