Kubernetes Interview Questions – Part 8 – 08 December 2023
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.
Follow our social media:
https://www.linkedin.com/in/ssbostan
https://www.linkedin.com/company/kubedemy
https://www.youtube.com/@kubedemy
Kubernetes Interview Questions:
04 December 2023:
What is Context in Kubeconfig?
- A) It’s a piece of data that shows the cluster information
- B) It’s a piece of data that shows the user credentials
- C) It’s a piece of data that bounds the user to the cluster
- D) It’s a piece of data that shows access boundaries
In the kubeconfig
file, we have three main top sections clusters
, users
and contexts
. clusters
field stores all the clusters we have or want to communicate and consists of clusters’ API server address and CA certificate. users
field stores users’ information such as a public key, private key, token, etc. In the same kubeconfig file, you can have multiple clusters and users, or in some cases, you have only one user and many clusters. contexts
field bounds users to clusters, and it configures with which user we can connect to which cluster. You can also set your default context.
05 December 2023:
What is the right way to select the proper ingress class?
- A) Set
ingressClassName
in Ingress spec - B) Set
kubernetes.io/ingress.class
annotation in Ingress spec - C) Set both the above options at the same time
- D) Set Ingress Controller config to manage all ingresses without class
In the new Kubernetes versions, using ingressClassName
is become standard. The annotation model is for old versions, and it’s better to avoid using it in the latest versions. Using both of them at the same time is not possible, and if you try this, you will get an error. Also, configuring the Ingress Controller to ignore the ingress class name is not good because, in multi-ingress environments, it creates conflict for all installed ingress controllers. So, try to use ingressClassName
in your new clusters.
06 December 2023:
What metrics-server does in Kubernetes?
- A) Provide metrics about Kubernetes resources
- B) Provide metrics about Container resources
- C) Provide metrics about Audit logs and actions
- D) Provide metrics about Network resources
The metrics server is a scalable component that provides containers’ metrics used in HPA and VPA resources. This component provides you with CPU and Memory metrics of containers and helps you configure your Horizontal Pod Autoscalers and Vertical Pod Autoscalers in Kubernetes. Keep in mind we also have another component called kube-state-metrics
, which provides information about the cluster and resources.
https://github.com/kubernetes-sigs/metrics-server
https://github.com/kubernetes/kube-state-metrics
07 December 2023:
In which method, if you update the ConfigMap, it automatically gets reflected to the Pod? (without restarting the Pod or signalling application)
- A) Using ConfigMap as Pod command line arguments
- B) Using ConfigMap as environment variables
- C) Using ConfigMap as a volume and mount it to the Pod
- D) All of the above options
When you mount ConfigMap and Secret resources as volumes to the Pods, Kubernetes checks for their changes and updates the files in the Pods’ containers automatically every minute. This option comes from the basic concepts of file systems: if something gets changed in the host filesystem, it must be reflected in the container filesystem as well.
Conclusion:
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.
Follow my LinkedIn https://www.linkedin.com/in/ssbostan
Follow Kubedemy LinkedIn https://www.linkedin.com/company/kubedemy
Follow Kubedemy Telegram https://telegram.me/kubedemy