Top 50 Interview questions in Containerization Orestration & Kubernetes

1. What is Kubernetes?

First, let us compare Kubernetes with Docker Swarm:

ComparisonKubernetesDocker Swarm
ControllerMasterManager
Deployment unitPodTask
Load balancingServiceIngress
SlaveNodesWorkers

Kubernetes is a container orchestration tool that is used for automating the tasks of managing, monitoring, scaling, and deploying containerized applications. It creates groups of containers that can be logically discovered and managed for easy operations on containers.

2. What is a Headless Service?

Headless Service is analogous to a ‘Normal’ service but doesn’t have a Cluster IP. This service enables you to directly reach the pods without the necessity of accessing it through a proxy.

3. What are the benefits of Kubernetes?

With the container orchestration tool Kubernetes, it becomes extremely easy to handle containers. We can respond to customer demands by deploying the applications faster and in a more predictable manner.

 Here, we’ll list a number of the advantages of Kubernetes:

  • Automatic scheduling
  • Automated rollback
  • Horizontal scaling
  • Auto-healing capabilities

4. What is orchestration in software?

Application orchestration within the software process means we will integrate two or more applications. We will be able to automate arrangement, coordination, and management of computer software. Any orchestration process goal is to streamline and optimize frequent repeatable processes.

5. What is a Kubernetes namespace?

The Kubernetes namespace is employed within the environment wherein we’ve multiple users spread within the geographically vast areas and dealing on multiple projects. The namespace is dividing the cluster resources between multiple users.

6. What are the node server components for Kubernetes?

In Kubernetes the server does their work through running containers, which are known as nodes. The execution of tasks and reporting the status to the master would be the main objective of the Node server.

The main process of the Kubernetes node, which does a number of the many container operations:

  • The Kubelet is that the node-daemon, which communicates with Kubernetes master for all the machines, which are a neighborhood of a Kubernetes cluster.
  • It regularly accesses the controller in order to check and report on the status of the cluster.
  • It merges the available CPU, memory and disk for a node into the large Kubernetes cluster. It also communicates the state of the containers back up to the API server for control loops in order to observe the current state of the containers.

7. What is a container cluster?

A container cluster lets us place and manage containers during a dynamic setup. It can be considered as a set of nodes or Compute Engine instances. The API server of Kubernetes does not run on cluster nodes, instead the Container Engine hosts the API server

8. Describe the meaning of a cluster in Kubernetes?

The master and therefore the node machinery ask those to travel by the Kubernetes cluster orchestration framework. A container cluster would be the inspiration of the Container Engine. The objects that represent the applications, which are containerized, are then run atop the cluster.

9. What does the node’s status contain?

Some of the following things would be the main components of the node status.

  • Address
  • Condition
  • Capacity
  • Info

10. Provide a definition of a node within Kubernetes?

The node is that the worker element within the framework and it had been previously referred to as a minion. It could be a virtual or physical type of machine but this is dependent on the cluster. The nodes have the services needed for running the pods and they are managed via the main components. The services of each of the nodes may include such things as the Kubelet, Docker and Kube Proxy.

11. Where is the Kubernetes cluster data stored?

The primary data store of Kubernetes is etcd, which is responsible for storing all Kubernetes cluster data.

12. How to set a static IP for Kubernetes load balancer?

Kubernetes Master assigns a new IP address.

We can set a static IP for Kubernetes load balancer by changing the DNS records whenever Kubernetes Master assigns a new IP address.

13.What is the significance of Container Orchestration?

Consider there are 5 to six microservices for one application performing different tasks and every one of them live within containers. In order to form sure these containers communicate with one other properly, there’s a requirement for what’s called container orchestration, which is made right into Kubernetes.

14. What is kube-proxy?

The kube-proxy runs on each of the nodes. It can do simple tasks such as TCP, UDP, forwarding, and so on. It shows the services in the Kubernetes API on each node.

15. What are the components of a Kubernetes Master?

The components of the Kubernetes Master include the API server, the controller manager, the Scheduler, and the etcd components. The Kubernetes Master components are responsible for running and managing the Kubernetes cluster.

16. What are some of the different attributes of Kubernetes?

  • Automated scheduling: Kubernetes allows advanced schedulers to launch containers on the particular cluster nodes.
  • Automated rollouts and rollback: Kubernetes supports the different rollouts and rollbacks for the desired state of the containerized application.
  • Self-healing features: rescheduling, replacing and restarting the containers, which are dead.
  • Horizontal scaling and load balancing: Kubernetes may scale up and down the application according to the requirements.

