Are you looking for somewhere to learn more about Kubernetes interview questions? You’re in the right place! We publish a Kubernetes question every day on our social media channels, LinkedIn, Telegram, and YouTube, and at the end of the week, we provide the correct answers with details here. If you want to test your Kubernetes knowledge or prepare yourself for Kubernetes role interviews, follow our social media.
What is the main goal of the Deployment controller?
A) Pod security and compliance
B) High availability and scaling
C) Upgrades and rollbacks
D) Application load balancing
The Deployment controller’s goal is to provide a way for application upgrades, rollouts, and rollbacks. This controller uses the ReplicaSet resource under the hood to achieve the desired state, scaling and high availability of applications. So, the Deployment controller itself has no mission except upgrades, rollouts and rollbacks.
What is the main advantage of EndpointSlice vs Endpoints?
A) Split Pods into different slices for security
B) Reduce the system overhead of updating endpoints
C) Provide better observation for the Pods
D) Provide a way for cluster multi-tenancy management
When you have tons of Pods of your application, the legacy Endpoints controller keeps track of all of them in one object. So, by growing the number of replicas, your legacy Endpoints resource gets bigger and bigger. In a stable situation, everything is good, but if something goes wrong with your application or you change, scale or upgrade the application, Kubernetes needs to upgrade a large object which creates a huge overhead on Kubernetes components. The new EndpointSlice controller provides the same capabilities as the Endpoints controller, but it splits endpoints into chunks of 100 endpoints to minimize the object size and reduce the impact.
What does happen if we set restartPolicy=Always in an init container?
A) It automatically restarts the init container if it exits the execution
B) It changes init container lifecycle behaviour to live as much as regular containers
C) It does not wait to complete to start the next init container
D) All of the above answers
This option is a new feature in Kubernetes 1.28 called Sidecar. Before this feature, we had problems running sidecars in special situations, like Jobs and CronJobs. This feature allows you to provide restartPolicy option per container for initContainers , and the value can only be Always which means this is a sidecar container, and it should live as much as the regular containers. When you use this option, the normal behaviour of the init container will be changed, and that init container will not exit, and the next init container will not wait for the previous one to end “Normally, the first init container should exit successfully, then the next one will be run, and after running all init containers, regular containers will be started”, if the init container exits, it gets restarted again.
A) A kind of toleration which evicts Pods with delay after taints get added
B) A kind of eviction which evicts Pods based on a pre-defined scheduling rule
C) A kind of toleration which bypasses all taints to prevent Pod evictions
D) A kind of eviction which happens after removing the node taint
Taint-based eviction is a way to tell the scheduler to evict Pods with some delay after a new taint gets added to the node. We mostly use this method of eviction to customize the eviction time after node failures to bypass the default 5m eviction timeout.
What is the Common Expression Language in Kubernetes?
A) A language to develop and maintain Kubernetes core
B) A language to develop Kubernetes controllers and operators
C) A language to implement Policy-as-Code in Kubernetes
D) A language to test Kubernetes before releasing the new version
Common Expression Language (CEL) is a new expression language evaluated directly within the Kubernetes API Server to implement Policy-as-Code. Before introducing this language, we had to use external systems and languages like OPA/Rego, Kyverno, etc., for implementing Policy as Code. Now, we can use this feature to implement our Policy as Code logic natively in Kubernetes without any external tools.
Kubernetes itself is wild. Man vs. Wild in interviews needs deep knowledge, hands-on experience and additional skills to pass. If you want to pass Kubernetes role interviews, read more and do many more with Kubernetes. Our goal in Kubedemy is to help you understand and solve Kubernetes difficulties in all situations.
If you like this series of articles, please share them and write your thoughts as comments here. Your feedback encourages me to complete this massively planned program.