Kubernetes is an open-source container orchestration platform written in the Go programming language. Also known as K8, Kubernetes was originally designed by Google and is now maintained by the Cloud Native Computing Foundation. This article lists the top interview questions for Kubernetes.
Table of Contents
If you are preparing for an interview for the position of DevOps engineer, software engineer, or full-stack developer, then you must prepare yourself to answer questions related to Kubernetes. This Kubernetes interview questions guide will acquaint you with Kubernetes fundamentals and prepare you to answer different questions that recruiters ask during job interviews. Here are the popularly asked questions Kubernetes interview questions and answers for freshers and experienced candidates to set you up on the path to a great career in this field.
Top Kubernetes Interview Questions and Answers
The following are the most important Kubernetes interview questions that you must prepare for your upcoming interview.
Q1. What is Kubernetes?
Ans. Kubernetes is an open-source container orchestration platform written in the Go programming language. Also known as K8, Kubernetes was originally designed by Google and is now maintained by the Cloud Native Computing Foundation. It automates the tasks of management, monitoring, deploying, scaling, and load-balancing of applications. It also helps in managing several containers which provide for logical units that can be discovered and managed.
Explore popular courses on Shiksha Online:
Q2. What are the features/benefits of Kubernetes?
Ans. Below are some of the features of Kubernetes:
- Automatic scheduling – Advanced scheduler to launch containers on cluster nodes.
- Automated rollouts & rollback – Supports rollouts and rollbacks.
- Horizontal scaling – Scale applications up or down as per requirements.
- Storage orchestration – Automatically mount the storage system of your choice.
- Self-healing capabilities – Reschedule, replace, and restart containers that have died or failed.
- Load balancing – Offers Pods their own IP addresses and a single DNS name for a set of Pods, and can load-balance across them.
- Secret and configuration management – This lets you store and manage sensitive information
- Allows you to create predictable infrastructure.
Learn about DevOps, read our blog – what is DevOps?
Q3. Explain the Kubernetes architecture.
Ans. Kubernetes follows a client-server architecture. Its architecture components include the Kubernetes control plane and the nodes in the cluster:
Kubernetes Master (Control Plane) Architecture
- etcd cluster – It is a distributed key-value storage that stores the Kubernetes cluster data, API objects, and service discovery details.
- kube-apiserver – It is the central management entity that receives all REST requests for modifications, serving as a frontend to the cluster.
- kube-controller-manager – It runs distinct controller processes in the background to regulate the shared state of the cluster and perform routine tasks.
- cloud-controller-manager – Manages controller processes with dependencies on the underlying cloud provider (if applicable).
- kube-scheduler – Schedules the pods on the various nodes based on resource utilization. It reads the service’s operational requirements and schedules it on the best fit node.
Node (Worker) Components
- kubelet – It is the main service on a node that takes new or modified pod specifications and ensures that pods and their containers are running in the desired state
- kube-proxy – It is a network proxy that runs on each worker node to deal with individual host subnetting and expose services to the external world. It sends requests for work to the appropriate containers.
- container runtime – Responsible for running the containerized applications.
Learn about Cloud Computing, read our blog – what is Cloud Computing?
- Pods – They are the smallest units that Kubernetes administers. It constitutes a set of containers. A pod can have a single container when the service or application is a single process.
- Deployments – Deployments determine the scale at which one wants to run an application.
- Services – It is the interface that the application consumers deal with. It represents a logical set of pods and acts as a gateway, enabling pods to send requests to the service.
- Nodes – It is a single host capable of running on a virtual machine. It runs both Kube-proxy and Kubelet, which are a part of the cluster. A Kubernetes node collects, runs, and manages pods that function together.
Explore the Top Highest Paying IT Certifications
Explore: Free Kubernetes Courses Online
Q4. What is the difference between Kubernetes and Docker Swarm?
Ans. Below are the differences between Kubernetes and Docker Swarm:
|Applications can be deployed using microservices, deployments, and pods.
|Applications can be used only as microservices.
|Provides an auto-scaling feature.
|Does not provide an auto-scaling feature.
|Manually configures load balancing.
|It does auto load balancing.
|Installation is long, complicated, and time-consuming.
|Installation is easy and fast.
|GUI is available.
|GUI not available.
|Has built-in tools for managing logging and monitoring processes.
|Does not require using any tools for logging and monitoring
|Cluster strength is strong.
|Cluster strength is weak compared to Kubernetes.
Q5. List some recommended security measures for Kubernetes.
Ans. Below are some recommended security measures for Kubernetes:
- Enable Role-Based Access Control (RBAC)
- Keep Kubernetes up to date
- Use API authentication
- Restrict SSH access
- Protect ETCD with TLS and Firewall
- Isolate Kubernetes Nodes
- Implementing a pod security policy
- Turn on Audit Logging
- Implement Network Segmentation
- Ensure that the kube-dashboard applies a restrictive RBAC policy
- Use images from repositories that are authorized
- Conduct security and vulnerability scanning regularly
Q6. Name the process that runs on Kubernetes Master Node.
Ans. The process that runs on the Kubernetes Master Node is called the “kube-apiserver”. The kube-apiserver is a component of the Kubernetes control plane and serves as the front-end for the Kubernetes API. It handles the management and control of the Kubernetes cluster by accepting and processing API requests from users and other components. The kube-apiserver is responsible for validating and configuring resources, storing them in the cluster’s etcd data store, and communicating with other components to maintain the desired state of the cluster.
Q7. What is Google Container Engine (GKE)?
Ans. Google Container Engine (GKE) is open-source cluster management and container orchestration system. It is used to run and manage Docker containers. GKE supports only those clusters which run within Google’s public cloud services. This engine schedules containers into a cluster. Then, it manages them automatically based on defined requirements.
Q8. Name the different services in Kubernetes.
Ans. The different in Kubernetes are:
- Cluster IP service
- External Name Creation service
- Node Port service
- Load Balancer service
Here’s the list of Top Universities Offering Free Online Programming Courses
Q9. Name the different types of controller managers.
Ans. The different types of controller managers in Kubernetes are:
- node controller
- replication controller
- endpoints controller
- service accounts controller
- token controller
- namespace controller
Q10. What is the role of the Kubernetes Controller Manager (kube-controller-manager)?
Ans. A Kubernetes Controller Manager is a Kubernetes control plane component that runs controller processes. It ensures the desired state of the cluster matches the observed state. It is a daemon that embeds the core control loops shipped with Kubernetes. Some types of these controllers are:
- Node controller
- Job controller
- Replication controller
- Endpoints controller
- Service Account & Token controller
Check out the list of Top Online IT Courses
Q11. Name different types of Kubernetes Volume.
Ans. Below are some types of Kubernetes Volume are:
Explore the scope and skills required to become a full-stack developer, read our post – what is Full-Stack Development?
Q12. Which three namespaces are available on new clusters?
Ans. The following are the three namespaces available on new clusters
- default: It is the default namespace for objects with no other namespace. This namespace acts as the main target for new user-added resources until alternative namespaces are created.
- kube-system: It is the namespace for objects created by the Kubernetes system.
- kube-public: It is globally readable by all users with or without authentication. It helps in exposing any cluster information necessary to bootstrap components. Its public aspect is only a convention and not a requirement.
Q13. What information does the node status contain?
Ans. The node status consists of the following information:
Q14. Name some tools for container monitoring.
Ans. Some popular tools for container monitoring include:
Q15. Name the objects used in Kubernetes.
Ans. The objects used in Kubernetes include:
Q16. What is Minikube?
Ans. Minikube is a utility or a tool that allows you to run Kubernetes on your local machine. It creates a single-node Kubernetes cluster inside a virtual machine. You can run demo Kubernetes operations without installing the full-scale Kubernetes.
Q17. Name the different types of Kubernetes services?
Ans. The following are the different types of Kubernetes services:
- ClusterIP (Default type) – It exposes a service on an internal IP in the cluster.
- NodePort – It exposes the service on the IP of each node at a static port.
- LoadBalancer – It creates an external load balancer in the current cloud (if supported) and assigns a fixed, external IP to the Service.
- ExternalName – It maps the service to a predefined externalName field by returning a value for the CNAME record.
Q18. What is Kubectl?
Ans. Kubectl is a command-line interface (CLI) that that allows you to run commands against Kubernetes clusters. It authenticates the Master Node of your cluster and makes API calls to do a variety of management actions. It controls the Kubernetes cluster manager through different create and manage commands on the Kubernetes component. Kubectl allows users to deploy applications, inspect and manage cluster resources, and view logs.
Below is the syntax to run kubectl commands from terminal window:
kubectl [command] [TYPE] [NAME] [flags]
Q17. Explain orchestration in terms of software and DevOps?
Ans. Orchestration is the integration of multiple services that allows processes automation. It also enables services to synchronize information in a timely manner. Ochestration helps in sitution where there are multiple microservices for an application that need to be run. It enables every service in individual containers to work together to accomplish one common goal.
Q18. Define ‘Heapster’ in Kubernetes.
Ans. Heapster is a metrics collection system for the data collected by Kublet. It collects and interprets signals such as lifecycle events, compute resource usage, etc. The aggregator runs like other pods within Kubernetes cluster that allows it to query usage data from every node within a cluster.
Also Read: Top Docker Interview Questions and Answers
We hope that the Kubernetes interview questions listed in this blog will familiarize you with the types of questions asked in Kubernetes interviews and help you ace your next interview.