Kubernetes Interview Questions
Last updated on Nov 20, 2023
Kubernetes is an open-source container management tool that holds container deployment, scaling and descaling of containers and load balancing. It offers an outstanding community and works smartly with all the cloud providers. Kubernetes is not a containerization platform, but it is a multi-container management solution.
In this article, you can go through the set of Kubernetes interview questions most frequently asked in the interview panel. This will help you crack the interview as the topmost industry experts curate these at HKR training.
Let us have a quick review of the Kubernetes interview questions.
Most Frequently Asked Kubernetes Interview Questions and Answers
- What are the benefits of Kubernetes
- Why use Kubernetes
- Mention the types of controller managers
- Explain the types of Kubernetes pods
- What is Heapster
- What is Kubectl
- Mention the uses of GKE
- What is Kube-proxy
- What are the different components of Kubernetes Architecture
- Explain Replica set
What are the benefits of Kubernetes?
Ans: It is very easy to handle containers with the container orchestration tool of Kubernetes. Customer demands are responded by deploying the applications faster and in a more predictable manner.
Few of Kubernetes benefits are:
- Automatic scheduling
- Automated rollback
- Horizontal scaling
- Auto-healing capabilities
Become a Kubernetes Certified professional by learning this HKR Kubernetes Training !
What is Container Orchestration?
Ans: Application orchestration in the software process which integrates two or more applications. With Container Orchestration, you are able to automate the arrangement, build the coordination, and manage the computer software. The goal of any orchestration process is to streamline and optimize frequently repeatable processes.
Learn K8s (Kubernetes) Course to Become a Certified Kubernetes Administrator (CKA)
Why use Kubernetes?
Ans: Kubernetes is used because:
- The services such as on-premises bare metal, OpenStack, public clouds Google, Azure, AWS, etc. are run by Kubernetes.
- It helps in avoiding the vendor lock issues which can use any vendor-specific APIs or services except where Kubernetes provides an abstraction.
Example: load balancer and storage. - It enables the applications that have to be released and updated without any downtime.
- Kubernetes allows you to assure those containerized apps run when and where you need. It helps you to find resources and tools which you want to work.
What are the features of Kubernetes?
Ans: The Kubernetes features include.
- Automated Scheduling.
- Self-Healing Capabilities.
- Automated rollouts & rollback.
- Horizontal Scaling & Load Balancing.
- Offers environment consistency for development, testing, and production.
- Infrastructure is loosely coupled to each component which acts as a separate unit.
- Provides a higher density of resource utilization.
- Offers enterprise-ready features.
- Application-centric management.
- Auto-scalable infrastructure.
- You can create a predictable infrastructure.
How is Kubernetes related to Docker?
Ans: A Docker provides the lifecycle management of containers. The Docker image builds the runtime containers. As the individual containers have to communicate, Kubernetes is used. So, Docker builds the containers and these containers communicate with each other via Kubernetes. So, containers running on multiple hosts can be manually linked and orchestrated using Kubernetes.
What is the difference between Kubernetes and Docker Swarm?
Ans:
Kubernetes:
- It provides an auto-scaling feature.
- Load balancing settings are configured manually.
- Kubernetes installation is very complicated and time-consuming.
- GUI features are available.
- It provides a built-in load balancing technique.
Docker Swarm:
- It doesn’t provide any auto-scaling feature.
- Load balancing is automated.
- Docker installation is very easy and fast.
- GUI features are not available.
- Services are maintained while updating with process scheduling.
Mention the types of controller managers.
Ans: The types of controller managers are:
- endpoints controller.
- service accounts controller.
- node controller.
- namespace controller.
- replication controller.
- token controller.
Kubernetes Certification Training
- Master Your Craft
- Lifetime LMS & Faculty Access
- 24/7 online expert support
- Real-world & Project Based Learning
List various services available in Kubernetes?
Ans: Various services available in Kubernetes are:
- Cluster IP service.
- Load Balancer service.
- Node Port service.
- External Name Creation service.
What are the tools that are used for container monitoring?
Ans: The tools which are used for container monitoring are.
- Heapster
- cAdvisor
- Prometheus
- InfluxDB
- Grafana
. Explain the types of Kubernetes pods
Ans: There are two types of Kubernetes pods.
- Single Container Pod: It can be created with the run command.
- Multi Container pods: It can be created using the "create" command in Kubernetes.
. What are the types of Kubernetes Volume?
Ans: The types of Kubernetes volume are:
- EmptyDir
- GCE persistent disk
- Flocker
- HostPath
- NFS
- ISCSI
- Rbd
- PersistentVolumeClaim
- downwardAPI
. What do you understand by a node in Kubernetes?
Ans:
- A node in Kubernetes is the main worker machine.
- Nodes are also known as minions.
- It runs on a physical machine or a virtual machine.
- It provides all necessary services to run Pods.
- The node in Kubernetes is managed by the master.
. What is Heapster?
Ans:
- Heapster is a cluster-wide aggregator of data provided by Kubelet which runs on each node.
- It is a container management tool which is supported natively on Kubernetes cluster and runs as a pod, just like any other pod in the cluster.
- It discovers all nodes in the cluster and queries about usage information from the Kubernetes nodes in the cluster, via on-machine Kubernetes agent.
. What is Minikube?
Ans:
- Minikube is a tool that makes it easy to run Kubernetes locally.
- Minikube runs a single-node Kubernetes cluster inside a virtual machine.
. What is Kubectl?
Ans:
- Kubectl is a platform through which you can pass commands to the cluster.
- Kubectl provides the CLI to run commands against the Kubernetes cluster with various ways of creating and managing the Kubernetes component.
. What is Kubelet?
Ans:
- Kubelet is an agent service which runs on each node and enables the slave to communicate with the master.
- Kubelet works on the description of containers provided to it in the PodSpec and makes sure that the containers described in the PodSpec are healthy and running.
[Related Training : Prometheus Training]
. What do you understand about load balancers in Kubernetes?
Ans: A load balancer is a common standard procedure which presents the service. Depending on the working environment, a load balancer is of two types. The internal load balancer and external load balancer.
Internal Load Balancer:
It automatically balances load and allocates the pods with the required configuration.
External Load Balancer:
It directs the traffic from the external load to the backend pods.
. Mention the uses of GKE.
Ans: GKE stands for Google Kubernetes Engine and its uses are:
- It is used for creating the docker container clusters.
- Resizing the application controllers.
- Updating and then upgrading the clusters of containers.
- Debugging the cluster of the container.
- It creates a replication controller, jobs, services, container pods, or load balancer.
. What are the objectives of the replication controller?
Ans: The objectives of the replication controller are.
- It is responsible for controlling and administering the pod lifecycle.
- It monitors and verifies whether the allowed number of replicas is running or not.
- It helps the user in checking the pod status.
- It enables altering a pod. The users can drag their position with free will.
Subscribe to our YouTube channel to get new updates..!
. What is the role of kube-apiserver and kube-scheduler?
Ans:
Kube-apiserver:
- It follows the scale-out architecture and is the front-end of the master node control panel.
- This unveils all the APIs of the Kubernetes Master node components.
- It is responsible for establishing communication between the Kubernetes Node and the Kubernetes master components.
Kube-scheduler:
- It is responsible for the distribution and management of workload on the worker nodes.
- It selects the most suitable node to run the unscheduled pod based on resource requirement and keeps a track of resource utilization.
- It makes sure that the workload is not scheduled on nodes which are already full.
. What is Kube-proxy?
Ans:
- It is an implementation of both a network proxy and a load balancer.
- It supports service abstraction used with other networking operations.
- It is responsible for directing traffic to the container depending on IP and the port number.
. What are the ways to provide API-Security on Kubernetes?
Ans: The ways to provide API-Security on Kubernetes is as follows:
- Using correct auth mode with API server authentication mode = Node.
- Make kubeless that protects its API via authorization-mode = Webhook.
- Ensure the Kube-dashboard uses a restrictive RBAC (Role-Based Access Control) policy.
. What is ETCD?
Ans:
- Etcd is a distributed key-value store used for coordinating between distributed work.
- It is written in Go programming language.
- It stores the configuration data of the Kubernetes cluster, representing the state of the cluster at any given point in time.
. Why use namespace in Kubernetes?
Ans:
- Namespaces in Kubernetes are used for dividing cluster resources between users.
- Namespaces in Kubernetes helps the environment where more than one user spread projects or teams and provides a scope of resources.
. Define Stateful sets in Kubernetes.
Ans:
- The stateful set is a workload API object which manages the stateful application.
- It also manages the deployments and scaling of the sets of pods.
- The state information and other data of stateful pods are stored in the disk storage, which connects with the stateful set.
. What are the different components of Kubernetes Architecture?
Ans: The Kubernetes Architecture mainly comprises two components. The master node and the worker node. The master and the worker nodes have many inbuilt components within them.
- Master node: It has kube-controller-manager, kube-apiserver, kube-scheduler, etc.
- Worker node: It has kubelet and kube-proxy running on each node.
. What do you understand by Cloud controller manager?
Ans:
- It takes the responsibility of persistent storage, network routing, abstracting the cloud-specific code from the core Kubernetes specific code, and managing the communication with the underlying cloud services.
- It is divided into several different containers depending on the cloud platform that runs and enables the cloud vendors and Kubernetes code to be developed without any inter-dependency.
- The cloud vendor develops their code and connects with the Kubernetes cloud-controller-manager while running the Kubernetes.
. What are the types of cloud controller manager?
Ans: The various types of cloud controller manager is as follows.
- Node controller: It verifies and confirms that the node is deleted properly after it has been stopped.
- Route controller: It manages the traffic routes in the underlying cloud infrastructure.
- Volume controller: It manages the storage volume and interacts with the cloud provider to orchestrate volume.
- Service controller: It is responsible for the management of the cloud to provide load balancers.
. Why use Daemon sets?
Ans: Daemon sets are used because:
- It enables to run storage platforms like ceph and glusterd on each node.
- Daemon sets run the logs collection on every node such as filebeat or fluentd.
- It performs node monitoring on each and every node.
. Explain Replica set.
Ans: A Replica set is used to keep replica pods stable. It enables specifying the available number of identical pods. Replica set is considered as a replacement for the replication.controller.
Upcoming Kubernetes Certification Training Online classes
Batch starts on 10th Nov 2024 |
|
||
Batch starts on 14th Nov 2024 |
|
||
Batch starts on 18th Nov 2024 |
|