Kubernetes - Interview Question Set-1
Question-1: What is the difference between a Deployment and a ReplicaSet in Kubernetes?
Answer: A Deployment is a higher-level object in Kubernetes that manages ReplicaSets. A Deployment ensures that a specified number of replicas of a pod are running at all times, while a ReplicaSet simply ensures that a specified number of replicas of a pod are running.
Question-2: What is a StatefulSet in Kubernetes?
Answer: A StatefulSet is a Kubernetes object that manages stateful applications, such as databases, message brokers, and other stateful applications that require persistent storage. Unlike a Deployment, a StatefulSet provides stable network identities, persistent storage, and guarantees the order of deployment and scaling.
Question-3: A cluster administrator has a set of pods running a database that need to be accessed by other pods in the cluster. What type of Service should the administrator use to allow the other pods to access the database?
Answer: A StatefulSet is a Kubernetes object that manages stateful applications, such as databases, message brokers, and other stateful applications that require persistent storage. Unlike a Deployment, a StatefulSet provides stable network identities, persistent storage, and guarantees the order of deployment and scaling.
Question-4: What happens when a Persistent Volume Claim is deleted in Kubernetes?
Answer: When a Persistent Volume Claim is deleted in Kubernetes, the associated Persistent Volume is released, and the storage resources that it represents are returned to the available storage pool. The data stored in the Persistent Volume is not deleted and can be recovered if necessary. However, the Persistent Volume itself is no longer bound to the Persistent Volume Claim, and the storage resources it represents are available for use by other Persistent Volume Claims.
Question-5: What is an Ingress in Kubernetes and what is it used for?
Answer: An Ingress in Kubernetes is a resource that provides external access to services in the cluster. Ingresses are used to provide external access to services in the cluster, and to provide load balancing, SSL termination, and URL-based routing. Ingresses provide a way to manage external access to services in the cluster, and to control how incoming traffic is handled and routed to the services.
Question-6: A cluster administrator needs to expose a web application running in a pod to the internet. What type of Service should the administrator use to accomplish this?
Answer: A LoadBalancer Service should be used to expose the web application to the internet. LoadBalancer Services provide external IP addresses that can be accessed from outside the cluster, making it easy to expose a web application running in a pod to the internet.
Question-7: A cluster administrator needs to expose a set of microservices to external clients, but also wants to keep the microservices separate from each other. What type of Service should the administrator use to accomplish this?
Answer: A NodePort Service should be used to expose the microservices to external clients, while keeping them separate from each other. NodePort Services provide a way to expose individual pods to external clients, while still keeping them separate from each other and isolated within the cluster. This makes it possible to expose a set of microservices to external clients while keeping them separate and isolated from each other.
Question-8: A cluster administrator needs to provide a stable IP address for a set of replicas of a web application running in the cluster. What type of Service should the administrator use to accomplish this?
Answer: A Replication Controller or Deployment with a corresponding ClusterIP Service should be used to provide a stable IP address for the replicas of the web application. A Replication Controller or Deployment can be used to manage the replicas of the web application, while a ClusterIP Service can be used to provide a stable IP address for the replicas. This makes it easy to manage the replicas of the web application and provide a stable IP address for accessing them.
Question-9: What is a Secret in Kubernetes and what is it used for?
Answer: A Secret in Kubernetes is a resource that stores sensitive information, such as passwords, API keys, and SSL certificates, in a secure manner. Secrets are used to store sensitive information that is needed by the applications running in the cluster, such as database credentials and API keys. Secrets provide a way to manage sensitive information, ensuring that the information is stored securely and can be accessed only by the pods that need it.
Question-10: What is a Job in Kubernetes and what is it used for?
Answer: A Job in Kubernetes is a resource that runs a specified number of pods to completion, ensuring that the specified number of successful completions is achieved. Jobs are used to run batch jobs, such as data processing and image rendering, in the cluster. Jobs provide a way to run batch jobs in the cluster, ensuring that the batch job is run to completion and that the specified number of successful completions is achieved.
Kindly refer my YouTube Video for more detail on this topic:
Post a Comment