Loading…

Kubernetes Interview Questions and Answers

By Umesh Singh
Last update: 07 Jul 2020, 19 Questions

Kubernetes is used as a platform for automating direction, scaling, and program setup. Created by Google, it is currently managed by Cloud Indigenous Computing Foundation. It supports multiple programming paradigms, procedural, object-oriented, and functional programming. Our collection of Kubernetes Interview Questions shall help you to understand the basics of this language. Kubernetes intends to provide an efficient solution for systems by simplifying installation, scaling, and operations of app containers round clusters of hosts. It operates on a cluster mode to reach out to container programs. Most cloud hosting providers supply a Kubernetes-based infrastructure or platform for something (PaaS or even IaaS) in which Kubernetes may be set up as being platform-providing support.

Kubernetes
What is the latest version of Kubernetes? 1.179th December 2019
Who is the developer of Kubernetes? Cloud-Native Computing Foundation
What language does Kubernetes use? Golang
License Apache License 2.0
Official Website https://kubernetes.io

Below are some Kubernetes interview questions which are vital for candidates whether they are a beginner, intermediate or expert.

Most Frequently Asked Kubernetes Interview Questions

1. Which is better Docker Swarm vs Kubernetes?

Though both Docker Swarm and Kubernetes are wired to save resources by limiting the use of hardware and leveraging cloud-based applications to meet the business resource requirement, there are some differences between them that call for a subjective analysis before going down one chosen road.

Docker Swarm Kubernetes
It is a bit advanced and requires skills of Docker CLI Easy to Install
No in-built tools, though there is a scope to download third-party apps. Have in-built tools for logging and performance monitoring.
Is advanced and has the potential to scale much higher than Kubernetes. It’s not as scalable as Docker Swarm, but it is known for its strength to maintain clusters.
2. What is the need for Container Orchestration?

Container orchestration is basically managing the lifecycle of multiple containers, especially in large and/or dynamic environments. Developer Teams generally use it to control and automate multiple tasks such as:

  • Setting up and deployment of containers
  • Repetition and availability of containers
  • Editing, scaling or removing containers in such a way that load is spread evenly on the host architecture
  • Moving specific containers between clusters or from one host to another to maintain the balance of supply/demand in a host, or if a host expires
  • Allocating resources to containers as per requirement
  • Maintaining and controlling external exposure of services running in a container with the outside environment
  • Load balancing of service discovery between containers
  • Health monitoring of containers and hosts
  • Configuration of an application in accordance with the containers running in it

Note: The above Kubernetes interview questions and answers are a guide to candidates preparing for a job change.

3. How many nodes are in a Kubernetes cluster?

In Kubernetes v1.17, up to 5000 nodes can be supported within a cluster.

4. What is cAdvisor in Kubernetes?

cAdvisor is an open-source resource usage collector for containers in a cluster. It is used in Kubernetes to support containers natively while operating on a per-node basis.

It auto-discovers all containers in a specific node and collects CPU, memory, filesystem, and network usage stats. cAdvisor also provides useful metrics like overall machine usage by analyzing the ‘root’ container on your machine.

5. What is the use of Kubelet?

A Kubelet is the lowest level component present in Kubernetes. It is used for supporting and maintaining what’s running on every individual machine. It's like a process watcher focused on running a given set of containers.

6. What is Minikube in Kubernetes?

Minikube is an open-source tool that enables a user to run Kubernetes on a laptop or other local machines. It can work with various Operating Systems like Linux, Mac, and Windows. It works as a single-node cluster inside a virtual machine on your local machine. It is used in Kubernetes to evaluate important features and help scale the environment via effective maintenance and control.

Note: The above Kubernetes interview questions are a guide to candidates and may help in securing a relevant job.

7. What are the components of Kubernetes?

Components in Kubernetes are a vital process in a cluster that helps in the overall scalability and maintenance of an environment. Here's an image of how different components in Kubernetes combine to perform efficiently.

Components fall under two main categories which consist of sub-categories:

