In this article, We are going to cover Real time Kubernetes Interview Questions and Answers for Freshers and Experienced Candidate.
Kubernetes Interview Questions and Answers
1. What is Kubernetes
Kubernetes is one of the Leading open source Container Orchestration Engine. It is used to automatic cluster deployment, scaling and manage containerized applications.
2. What is difference between Docker Swarm and Kubernetes
Docker Swarm | Kubernetes |
It is Clustering for Docker Container | It is Container Orchestration |
Setup is Easy | Setup is Hard |
Application deployment using Pods, Deployments and Service | Application deployment using only Service |
Auto scaling is Not Possible | Auto scaling is possible |
It has no GUI Dashboard | It has GUI Dashboard |
It supports logging and monitoring using ELK Stack,Grafana,Influx,etc. | It does not support |
3. What is Kubeadm
Kubeadm helps for installing and configuring Kubernetes cluster using command line.
4. What are Kubeadm commands ?
Command Name | Purpose |
kubeadm init | Used on Master node and It is used to initialize and configure any node as a master node. |
kubeadm join | Used on worker node and It is used to initialize and configure any node as worker node. |
kubeadm token | It is used to genrate token. |
kubeadm version | It used to check kubeadm version. |
5. What are Kubernetes Cluster components on Master node
API Server, Scheduler, Controller Manager, ETCD
6. What are Kubernetes Cluster components on Worker node
Kubelet, Kubeproxy, Pods, Container
7. What is API Server
It is used to exposing various API’s. It is used to create,delete and update any object inside the cluster using kubectl command. API objects can be pods,containers,deployments,services..etc.
8. What is Scheduler ?
Scheduler is responsible for physically scheduling pods across multiple nodes, depending upon when we submit requirement to API server, scheduler schedules pod accordingly.
9. What is Controller Manager?
It is responsible overall health of entire cluster such as no of nodes insides the cluster, up and running status as per specification.
10. What is ETCD
etcd is light weight key-value database, it stores information like about current state of cluster,..etc.
11. What is Worker node in Kubernetes?
Worker node can be any Physical Server or Virtual Machine where containers are deployed , containers can be docker,rocket,.etc.
12. What is Kubelet ?
Kubelet is primary agent which runs on each worker node.It ensures containers are running in pod.
13. What is Kubeproxy?
It is core Networking component of Kubernetes cluster, it is responsible for entire network configuration, it maintains distributed network across all containers, pods and nodes.
14. What is Pod?
Pod is scheduling unit in Kubernetes, it consists of one or more container. With the help of pod we can deploy one or more container.
15. What are the different types of services in Kubernetes ?
Below are different types of services in Kubernetes
Cluster IP – It is used to expose the service on internal IP within cluster.
Node Port – It is used to expose the service from outside.
Load Balancer – It creates external load balancer and assigns external IP to service.
External Name Creating – It is used expose the service using name.
16. What is the difference between deployment and service in Kubernetes ?
Deployment is an object in Kubernetes, using Deployment we can create and manage pods using replica set from template.
Deployment manages creating Pods using of Replica Sets
Service is responsible to allow network access to a set of pods.
17. What is the difference between pod and deployment in Kubernetes?
Pod is scheduling unit in Kubernetes, it consists of one or more container. With the help of pod we can deploy one or more container.
Deployment is an object in Kubernetes, using Deployment we can create and manage pods using replica set from template.
Both are objects in the Kubernetes API
18. What is the difference between config map and secrets in Kubernetes?
Config maps stores application configuration in a plain text format.
Secrets store sensitive data like password in an encrypted format
19. What is namespace in Kubernetes?
Using namespace, we can logically organize objects in the cluster like pod and deployments. When you create Kubernetes cluster , default, kube-system and kube-public namespace are available.
20. What is ingress in Kubernetes?
Ingress is a collection of routing rules for external services running in a Kubernetes cluster.
21. What is Namespace in Kubernetes/k8s ?
It is Kubernetes objects which is used to create multiple virtual clusters within same physical cluster.
We can deploy Pods, deployment, service within each Virtual Cluster called as Kubernetes Namespace.
22. What is use of Namespace in Kubernetes ?
Suppose you have Dev, QA and Prod Environment in your project and you want separate each environment in same cluster and deploy pods, deployments and services also.
In this scenario you can separate these resource in by creating Namespaces for Dev,QA,Prod and create pods, deployments, services.
23. What is ingress in Kubernetes ?
Ingress it is a Kubernetes objects which allows access to your Kubernetes services from outside/external.
Using Ingress we can expose pod’s port like 80 ,443 from outside network of Kubernetes over internet.
24. What are the different types of Ingress Controller in Kubernetes
Below are some most used Ingress controllers on Kubernetes Cluster
- Nginx Ingress Controller
- AWS ALB
- Traefik
- Azure Application Gateway
- HA Proxy
- Contour
- Istio
25. What is Replication Controller in Kubernetes ?
A Replication Controller ensures that a specified number of pod replicas are running at any given time. In other words, a Replication Controller makes sure that a pod or a homogeneous set of pods is always up and available.
26. What is ReplicaSet’s in Kubernetes ?
A ReplicaSet’s purpose is to maintain a stable set of replica Pods running at any given time. As such, it is often used to guarantee the availability of a specified number of identical Pods. The ReplicaSets are also known as next generation replication controller.
ReplicaSets checks whether the target pod is already managed by another controller as well (like a Deployment or another ReplicaSet).
27. What is the Difference between Kubernetes Replication Controllers and ReplicaSets
Replication Controller and Replica Set do almost the same thing. Both of them ensure that a specified number of pod replicas are running at any given time.
The difference comes with the usage of selectors to replicate pods. Replica Set use Set-Based selectors which gives more flexibility while replication controllers use Equity-Based selectors.
28. Why we need replication in Kubernetes ?
A container or pod may crash because of multiple reasons. The main purpose of using Replication is Reliability, Load Balancing, and Scaling. It ensures that the pre-defined pods always exists.
To understand this in an easier manner lets take an example ->
Lets assume we are running our application on a single pod. What if for some reason our application crashes and the pod fails. Users will no longer be able to access our application.
To prevent users from losing access to our application we would like to have more than one instances of our application running at the same time. That way if one pod fails we still have our application running on the other one. The replication controller helps us run multiple instances of a single pod in the Kubernetes cluster. Thus providing high availability.
Conclusion:
We have covered, Kubernetes Interview Questions and Answers for Freshers and Experienced Candidate. If you need any support please comment.
Related Articles:
Jenkins Interview Questions for DevOps Engineer
50 Real Time Docker Interview Questions and Answers
How To Setup Kubernetes Cluster Using Kubeadm on Ubuntu
Reference: