Kubernetes Interview Questions

by | Oct 26, 2022 | VAPT | 0 comments

What exactly is Kubernetes?

Kubernetes is an accessible, open-source container orchestration technology that may be used to deploy, scale, and manage automated applications. 

It has a fantastic community and works with all cloud providers. As a result, it is a solution for multi-container management.

For more read about Kubernetes

What exactly is a container?

Containers are a mechanism that collects an application’s compiled code when it is needed at run-time.

 Each container enables you to execute repeatable, standard dependencies and the same behavior every time the container is launched. 

It separates the application from the underlying host infrastructure, making cloud or OS platform deployment considerably easier.

What are the functions and roles of a node?

The container run-time is in charge of starting and managing containers. The kubelet is to control the state of each node and receives directives from the master to act on them.

 It is also in charge of pod metric collection. The Kube proxy is a component that controls subnets and provides services to all other details.

What are the primary elements of the master node?

Kube-server: It serves as the cluster’s front end and communicates with it via the API server.

Kube controller: It implements cluster governance and runs the set of controllers for the running cluster.

Kube scheduler: It schedules node activity and holds node resources to identify appropriate action for triggering events.

What exactly is a pod, and what does it do?

A pod is a collection of containers deployed on the same host. It is the fundamental execution unit of the Kubernetes application, capable of creating and deploying the Kubernetes unit of object models.

Kubernetes pods have two applications. These are their names:

  • Pods that can operate within a single container
  • Pods that can run alongside numerous containers when collaboration is required.

What kinds of multiple-container pods are there?

Sidecar: The Sidecar pattern consists of just one node and two application container nodes. It transfers the logic files to the bucket and contains the application’s fundamental logic.

Adapter: It is used to aggregate data or to standardize and normalize the output application. It carries out restructuring and reformatting and can produce properly prepared output for the application.

It is a proxy pattern called “ambassador” that enables connecting other containers to a port on the local host.

Mention several types of namespaces in Kubernetes?

Default: The namespace used when the cluster is launched with no other namespaces.

Kube-system: The namespace for Kubernetes-created objects.

Kune-public: A namespace that may be created automatically that is visible and readable by everyone in the cluster. This namespace’s public feature is only for convenience and is reserved for cluster use.

What is the relationship between Kubernetes and Docker?

A Docker manages a container’s lifecycle, and a Docker image creates the container’s run-time. The containers are orchestrated using Kubernetes and run on various servers through a connection. Kubernetes creates these containers and helps Kubernetes connect with different hosts.

Why is container orchestration required in Kubernetes?

Container orchestration is used to communicate with multiple microservices in a single application container to conduct various activities.

The following is how container orchestration is used:

  • It manages and automates numerous tasks, such as deployment, scalability, etc.
  • reduces the running time’s complexity
  • Scaling becomes simple.
  • It is used for the deployment and management of sophisticated containerized applications.
  • It reduces the need for manual service configuration.

What functions does Kubelet do most frequently as a node service component in Kubernetes?

The following are the main tasks that the Kubelet performs:

  • To work on all the components of the Kubernetes cluster, the Kubelet is a node that communicates with master components.
  • It combines a node’s CPU, memory, and disk resources into a sizable Kubernetes cluster.
  • Kubelet gives the controller access to review and report the cluster’s status.
  • It is in charge of gathering metrics pods.

What distinguishes the container from the pod?

A pod is a group of containers Kubernetes uses as a replication unit. Containers are the groups of codes that an application’s pod should build. Within the same pod, containers can communicate with one another.

What do Kubernetes stateful sets mean?

An application workload API object called a “stateful set” is used to manage stateful applications. It is employed to scale the set of pods and manage deployments. In the disk storage that connects to the stateful group, the state information and other resilient data of stateful pods are saved and kept up to date.

What are replication controllers?

All long-running pods are overseen by replication controllers. It ensures that the given number of pods are running at run-time and that a pod or set of pods is homogeneous in nature. The additional pod will be terminated if the required number of pods is exceeded. In addition, if a pod fails, the controller will immediately replace it.

What exactly is the Google Container Engine?

The Google Container Engine (GKE) is an open-source container and cluster management system. This Kubernetes-based container engine only works with clusters hosted on Google’s public cloud.

 What is a Heapster?

Heapster is a solution for gathering metrics and performance monitoring. By executing a kubelet on each node, it offers cluster-wide data aggregation. It enables gathering metrics, pods, workloads, containers, and other cluster-generated signals.

What do Daemon sets mean?

A daemon set ensures that each eligible node runs a single instance of the pod on its host. The daemon controller generated it and scheduled it. It is a background procedure that doesn’t create any output that can be seen.

What are the applications of daemon sets?

On each node, it runs cluster storage such as ceph and glusterd. Each node performs the log collection of daemons such as fluent or filebeat. It does node monitoring on each node.

What exactly is the Replica set?

A replica set is used to keep a consistent set of replica pods. It is used to describe the number of identical pods that are accessible. It was once suggested as a replacement for the replication controller.

What is the function of the Kubernetes load balancer?

The load balancer is a method of dispersing loads that is simple to implement at the dispatch level. Each load balancer is located between client devices and backend servers. It collects incoming requests and distributes them to all available servers.

What are the two types of load balancers?

The first is an internal load balancer, which balances the load and automatically allocates the pods with the needed configuration. 

On the other hand, the external load balancer routes traffic from external loads to the backend pods.

How does Prometheus work in Kubernetes?

  • Prometheus is an open-source toolset for metric-based application monitoring and alerting. 
  • It includes a data schema, query language, metrics details, and actions. 
  • Promotes the instrumental application of language in a variety of languages.

What is the Cluster IP address?

The cluster IP is a standard Kubernetes service that connects the pods or mapped container ports to the host ports. It delivers services within the cluster and provides access to other apps located within the same cluster.

What is the architecture of Kubernetes?

The Kubernetes design provides a service with a flexible, connected mechanism. It is made up of one master node and several containers. 

The master node is in charge of administering the clusters, the API, and the scheduling of the pods. Along with the node that connects with the master, each node runs on a container run-time like Docker.

What does the Kube-API server mean?

The Kube-API is the master node’s front end, which makes all of the API server’s components accessible. It facilitates communication between the master components and the Kubernetes nodes.

What are the benefits of Kubernetes?

  • Kubernetes is open-source and free software.
  • It is highly scalable and can run on any operating system. It has more concepts and is more potent than Docker swarm.
  • Kubernetes has a scheduler, auto-scaling, rolling upgrades, and health checks.
  • Offers a flat network space and customized features.
  • Creating successful CI/CD pipelines is simple and can boost productivity.