Table of Contents
In this session, we will go through top Kubernetes Interview Questions and Answers for DevOps Professionals. As you might be aware that most of the Organization using docker containers are now moving towards Kubernetes Platform to manage their dockerized environment. So it is very important for a DevOps professionals or any other professionals who is going for Kubernetes Interview to have complete understanding about Kubernetes Interview Questions and Answers. I have tried to cover all the frequently asked Kubernetes Interview Questions in below sections.
Kubernetes Interview Questions and Answers for DevOps Professionals
1. What is Ingress ?
Ans. It is an API object which provides set of routing rules to route HTTP/HTTPS traffic from outside the Cluster to services within the cluster.
2. What is Ingress Controller ?
Ans. Every Kubernetes Cluster which is having an ingress will have Ingress Controller as well. Ingress Controller is used to manage the ingress resources usually with a load balancer.
3. What are different options to expose a service to external network requests ?
Ans. Below are the possible options using which a service can be exposed to external network requests:-
4. What is the command to check complete information about Ingress ?
Ans. kubectl describe ingress <ingress_name>
5. Can we use more than one Ingress Controller in a Cluster ?
Ans. Yes, we can.
6. Which class is used to indicate the ingress controller when you are using multiple ingress controller in a Cluster ?
7. What is Service in Kubernetes ?
Ans. A service is a REST object just like a pod in Kubernetes.
8. What is the default protocol used for Services in Kubernetes ?
9. Which field provides a way to specify an application protocol for each Service Port ?
10. What are different modes in which Kube proxy can run ?
Ans. There are three different modes in which kube proxy can run :-
11. Which field can be used to Specify your own Cluster IP Address as part of a Service creation request ?
12. What are different types of Services in Kubernetes ?
Ans. There are four different types of Services in Kubernetes:-
13. What are different ways to discover Kubernetes Service ?
Ans. There are two different ways to discover Kubernetes Service:-
B) Env Var
14. What is RollingUpdate in Kubernetes ?
Ans. RollingUpdate allows deployment updates to take place in zero downtime by incrementally updating pods instances with new ones.
15. What is Job in Kubernetes ?
Ans. A job in Kubernetes is an object which is responsible for creating and managing set of pods using batch processes.
16. What is Service Mesh ?
Ans. It can be defined as an Infrastructure Layer which handles the Internal Microservices communications.
17. What is Daemonset ?
Ans. A Daemonset in Kubernetes is an object which is responsible for running a copy of a pod in some or all of the nodes in a cluster.
18. What does etcd service do ?
Ans. etcd service is used to store and maintain the critical data like metadata, configuration data and state of the Cluster. It acts as a Kubernetes primary datastore.
19. What is the difference between Deployment and Service in Kubernetes ?
Ans. A deployment is responsible for keeping set of pods in running state and a service is responsible for enabling network access to set of pods.
20. Can a deployment runs without a Service ?
21. Can we use a Service without a deployment ?
22. Which of the Kubernetes Objects support matchLabels ?
Ans. Below Objects support matchLabels in Kubernetes:-
23. How to expose a deployment "hello-app" to Internet on Port 80 ?
Ans. kubectl expose deployment hello-web --type=LoadBalancer --port 80 --target-port 8080
24. How to Check External IP of a deployment ?
Ans. kubectl get service
25. What is EKS ?
Ans. EKS is known as Amazon Elastic Kubernetes Service. This service provides the flexibility to start, run and scale the Kubernetes applications in the AWS Cloud or on-premises.
26. What is AKS ?
Ans. AKS is Known as Azure Kubernetes Service. It is fully managed service for deploying, running and scaling the Kubernetes applications in the Azure Cloud.
27. What is Configmap in Kubernetes ?
Ans. Configmap is an API object in Kubernetes which is used to inject configuration data in containers during startup. Usually non-confidential data are stored in configmap in the form of key value pair. More can be checked on Kubernetes Official Documentation.
28. Can we create Configmap and the pod to which it is providing the config data in different namespaces ?
Ans. No. Both should be available on same namespace.
29. From which Kubernetes version, we can add an "immutable" field to a ConfigMap definition ?
30. What is the main difference between "data" and "binaryData" field in ConfigMap ?
Ans. The data field is designed to contain UTF-8 byte sequences whereas binaryData field is designed to contain binary data.
31. How to create a ConfigMap in Kubernetes ?
Ans. kubectl create configmap <map-name> <data-source>
32. How to Check the details of a ConfigMap ?
Ans. kubectl describe configmaps <map-name>
33. From which Kubernetes version, kubectl supports Kustomization.yaml ?
Ans. Since v1.14
34. How to create namespace in Kubernetes ?
Ans. kubectl create namespace <namespace-name>
35. How to Limit minimum and maximum memory values in a Namespace ?
Ans. Using LimitRange Object
36. By default, are the pods isolated or non-isolated ?
37. How Pods become Isolated ?
Ans. Using NetworkPolicy
38. What will happen to the pods which does not get selected by NetworkPolicy in a Namespace ?
Ans. It will continue to accept all the traffic.
39. What will happen if we use empty podSelector in NetworkPolicy resource ?
Ans. It will select all the pods in the Namespace.
40. How to check kubectl configuration ?
Ans. kubectl config view
41. How to check all the Kubernetes Cluster Events ?
Ans. kubectl get events
You will see more Kubernetes Interview Questions and Answers coming up in future articles. So Keep Reading !!!