1. Master Components:

  • Kube-apiserver
  • Etcd
  • Kube-scheduler
  • Kube-controller-manager

2. Node Components:

  • Kubelet
  • Kube-Proxy
  • Container Runtime
8. What is Heapster in Kubernetes?

Heapster is an open-source metrics collection system that is used for performance monitoring and is compatible with Kubernetes versions 1.0.6 and above. It ensures the collection of performance metrics about specific workloads, pods, nodes and containers. In addition, it also allows for the collection of metrics during events and other signals being generated by your cluster. It helps and supports multiple backends for persisting the data.

9. What is Kubernetes metrics server?

Metrics Server is used as a cluster-wide aggregator of resource usage data. It is used to collect data and manage it among resources in a set of clusters. Its primary purpose is to collect metrics like CPU or memory consumption for containers or nodes, from the Summary API, exposed by Kubelet on each node.

10. What is Prometheus in Kubernetes?

Prometheus is an open-source metrics collection system originally developed at Soundcloud, and more recently integrated into the CNCF. It is powerful due to its data model, a rich set of client libraries functions, and its ability to create user-specific custom alerts or notifications based on data through metrics. Prometheus comes with its own standard dashboard which can be used to run ad-hoc queries or minor issues during debugging, but the most important aspect of Prometheus is utilized when integrating it with visualization backends.

Note: The above interview questions on Kubernetes are a guide to experienced, intermediate and beginner developers preparing for a job change.

11. What is Kubernetes ClusterIP?

A Kubernetes ClusterIP is the unique IP address that is assigned to each Kubernetes Service as soon as they are created.

12. What is service and deployment in Kubernetes?

A service in Kubernetes is defined as an abstraction that constitutes a logical set of pods running at a point in your cluster, providing the same functionality.

A deployment in Kubernetes is a resource object that provides a declarative update to the applications. A deployment enables you to describe an application's life cycle, like which images to use for the app, the number of pods to be present, and their way of getting updated.

13. What is the difference between POD and deployment in Kubernetes?
Kubernetes Pod Kubernetes Deployment
This is a collection of containers and basic objects. All the containers of a pod lie within the same node. This is a kind of controller in Kubernetes. All the containers. All the controllers provide a Pod Template for you to create one responsible for each of them.
It is not suitable for the production stage. It is best suited for the production stage.
It has no rollout or rollback updates. It has both rollout and rollback updates.
It does not monitor each stage of deployment. It monitors each stage of the pod.
14. What is a headless service Kubernetes?

A headless service in Kubernetes is one having a service IP returning the IPs of associated pods instead of performing load-balancing. This allows us to interact directly with pods instead of a proxy.

15. What is a Kubernetes endpoint?

An Endpoint in Kubernetes is basically the list of addresses, both IP and port) of the endpoints that implement a Kubernetes service.

16. What is load balancing in Kubernetes?

Technically, Load balancing is the procedure for efficiently distributing any network's traffic among multiple backend services. It is a very critical strategy for maximizing scalability and availability throughout the network. In Kubernetes, there are various choices for executing the load balancing of external traffic to pods.

17. What is Kubernetes DNS?

The DNS or Domain Name System in Kubernetes is a process used for associating various types of information, such as IP Addresses with easy to remember names. Kubernetes DNS is set up automatically in the clusters to provide a secure and lightweight mechanism for service discovery.

The in-built service discovery in Kubernetes DNS allows applications to find and communicate with each other very quickly.

18. What is a Pod in Kubernetes?

A Pod in Kubernetes is actually a group of one or more containers having shared storage/network settings and a standard specification for running the containers. It contains one or more application containers that are relatively tightly coupled and are executed on the same physical or virtual machine.

19. What are Kubernetes labels?

In Kubernetes, Labels are key or value pairs being attached to objects, such as pods. The labels are meant to be used for specifying the identifying attributes of the objects meaningful and relevant for the users. They do not directly imply these semantics on to the core system. Labels are also used for organizing and the selection of subsets of the objects. It can be attached to objects at the time of creation and can be subsequently added and modified at any time.