Kubernetes interview questions 1
Q1) What is Kubernetes?
Answer: Kubernetes is an extensible, portable, and an open-source platform used for managing services and containerized workloads. It is a large and fast-growing ecosystem as its services, tools, and supports that are frequently and widely available.
Q2) Describe the history of Kubrnetes?
Answer: Kubernetes word has been originated from Greek with a meaning pilot or helmsman. It was foremostly designed by Google in 2014. It has become the building block for running the workload productions at scale for Google. Later it has been maintained by Cloud Native Computing Foundation.
Q3) What are the major differences between Kubernetes and Docker Swarm?
|Applicati||The application is set up||In this, the applications are|
|on||using a consolidation of||set as micro-services.|
|definition||pods and deployments.|
|Logging||Kubernetes supports||It is supported for only|
|and moni||multiple versions of||auditing of third-party|
|toring||monitoring and logging.||applications.|
|Scalabilit||Highly scalable||More scalable when|
|y||compared to Kubernetes|
|Networki||In this the networking||The overlay of the network is|
|ng||model is flat.||created by joining a node|
|with the cluster.|
|Availabilit||It provides a huge||It also provides large and|
|y||amount of availability||more availability for the|
|among the nodes.||services that are depicted|
Q4) What is are the reasons why Kubernetes is more useful by walking back in time?
Answer: Kubernetes mainly contains three important deployments. They are:
These three are the most crucial aspects that are useful by going back in time
Earlier in this era, applications can run on the physical servers by various organizations. This causes allocation issues related to resources, which can be solved by running each and every application on the different servers.
The introduction of virtualization was done so, that it allows us to run many numbers of virtual machines on only one server CPU.
Container deployment has flexible isolation properties in order to share an operating system among applications.
Q5) Why do we need Kubernetes and what it can do?
Answer: Kubernetes is the container that provides a good way to run and bundle your applications. We need to effectively manage the containers in the production environment that
allows us to run applications. It also provides a framework to run distributed systems resiliently.
Q6) What are the features of Kubernetes?
Answer: The features of Kubernetes are as follows:
Automated rollbacks and rollouts
Packing of bin automatically
Load balancing and service discovery
Q7) List out the components of Kubernetes?
Answer: There are mainly three components to deliver a functioning Kubernetes cluster. They are:
Q8) How does Kubernetes relate to Docker?
Answer: Kubernetes is a container for the Docker which is more comprehensive than Docker Swarm and is designed to counterpart clusters of the nodes at a level in a well-defined manner. Whereas, Docker is the platform tool for building and running the Docker containers.
Q9) Define Kube Scheduler?
Answer: It is the important aspect of the master node which notices the newly created pods with no assigned node for it, and selects one of the nodes to run on them.
Q10) What are the benefits of Kubernetes?
Answer: The benefits of Kubernetes are as follows:
It provides easy service organizations with pods.
It works on any of the OS as it an open-source modular tool.
It has a huge community among container orchestration tools.
Q11) Define Kubernetes Namespace?
Answer: Namespaces are used in environments where there are multiple users in a respective team or project. It is mainly designed to provide scops for the names and the assigned names must be unique within the namespace. Moreover, they provide a way to divide cluster resources within the existing namespace itself.
Q12) Mention the namespaces that initially the Kubernetes starts with?
Answer: Initially the Kubernetes starts with three namespaces, and they are:
kube-public: This is created automatically and can be read by all the users and it is the most reserved for cluster usage.
default: It is for the objects who do not contain namespaces.
kube-system: It is for the objects which are created by the Kubernetes system.
Example of the initial namespaces in Kubernetes is given below:
kubectl get namespace
Q13) What are Kubernetes pods?
Answer: Pods are defined as the group of the containers that are set up on the same host.
Applications within the pod also have access to shared volumes.
Q14) Define Kubelets?
Answer: It is the node agent that runs on each node. It works based on PodSpec, which JSON object in terms of a pod. The Kubelet logs take a set of PodSpecs that provides various mechanisms and ensures that the PodSpecs are running effectively.
Q15) What is the command Kubectl and its syntax?
Answer: It is defined as a CLI (command-line interface) for performing and running commands against Kubernetes clusters.
The syntax for Kubectl is
kubectl [command] [TYPE] [NAME] [flags]
Q16) How does the Kubernetes Cluster work?
The master is the one who is responsible for managing clusters. Kubernetes automates the scheduling and distribution of application containers across the cluster in a more effective manner. In Kubernetes, Minikubes is used to create clusters. The Kubernetes cluster consists of mainly two important sources, and they are:
The master coordinates the cluster
Nodes are the workers who run applications
Q17) What do you understand by the term Kube-proxy?
Answer: This is a network-proxy that runs on each and every node and also reflects as defined in the Kubernetes API. This proxy can also perform stream forwarding across a set of backends. It is one of the optional add-ons that provide the DNS cluster for the cluster APIs.
The syntax to configure Proxy is:
Q18) Describe in brief the working of the master node in Kubernetes?
Answer: Kubernetes master is mainly designed to control the nodes and the nodes mainly consist of a crucial part called containers. Now, here comes the pods these pods are made up of a group of containers based upon the requirements and configurations. Every container which we utilize is present inside a pod so, if the set-up for the pod is made then the ca deploy using CUI (Command Line Interface). Scheduling of the pods is done based on the node and relevant requirements. The connection between the node and the master components in the Kubernetes is made using the Kube-apiserver.
Q19) What is the function of Kube-apiserver?
Answer: This API server of Kubernetes is mainly used to configure and validate API objects that include replication controllers, services, pods, and many more. Kube-apiserver services the
R E S T o p e r a t i o n s a n d p r o v i d e s t h e f r o n t e n d t o t h e c l u s t e r s s h a r e d r e g i o interaction takes place between the components.
The representation for Kube-apiserver is provided as follows:
Q20) What is the role of a Kube-scheduler?
Answer: It is defined as a workload-specific, policy rich, and topology-aware function which majorly impacts on availability, capability, and performance. The duty of scheduler is to collect individual and collective resource requirements, data locality, hardware/software policy constraints, inter-workload interference, and many more into its account. API shows or displays the necessary workload requirements.
The representation for the Kube-scheduler is: