Pods are created in a sequential order when a StatefulSet is set up. This means that for a StatefulSet with N replicas, the Pods are deployed one by one, starting from the Pod with the index 0 and ending with the Pod with the index N-1. Each Pod has to be in the Running and Ready state before the next Pod is created. This ensures that the Pods have a predictable and unique identity and can be connected to their corresponding persistent volumes. References:
Question 2
Which kubectl command lists pods with the exact label "env-dev"?
Options:
A.
kubectl get pods -L env
B.
kubectl get pods -I env
C.
kubectl get pods - env=dev
D.
kubectl get pods -L env-dev
Answer:
C
Explanation:
Explanation:
The kubectl command to list pods with the exact label “env-dev” is kubectl get pods -l env=dev. The -l or --selector flag allows you to filter pods by label selectors, which are key-value pairs that are attached to pods. The = operator matches pods that have the exact label value specified. The -L or --label-columns flag adds a column with the value of the specified label(s) to the output, but does not filter the pods. The -I or --ignore-not-found flag returns an exit code of 0 when no resources are found, but does not affect the output. The -l env-dev flag is invalid, as it does not specify a label value. References: 6, 7, 9
Question 3
What are some features of Kubernetes? Note: There are 3 correct Answers to this question.
Options:
A.
Process management and optimization
B.
Immutability and self-healing
C.
Extensibility and ecosystem
D.
Automated rollouts and rollbacks
E.
Integration and assessment
Answer:
B, C, D
Explanation:
Explanation:
Some of the features of Kubernetes are:
Immutability and self-healing: Kubernetes treats pods as immutable, meaning that they are not modified after they are created. Instead, pods are replaced with new ones when they need to be updated or repaired. This ensures that the pods are always in a consistent and predictable state. Kubernetes also monitors the health and availability of the pods and automatically restarts, reschedules, or replicates them if they fail or become unresponsive1.
Extensibility and ecosystem: Kubernetes is designed to be extensible and modular, allowing users to customize and extend its functionality according to their needs. Kubernetes supports various extensions, such as custom resources, operators, admission controllers, schedulers, network plugins, storage plugins, and more. Kubernetes also has a large and vibrant ecosystem of tools, services, and applications that are built on top of or integrate with it2.
Automated rollouts and rollbacks: Kubernetes enables users to deploy and update their applications with zero downtime, using declarative configuration and rolling updates. Kubernetes ensures that only a certain number of pods are changed at a time, and that the new pods are ready before terminating the old ones. Kubernetes also tracks the history of each update and allows users to roll back to a previous version if something goes wrong3.