Kubernetes Interview Question Set -1

Q1. What is Kubernetes?

Kubernetes is a container management system developed in the Google platform. 

The purpose of Kubernetes is to manage a containerized application in various types of physical, virtual, and cloud environments. Google Kubernetes is a highly flexible container tool to deliver even complex applications, consistently. Applications run on clusters of hundreds to thousands of individual servers.

Q2. What are K8s?

K8s is another term for Kubernetes.

Q3. How is Kubernetes related to Docker?

It’s a known fact that Docker provides the lifecycle management of containers and a Docker image builds the runtime containers. But, since these individual containers have to communicate, Kubernetes is used. So, Docker builds the containers and these containers communicate with each other via Kubernetes. So, containers running on multiple hosts can be manually linked and orchestrated using Kubernetes.

Q4. What is Container Orchestration?

Orchestration refers to the integration of multiple services that allows them to automate processes or synchronize information in a timely fashion. Say, for example, you have six or seven microservices for an application to run. If you place them in separate containers, this would inevitably create obstacles to communication. Orchestration would help in such a situation by enabling all services in individual containers to work seamlessly to accomplish a single goal. 

Q5. How are Kubernetes and Docker related?

Docker is an open-source platform used to handle software development. Its main benefit is that it packages the settings and dependencies that the software/application needs to run into a container, which allows for portability and several other advantages. Kubernetes allows for the manual linking and orchestration of several containers, running on multiple hosts that have been created using Docker. 

Q6. Define node in Kubernetes

A node is the smallest unit of hardware. It defines a single machine in a cluster that can be a virtual machine from a cloud provider or a physical machine in the data center. Every machine available in the Kubernetes cluster can substitute for other machines.

Q7. What are the main differences between the Docker Swarm and Kubernetes?

Docker Swarm is Docker’s native, open-source container orchestration platform that is used to cluster and schedule Docker containers.

Swarm differs from Kubernetes in the following ways:

1. Docker Swarm is more convenient to set up but doesn’t have a robust cluster, while Kubernetes is more complicated to set up but the benefit of having the assurance of a robust cluster.

2. Docker Swarm can’t do auto-scaling (as can Kubernetes); however, Docker scaling is five times faster than Kubernetes.

3. Docker Swarm doesn’t have a GUI; Kubernetes has a GUI in the form of a dashboard.

4. Docker Swarm does automatic load balancing of traffic between containers in a cluster, while Kubernetes requires manual intervention for load balancing such traffic.

5. Docker requires third-party tools like ELK stack for logging and monitoring, while Kubernetes has integrated tools for the same.

6. Docker Swarm can share storage volumes with any container easily, while Kubernetes can only share storage volumes with containers in the same pod.

7. Docker can deploy rolling updates but can’t deploy automatic rollbacks; Kubernetes can deploy rolling updates as well as automatic rollbacks.

Q8. What is the difference between deploying applications on hosts and containers?

Deploying Applications consists of an architecture that has an operating system. The operating system will have a kernel that holds various libraries installed on the operating system needed for an application. Whereas container host refers to the system that runs the containerized processes. This kind is isolated from the other applications; therefore, the applications must have the necessary libraries. The binaries are separated from the rest of the system and cannot infringe any other applications.

Q9. What are the features of Kubernetes?

1. Kubernetes places control on the user where the server will host the container. It will control how to launch. So, Kubernetes automates various manual processes. 

2. Kubernetes manages various clusters at the same time. 

3. It provides various additional services like management of containers, security, networking, and storage.

4. Kubernetes self-monitors the health of nodes and containers.

5. With Kubernetes, users can scale resources not only vertically but also horizontally too easily and quickly.

Q10. What are the main components of Kubernetes architecture?

There are two primary components of Kubernetes Architecture: 

the master node and the worker node. Each of these components has individual components in them.

Q11. Explain the working of the master node in Kubernetes?

The master node dignifies the node that controls and manages the set of worker nodes. This kind resembles a cluster in Kubernetes. The nodes are responsible for cluster management and the API used to configure and manage the resources within the collection. The master nodes of Kubernetes can run with Kubernetes itself, the asset of dedicated pods.

Q12. What is the work of a Kube-scheduler?

Kube-scheduler is the default scheduler for Kubernetes. It assigns nodes to newly created pods.

Q13. What is the role of Kube-apiserver?

This kind validates and provides configuration data for the API objects. It includes pods, services, and replication controllers. Also, it provides REST operations and also the front end of the cluster. This frontend cluster state is shared through which all other component interacts.

Q14. Define daemon sets.

Daemon sets are a set of pods that runs on a host. They are used for host layers attributes like monitoring networks or simple networks.

Q15. What is Heapster?

Heapster is a cluster-wide aggregator of data provided by Kubelet running on each node. This container management tool is supported natively on the Kubernetes cluster and runs as a pod, just like any other pod in the cluster. So, it basically discovers all nodes in the cluster and queries usage information from the Kubernetes nodes in the cluster, via the on-machine Kubernetes agent.

Q16. What tasks are performed by Kubernetes?

Kubernetes is the Linux kernel that is used for distributed systems. It helps you to abstract the underlying hardware of the nodes(servers) and offers a consistent interface for applications that consume the shared pool of resources.

Q17. Define Kubernetes controller manager

The controller manager is a daemon used for garbage collection, core control loops, and namespace creation. It enables the running of more than one process on the master node.

Q18. Mention the types of controller managers

Types of controller managers are: 

1) endpoints controller

2) service accounts controller

3) node controller

4) namespace controller

5) replication controller

6) token controller.

Q19. Why use namespace in Kubernetes?

Namespaces in Kubernetes are used for dividing cluster resources between users. It helps the environment where more than one user spread projects or teams and provides a scope of resources.

Q20. Why use Kubernetes?

Kubernetes is used because:

1. Kubernetes can run on-premises bare metal, OpenStack, public clouds Google, Azure, AWS, etc.

2. It helps you to avoid vendor lock issues as it can use any vendor-specific APIs or services except where Kubernetes provides an abstraction, e.g., load balancer and storage.

3. It will enable applications that need to be released and updated without any downtime.

4. Kubernetes allows you to assure those containerized apps run where and when you want and help you to find resources and tools in which you want to work.

Q21. What are the features of Kubernetes?

The features of Kubernetes are:

1. Automated Scheduling

2. Self-Healing Capabilities

3. Automated rollouts & rollback

4. Horizontal Scaling & Load Balancing

5. Offers environment consistency for development, testing, and production.

6. Infrastructure is loosely coupled to each component and can act as a separate unit.

7. Provides a higher density of resource utilization.

8. Offers enterprise-ready features

9. Application-centric management

10. Auto-scalable infrastructure

11. You can create predictable infrastructure

Q22. Explain Kubernetes Architecture

Kubernetes Architecture Diagram

Master Node: The master node is the first and most vital component which is responsible for the management of the Kubernetes cluster. It is the entry point for all kinds of administrative tasks. There may be more than one master node in the cluster to check for fault tolerance.

API Server: The API server acts as an entry point for all the REST commands used for controlling the cluster.

Scheduler: The scheduler schedules the tasks to the slave node. It stores the resource usage information for every slave node. It is responsible for distributing the workload.

Etcd: etcd components, store configuration detail, and write values. It communicates with the most component to receive commands and work. It also manages network rules and port forwarding activity.

Worker/Slave nodes: Worker nodes are another essential component that contains all the required services to manage the networking between the containers, and communicate with the master node, which allows you to assign resources to the scheduled containers.

Kubelet: It gets the configuration of a Pod from the API server and ensures that the described containers are up and running.

Docker Container: Docker container runs on each of the worker nodes, which runs the configured pods.

Pods: A pod is a combination of single or multiple containers that logically run together on nodes.


Q23. List various services available in Kubernetes

Various services available in Kubernetes are:

1) Cluster IP service

2) Load Balancer service

3) Node Port service

4) External Name Creation service.

Q24. Define Cluster IP

The Cluster IP is a Kubernetes service that offers a service inside the cluster that other apps inside the cluster can access.

Q25. Explain node port

The node port service is a fundamental way to get external traffic to your service. It opens a particular port on all nodes and forwards network traffic sent to this port.

Q26. What are the objectives of the replication controller?

The objectives of the replication controller are:

It is responsible for controlling and administering the pod lifecycle.

It monitors and verifies whether the allowed number of replicas are running or not.

The replication controller helps the user to check the pod status.

It enables to alteration of a pod. The user can drag its position the way interested in it.

Q27. What do you mean by persistent volume?

A persistent volume is a storage unit that is controlled by the administrator. It is used to manage an individual pod in a cluster.

Q28. What are Secrets in Kubernetes?

Secrets are sensitive information like the login credentials of the user. They are objects in Kubernetes that store sensitive information like usernames and passwords after performing encryption.

Q29. What is Sematext Docker Agent?

Sematext Docker agent is a log collection agent with events and metrics. It runs as a small container in each Docker host. These agents gather metrics, events, and logs for all cluster nodes and containers.

Q30. What are the various things that can be done to increase Kubernetes security?

By default, POD can communicate with any other POD, we can set up network policies to limit this communication between the PODs. RBAC (Role-based access control) to narrow down the permissions. Use namespaces to establish security boundaries. Set the admission control policies to avoid running the privileged containers. Turn on audit logging.

Q31. What are the types of Kubernetes Volume?

The types of Kubernetes Volume are:

EmptyDir

GCE persistent disk

Flocker

HostPath

NFS

ISCSI

rbd

PersistentVolumeClaim

downwardAPI

Q32. Explain PVC

The full form of PVC stands for Persistent Volume Claim. It is storage requested by Kubernetes for pods. The user does not require to know the underlying provisioning. This claim should be created in the same namespace where the pod is created.

Q33. What is the Kubernetes Network Policy?

Network Policy defines how the pods in the same namespace would communicate with each other and the network endpoint.

Q34. What is Kubernetes proxy service?

Kubernetes proxy service is a service that runs on the node and helps in making it available to an external host.

Q35. What is Kubernetes Load Balancing?

Load Balancing is one of the most common and standard ways of exposing the services. There are two types of load balancing in K8s and they are:

Internal load balancer – This type of balancer automatically balances loads and allocates the pods with the required incoming load.

External Load Balancer – This type of balancer directs the traffic from the external loads to backend pods.


Kubernetes commands

Exception Handling Interview Questions

DBMS Interview Questions Set -1

DBMS Interview Questions Set -2

SQL Interview Question Set -1

SQL Interview Question Set -2

JPA Interview Questions Set -1

JPA Interview Question Set -2

Hibernate Interview Questions

Spring Boot Interview Questions Set 1

Spring Boot Interview Questions Set 2

GIT Interview Questions

Redis Interview Questions

Core Java Interview Questions Set -1

Docker interview question Set -1

Docker interview question Set -2

Kubernetes Interview Question Set -1

Kubernetes Interview Question Set -2

Collection interview questions

Kafka Interview Questions

No comments:

Post a Comment