Kubernetes - Interview Question Set-3



Question-21: What is a service in Kubernetes and what is it used for?

Answer: A service in Kubernetes is an abstraction that defines a logical set of pods and a policy for accessing them. It provides a stable IP address and DNS name for pods, and it can load balance traffic between pods. Services are used to expose pods to the network, either within the cluster or externally.



Question-22: A cluster administrator needs to provide stable IP addresses for a group of stateful pods in the cluster. What type of Service should the administrator use to accomplish this?

Answer: A Headless Service should be used to provide stable IP addresses for a group of stateful pods. Headless Services do not provide a stable IP address for the Service as a whole, but instead provide stable IP addresses for each individual pod that is part of the Service. This makes it easy to provide stable IP addresses for stateful pods, which can be used for communication between pods.



Question-23: What is a Horizontal Pod Autoscaler (HPA) in Kubernetes and what is its purpose?

Answer: The Horizontal Pod Autoscaler (HPA) in Kubernetes is a built-in tool that automatically adjusts the number of replicas of a deployment, based on observed CPU utilization or other custom metrics. The purpose of HPA is to ensure that a deployment has enough resources to handle incoming traffic, and it helps to maintain the desired performance levels of a deployment.



Question-24: What is Ingress in Kubernetes and what is it used for?

Answer: Ingress in Kubernetes is a resource that defines a set of rules for incoming traffic to reach the services in a cluster. It is used to expose services to the external network, and it provides a single entry point for external traffic into the cluster. Ingress can be used to perform routing, load balancing, and SSL termination for incoming traffic.



Question-25: What is a ClusterRole in Kubernetes and what is it used for?

Answer: A ClusterRole in Kubernetes is a resource that defines a set of permissions that can be granted to a user or group in a cluster-wide context. It is used to manage access to the cluster-level resources and APIs, and it can be used to enforce least privilege access control policies. ClusterRoles can be used to grant permissions for users to manage objects and perform actions in the cluster, such as creating, updating, and deleting resources.



Question-26: A cluster administrator is running a stateful application in the cluster and needs to provide stable IP addresses for the pods running the application. What type of Service should the administrator use to accomplish this?

Answer: A Headless Service should be used to provide stable IP addresses for the pods running the stateful application. Headless Services provide stable IP addresses for each individual pod, rather than for the Service as a whole. 

This makes it possible to provide stable IP addresses for stateful applications, which rely on stable network connections between pods. By using a Headless Service, the administrator can provide stable IP addresses for the pods running the stateful application, ensuring that the pods can communicate with each other in a stable and predictable manner.



Question-27: What is a Persistent Volume (PV) and a Persistent Volume Claim (PVC) in Kubernetes and what are they used for?

Answer: A Persistent Volume (PV) in Kubernetes is a resource that represents a piece of storage in a cluster. It is used to provide persistent storage for pods, and it can be backed by local storage, network-attached storage, or cloud storage. 

A Persistent Volume Claim (PVC) in Kubernetes is a request for storage made by a pod, and it is used to claim a PV and mount it as a volume in the pod. PVCs and PVs are used together to provide persistent storage for stateful applications in a cluster.



Question-28: How does Kubernetes manage storage for containers?

Answer: Kubernetes manages storage for containers using Persistent Volumes (PVs) and Persistent Volume Claims (PVCs). PVs represent a piece of storage in a cluster, and PVCs are requests for storage made by pods. Pods use PVCs to claim PVs and mount them as volumes in the pod, providing persistent storage for containers.



Question-29: What is a ServiceAccount in Kubernetes and what is it used for?

Answer: A ServiceAccount in Kubernetes is a resource that represents an identity for processes running inside a pod. It is used to grant permissions to pods to access the API server and other cluster resources. ServiceAccounts can be used to enforce least privilege access control policies and isolate resources within a cluster.



Question-30: What is a ServiceAccount in Kubernetes and what is it used for?

Answer: A ServiceAccount in Kubernetes is a resource that represents an identity for processes running inside a pod. It is used to grant permissions to pods to access the API server and other cluster resources. ServiceAccounts can be used to enforce least privilege access control policies and isolate resources within a cluster.

 

No comments

Powered by Blogger.