100 Kubernetes Question and Answers
100 Kubernetes Question and Answers
Answer: The key components of Kubernetes are the Master Node, Worker Nodes,
Pods, Services, Deployments, ReplicaSets, and StatefulSets.
7. What is a ReplicaSet?
8. What is a StatefulSet?
Answer: A DaemonSet ensures that a specific Pod runs on each node in the cluster.
It is commonly used for cluster-level operations such as log collection or
monitoring agents.
Answer: You can expose a service outside the Kubernetes cluster using a
NodePort, LoadBalancer, or Ingress resource depending on the specific
requirements of your application and infrastructure.
Answer: Access to the Kubernetes API server can be secured using authentication
mechanisms like certificates, tokens, or external authentication providers. Role-
Based Access Control (RBAC) can also be implemented to manage user access.
Answer: Kubernetes clusters can be monitored using various tools and frameworks
like Prometheus, Grafana, and the Kubernetes Dashboard. These tools provide
insights into resource utilization, performance, and health of the cluster.
API server
Etcd
Kube-scheduler
Kube-controller-manager
Cloud-controller-manager
Answer: The API server is the front-end interface for the Kubernetes control plane
that exposes the Kubernetes API.
Answer: etcd is a distributed, reliable, and highly available key-value store used to
store the configuration data for the Kubernetes cluster.
Kubelet
kube-proxy
Container runtime
39. Explain the role of the kubelet in Kubernetes.
Answer: The kubelet is an agent that runs on each node and communicates with
the Kubernetes API server to manage the container lifecycle.
Answer: Kubernetes DNS is a service that provides DNS resolution for services and
pods in a Kubernetes cluster, enabling them to discover and communicate with
each other using DNS names.
Answer: A persistent volume claim (PVC) is a request for storage by a user or a pod
in Kubernetes. It is used to dynamically provision and bind a persistent volume to
a pod. PVCs provide a way for users to request the type, size, and access mode of
storage they need for their applications.
Answer: A config map in Kubernetes is an API object that allows you to store non-
sensitive configuration data as key-value pairs. It provides a way to decouple
configuration from the application code, making it easier to manage and update
configuration settings without redeploying the application.
On the other hand, a statefulset is designed for stateful applications that require
stable network identities and ordered deployment and scaling. Statefulsets assign
unique network identities and persistent storage to each pod, allowing them to
maintain their identity and state even if they are rescheduled or restarted.
Answer: Pod affinity in Kubernetes is a mechanism that allows you to define rules
for scheduling pods such that they are co-located on the same node or with pods
that have specific labels. Pod affinity is useful in scenarios where pods benefit
from being colocated, such as improving performance, reducing network latency,
or optimizing resource utilization. It helps ensure that related pods are scheduled
close to each other to enhance application performance or meet specific
deployment requirements.
Answer: A Helm Chart in Kubernetes is a package format that contains all the
necessary files, templates, and metadata to deploy a set of related Kubernetes
resources. Helm is a package manager for Kubernetes, and using Helm Charts
simplifies the deployment and management of complex applications.