Common Kubernetes interview questions

·

What is Kubernetes?
Kubernetes is an open-source container orchestration platform that automates deploying, scaling, and managing containerized applications.

Can you explain the Kubernetes architecture?
Kubernetes follows a master–node architecture. The master (control plane) includes components like the API server, scheduler, controller manager, and etcd for configuration and state management, while worker nodes run pods (containers) and communicate with the master via the kubelet.

What is a Pod?
A Pod is the smallest deployable unit in Kubernetes and represents one or more containers that share the same network namespace and storage resources.

How does a ReplicaSet differ from a Deployment?
A ReplicaSet ensures a specified number of pod replicas are running at any given time, while a Deployment provides declarative updates to pods and ReplicaSets, making it easier to manage rollouts and rollbacks.

What is a Service in Kubernetes?
A Service is an abstraction that defines a logical set of pods and a policy to access them—commonly used to expose an application running on a set of Pods, often via load balancing.

What is etcd and why is it important?
etcd is a distributed key-value store used by Kubernetes to store all cluster data, including configuration and state information. Its reliability and consistency are critical to the cluster’s operation.

How do you scale an application in Kubernetes?
Scaling can be done manually by updating the replica count in a Deployment or automatically using the Horizontal Pod Autoscaler (HPA), which adjusts the number of pod replicas based on metrics like CPU utilization.

What are Namespaces and why would you use them?
Namespaces provide a mechanism to partition cluster resources between multiple users (or teams) and are useful for managing environments like development, testing, and production within the same cluster.

How do you perform rolling updates in Kubernetes?
Kubernetes Deployments allow you to perform rolling updates, gradually replacing old pods with new ones while monitoring the health of the application. If issues arise, you can roll back to a previous version.

What is a ConfigMap and how does it differ from a Secret?
A ConfigMap is used to store non-sensitive configuration data in key-value pairs, while a Secret is designed to hold sensitive information (such as passwords or tokens) in a base64-encoded format.

Comments

Leave a Reply

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