17. What are some of the main advantages of Kubernetes ?

With container orchestration tool Kubernetes, it has become easy for one to handle the containers. You may respond to different customer demands through deploying the applications in a faster manner and in a way, which is predictable. So there is:

  • Automated rollback
  • Automated scheduling
  • Horizontal scaling
  • Auto healing capabilities

18. What is load balancing on Kubernetes?

The process of load balancing will allow us to expose services. There are two types of load balancing when it comes to Kubernetes:

Internal load balancing: This is used for balancing the loads automatically and allocating the pods with the required configuration.

External load balancing: This directs the traffic from the external loads

19. What is Kubectl?

Kubectl is a Kubernetes command-line tool that is used for deploying and managing applications on Kubernetes. Kubectl is especially useful for inspecting the cluster resources, and for creating, updating, and deleting the components.

20.What is Minikube?

The Minikube makes it easy for the local running of Kubernetes. The Minikube runs a single-node Kubernetes cluster within a virtual machine.

21. What is GKE?

GKE is Google Kubernetes Engine which is employed for managing and orchestrating systems for Docker containers. GKE also lets us orchestrate container clusters within the Google Public Cloud.

22. What is the difference between Docker Swarm and Kubernetes?

  • Kubernetes installation structure is complex though if it were installed then the cluster would be robust. However, the Docker Swarm installation process happens to be simple though the cluster isn’t robust intrinsically .
  • Kubernetes is incredibly scalable. It was essentially built for large scale. However, the Docker swarm scales are five times faster than Kubernetes and are very scalable.
  • Kubernetes can also do the method of the auto scaling though the Docker swarm cannot do the method of the auto scaling.

23. What is Kubelet?

The Kublet refers to an agent service that runs on each node and allows the slave to speak with the master node. Therefore, Kubelet works on the containers that are provided to it within the PodSpec and makes sure the containers prescribed within the Podspec are healthy and running adequately.

24. What is the process that runs on Kubernetes Master Node?

The Kube-apiserver process runs on Kubernetes master node.

25. What is a Heapster?

Heapster may be a cluster-wide aggregator of monitoring and event data. Kubernetes natively was supported by Heapster and works on all Kubernetes setups, including our Deis Workflow setup.

26. What are the features of Kubernetes?

The features of Kubernetes are as follows:

  • Storage orchestration
  • Automated rollbacks and rollouts
  • self-healing
  • Configuration management
  • Packing of bin automatically
  • Load balancing and service discovery

27. How does Kubernetes relate to Docker?

Kubernetes is a container for the Docker which is more comprehensive than Docker Swarm and is designed to counter part 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.

28. Explain Kubectl command?

Kubectl commands provide an interface to establish communication between pods. They also want to control and administer the pods present within the Kubernetes cluster. To communicate with the Kubernetes cluster, the user has to declare the kubectl command locally. These commands are also used to communicate and control the cluster and the Kubernetes objects.

29. What is the command Kubectl and its syntax?

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]

30.What is the role of a Kube-scheduler?

It is defined as a workload-specific, policy rich, and topology-aware function which majorly impacts on availability, capability, and performance. The duty of a 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:

kube-scheduler [flags]

31. List out the components that interact with the node interface of Kubernetes?

The following are the components that interact with the node interface of Kubernetes, and they are:

  •          Node Controller
  •          Kubelet
  •          Kubectl

32. State the functions of Kubernetes namespace.

The primary functions of Kubernetes namespace are stated below:

Namespaces assist information exchange between pod to pod through the same namespace.

They are considered as virtual clusters which will be present on the same cluster.

Namespaces are used to deliver logical segregation of team and their corresponding environments.

33. How do you create a Namespace?

To create a namespace, the following command should be written:

kubectl create –f namespace.yml

34. What do you know about Labels in Kubernetes?

Keys will contain some values. Labels contain pairs of key values connected to pods, associated services and the replication controllers. Commonly, labels were added to some object during creation. During run time, they can be modified.

35. What is ETCD?

Etcd is written in Go programming language and may be a distributed key-value store used for coordinating between distributed work. It stores the configuration data of the Kubernetes cluster, representing the state of the cluster at any given point in time.

36. What do you know about Minions? Explain?

Minion is nothing but a node present in the Kubernetes cluster on a working machine. Minions can either be a virtual machine, a physical one or a cloud sample. Every node present during a cluster should meet the configuration specifications to run a pod on the node. Two prime services such as kubelet and proxy services along with Docker were needed to establish interface and communication with the nodes which run the Docker containers present in the pod which were created on the node. Minions were not actually formed by Kubernetes but could be formed by a cluster manager present in virtual or physical machines or by a service provider for a cloud.

37. What are the functions of the Replication controller?

The following are the main functions of the replication controller:

  • It is responsible to control and administer the lifecycle of the pod.
  • It is responsible to verify whether the allowed number of pod replicas were running or not
  • It helps the user to check the running status of the pod
  • Replication controller lets the user alter a particular pod. The user can drag its position to the top or to the bottom.

38. What do you know about the Replica set?

Replica set is considered as a substitute to the replication controller. The prime function of replica set is to assure the number of pod replicas running. There are two types of Label selectors supported by Kubernetes API. They are: Equality based selectors and Set based selectors. The primary difference between the replication controller and replica set is that, replication controller supports equality based selector alone whereas the replica set allows both the types of selectors.

39. What do you mean by volumes? What are the differences between Docker volumes and Kubernetes Volumes?

Volumes can be considered as directories through which the containers in a pod can be accessed. The differences between Kubernetes volumes and Docker volumes are:

Kubernetes VolumesDocker Volumes
Volumes are not limited to any particular containerVolumes are limited to a specific pod during a container
It supports all or any of the container deployed in a pod of kubernetesDoes not support all container deployed in Docker
Supports many types of storage on the pod and also supports multiple of storage at the same timeNo such support in Docker

40. Define Secrets in Kubernetes?

As the name implies, secrets are sensitive information and in this context, they are login credentials of the user. Secrets are objects in Kubernetes which store sensitive information namely the user name and the passwords after encrypting them.

41. How do you create secrets in Kubernetes?

Secrets can be created in various ways in Kubernetes. Some of them are

Through Text (txt) files

Through Yaml File

To create secrets from these files, the user has to create username and password using kubectl command. The secret file has to be saved in the corresponding file format.

42. Explain the Network Policy in Kubernetes?

Network policy contains a set of protocols to achieve information transfer between the pods and defines how those pods present in the same name space transfers information with one another.  It also defines data transfer with the network endpoint. User has to enable the network policy in the API server while configuring it in run time. Through the resources available in the network policy, select pods using labels and set the rules to permit the data traffic to a particular pod.

43.  What will happen while adding a new API to Kubernetes?

If you add a fresh API to Kubernetes, the same will provide extra features to Kubernetes. So, adding a new API will improve the functioning ability of Kubernetes. But, this will increase the cost and maintenance of the entire system. So, there is a need to maintain the cost and complexity of the system. This can be achieved by defining some sets for the new API.

44. How do you make changes in the API?

Changes in the API server has to be done by the team members of Kubernetes. They are responsible to add a new API without affecting the functions in the existing system. 

45. What are the API versions available? Explain?

Kubernetes supports several versions of API in order to provide support to multiple structures. Versioning is available at Alpha level, Beta level and Stable level. All these version features are in multiple standards.

Alpha level versions have alpha values. This version is prone to errors but the user can drop for support to rectify errors at any time. But, this version is limited to tests in a short time alone.

Beta level versions contain beta values. Scripts present in this version will be firm because they are completely tested. Users can look for support any time in case of any errors. This version is not recommended to use in commercial applications.

Stable level versions get many updates often. User has to get the recent version. Generally the version names are going to be vX, where ‘v’ refers to the version and ‘x’ refers to an integer.

46. What is kubectl drain?

kubectl drain command is used to drain a specific node during maintenance. Once this command is given, the node goes for maintenance and is formed unavailable to any user. This is done to avoid assigning this node to a new container. The node will be made available once it completes maintenance.

47. What do you mean by application deployment in Kubernetes?

Deployment is the process of transferring images to the container and assigning the images to pods present in Kubernetes cluster. Application deployment automatically sets up the application cluster thereby setting the pod, replication controller, replica set and the deployment of service. Cluster found out is organized properly so as to ensure proper communication between the pods. This setup also sets up a load balancer to divert traffic between pods. Pods exchange information between each other through objects in Kubernetes.

48. Write a command to create and fetch the deployment?

To create: kubectl create –f Deployment.yaml –record

To fetch: kubectl get deployments

49. Write a command to check the status of deployment and to update a deployment?

To check the status: kubectl rollout status deployment/Deployment

To update a deployment: kubectl set image deployment/Deployment tomcat = tomcat:6.0

50. What are some of the disadvantages of Kubernetes?

  • It is hard to install and configure
  • It takes time to start running and gain traction
  • There are no placements available as yet
  • It is not simple to manage the services

Add a Comment

Your email address will not be published. Required fields are marked *