0% found this document useful (0 votes)
4 views

Kubernetes-1

The document provides a comprehensive list of the top 50 Kubernetes questions along with brief answers, covering fundamental concepts such as Pods, Nodes, Clusters, and various Kubernetes resources like Deployments, Services, and StatefulSets. It also addresses advanced topics like RBAC, Helm, and service discovery, making it a valuable resource for understanding Kubernetes architecture and functionality. Overall, it serves as a quick reference guide for both beginners and experienced users looking to enhance their knowledge of Kubernetes.

Uploaded by

sasubash095
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Kubernetes-1

The document provides a comprehensive list of the top 50 Kubernetes questions along with brief answers, covering fundamental concepts such as Pods, Nodes, Clusters, and various Kubernetes resources like Deployments, Services, and StatefulSets. It also addresses advanced topics like RBAC, Helm, and service discovery, making it a valuable resource for understanding Kubernetes architecture and functionality. Overall, it serves as a quick reference guide for both beginners and experienced users looking to enhance their knowledge of Kubernetes.

Uploaded by

sasubash095
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Mayank Singh

Top 50 Kubernetes questions along with brief answers


What is Kubernetes?
Answer: Kubernetes (often abbreviated as K8s) is an open-source container
orchestration platform designed to automate deploying, scaling, and managing
containerized applications. It manages containerized applications across
clusters of machines, ensuring the desired state of applications, networking,
storage, and resources.

2. What is a Pod in Kubernetes?


Mayank Singh

Answer: A Pod is the smallest deployable unit in Kubernetes, which consists of


one or more containers. These containers share the same network IP, storage
volumes, and specifications, and are co-located on the same physical or virtual
machine.
3. What is a Node in Kubernetes?
Answer: A Node is a physical or virtual machine in a Kubernetes cluster, which
runs the containerized applications. Each node is managed by the control plane
and contains the services necessary to run pods, including the kubelet and
kube-proxy.
4. What is a Cluster in Kubernetes?
Answer: A Cluster in Kubernetes is a set of nodes that run containerized
applications. It consists of a control plane (which manages the cluster) and one
or more worker nodes where the containers are actually run.
5. What is the control plane in Kubernetes?
Answer: The Control Plane in Kubernetes is responsible for maintaining the
desired state of the cluster, making decisions about the cluster (e.g.,
scheduling, scaling), and detecting and responding to cluster events. It includes
components like the API server, scheduler, controller manager, and etcd.
Mayank Singh

6. What is etcd in Kubernetes?


Answer: etcd is a consistent and highly-available key-value store used by
Kubernetes to store all cluster data, such as configuration data and state. It is
the primary source of truth for the cluster's configuration.
7. What is a Deployment in Kubernetes?
Answer: A Deployment is a Kubernetes resource that provides declarative
updates to applications. It manages the rollout of new versions of applications,
ensuring that the desired number of pods are running at all times.
8. What is a Service in Kubernetes?
Answer: A Service is an abstraction in Kubernetes that exposes an application
running on a set of pods as a network service. It enables communication
between pods and external applications or between different pods within the
cluster.
9. What are Labels in Kubernetes?
Answer: Labels are key-value pairs associated with Kubernetes objects like
pods, services, and deployments. Labels are used to organize and select
subsets of objects, such as grouping pods by version, environment, or tier.
10. What are Annotations in Kubernetes?
Answer: Annotations are key-value pairs associated with Kubernetes objects
like labels but are intended for storing non-identifying information. They can
store metadata such as build or deployment versions, toolchain details, or
debugging information.

11. What is a StatefulSet in Kubernetes?


Answer: StatefulSet is a Kubernetes resource designed for managing stateful
applications. Unlike deployments, StatefulSets maintain stable identities and
persistent storage across restarts, ensuring that each pod gets a unique,
persistent identity and storage volume.
12. What is a ReplicaSet in Kubernetes?
Mayank Singh

Answer: A ReplicaSet is a Kubernetes resource that ensures a specified number


of pod replicas are running at all times. It works with deployments to scale the
application horizontally.
13. What is Horizontal Pod Autoscaling in Kubernetes?
Answer: Horizontal Pod Autoscaling (HPA) automatically scales the number of
pods in a deployment or replica set based on CPU utilization or other select
metrics like memory, custom metrics, etc.
14. What is a ConfigMap in Kubernetes?
Answer: A ConfigMap is a Kubernetes object used to store configuration data
in key-value pairs, which can then be consumed by pods or other Kubernetes
resources. It helps to decouple configuration settings from container images.
15. What is a Secret in Kubernetes?
Answer: A Secret is similar to a ConfigMap but specifically intended for storing
sensitive information like passwords, OAuth tokens, and ssh keys. Secrets are
stored in an encrypted form.
16. What is a DaemonSet in Kubernetes?
Answer: A DaemonSet ensures that a copy of a pod is running on all (or some)
nodes in a Kubernetes cluster. It is used for system-level applications such as
log collection, monitoring, and networking services.
17. What is the purpose of the Kubernetes Scheduler?
Answer: The Kubernetes Scheduler is responsible for assigning pods to
available nodes in the cluster based on resource availability, constraints, and
affinity rules.
18. What is a Job in Kubernetes?
Answer: A Job in Kubernetes creates one or more pods and ensures that a
specified number of them successfully terminate. It is used for running batch or
non-continuous tasks like data processing or cleanup jobs.
19. What is a CronJob in Kubernetes?
Answer: A CronJob in Kubernetes runs jobs on a scheduled time, similar to
cron jobs in Linux. It is used for running tasks periodically at specific times or
intervals.
Mayank Singh

20. What is Kubernetes Ingress?


Answer: Ingress is a Kubernetes resource that manages external HTTP and
HTTPS access to services in a cluster, typically by routing traffic to different
services based on the request's URL or host. Ingress is commonly used with a
load balancer or reverse proxy.

21. What is the difference between a Pod and a Container?


Answer: A Pod is the smallest deployable unit in Kubernetes, which may
contain one or more containers. A Container, on the other hand, is a runtime
environment that encapsulates a piece of software, including all its
dependencies, but does not share resources with other containers.
22. How do you scale applications in Kubernetes?
Answer: Applications in Kubernetes can be scaled using the Horizontal Pod
Autoscaler or by manually changing the number of replicas in a Deployment or
ReplicaSet. Scaling adjusts the number of pod instances based on load or
resource usage.
23. What are Kubernetes namespaces?
Answer: Namespaces are virtual clusters within a Kubernetes cluster, used to
isolate resources and manage them separately for different environments,
teams, or applications. They help in organizing resources for large-scale
clusters.
24. What is Kubernetes RBAC?
Answer: RBAC (Role-Based Access Control) in Kubernetes defines permissions
based on roles assigned to users or service accounts. It allows fine-grained
access control to resources in a Kubernetes cluster.
25. What is a Kubernetes deployment strategy?
Answer: Kubernetes supports several deployment strategies, such as Rolling
Updates, Recreate, and Blue-Green deployments, each helping to manage
how new versions of applications are rolled out with minimal downtime.
26. What is a Kubernetes Operator?
Mayank Singh

Answer: A Kubernetes Operator is a method of packaging, deploying, and


managing a Kubernetes application. It uses custom controllers to manage
complex applications and services by extending Kubernetes APIs.
27. What is Helm in Kubernetes?
Answer: Helm is a package manager for Kubernetes that helps in managing
Kubernetes applications. It simplifies the deployment process by using Helm
charts, which contain all necessary Kubernetes manifests.
28. What is the purpose of kubectl?
Answer: kubectl is the command-line tool for interacting with Kubernetes
clusters. It allows users to manage cluster resources, perform deployments,
manage pods, and much more.
29. How do you monitor a Kubernetes cluster?
Answer: Kubernetes clusters can be monitored using tools like Prometheus and
Grafana. These tools collect metrics from the cluster and provide visual
dashboards for monitoring resource usage, health checks, and performance.
30. What is the difference between StatefulSet and Deployment?
Answer: StatefulSet is used for stateful applications that require stable
network identities and persistent storage. Deployment, on the other hand, is
used for stateless applications where each pod is identical and interchangeable.

31. How can you troubleshoot Kubernetes Pods?


Answer: Troubleshooting pods involves checking the pod’s logs using kubectl
logs <pod-name>, inspecting events with kubectl describe pod <pod-name>, or
checking for resource issues using kubectl top pod. It’s also important to verify
the pod's configuration.
32. What is the role of kube-proxy in Kubernetes?
Answer: kube-proxy is responsible for maintaining network rules for pod
communication. It allows services to communicate with pods and manages
load balancing and service discovery within the cluster.
33. What is a Kubernetes Network Policy?
Mayank Singh

Answer: A Network Policy in Kubernetes is used to control the communication


between pods. It defines which pods can communicate with each other,
providing isolation for security or operational reasons.
34. What is Kubernetes service discovery?
Answer: Service discovery in Kubernetes is the process by which services (e.g.,
microservices) automatically detect and communicate with each other.
Kubernetes uses DNS to expose services, enabling pods to dynamically discover
other services in the cluster.
35. What are Init Containers in Kubernetes?
Answer: Init Containers are special containers that run before the main
containers in a pod start. They are used for setup tasks, such as initialization or
configuring the environment for the main containers.
36. What is Kubernetes Multi-Cluster Management?
Answer: Multi-cluster management refers to managing more than one
Kubernetes cluster in an organization. Tools like Rancher or Anthos are used to
deploy and manage applications across multiple Kubernetes clusters.
37. How do you handle persistent storage in Kubernetes?
Answer: Kubernetes provides persistent storage via Persistent Volumes (PV)
and Persistent Volume Claims (PVC). PVs represent storage resources, while
PVCs represent requests for storage by pods. Volumes can be dynamically
provisioned or pre-provisioned.
38. What is a Container Runtime in Kubernetes?
Answer: A Container Runtime is software that runs containers in Kubernetes.
Popular container runtimes include Docker, containerd, and CRI-O. Kubernetes
uses container runtimes to pull images, start, stop, and manage containers.
39. What is Kubernetes CNI?
Answer: CNI (Container Network Interface) is a set of specifications and
libraries for configuring network interfaces in Linux containers. Kubernetes uses
CNI plugins for networking and managing pod communication.
40. What is Kubernetes Taints and Tolerations?
Mayank Singh

Answer: Taints are used to mark nodes in a Kubernetes cluster to prevent pods
from being scheduled unless they have a matching toleration. This mechanism
is used for advanced scheduling and resource management.
What is the role of Kubernetes Scheduler?
Answer: The Kubernetes Scheduler is responsible for placing pods onto nodes
in the cluster based on available resources, quality of service requirements,
and other constraints (e.g., affinity, taints). It ensures that pods are scheduled
efficiently for optimal resource utilization.
42. What is the difference between NodePort, ClusterIP, and LoadBalancer in
Kubernetes?
Answer:
 NodePort exposes the service on each node’s IP at a static port.
 ClusterIP exposes the service on a cluster-internal IP (default type).
 LoadBalancer exposes the service externally using a cloud provider's
load balancer.
43. What is a Kubernetes Volume?
Answer: A Volume in Kubernetes provides persistent storage that can be
accessed by containers within a pod. Volumes allow data to persist across pod
restarts. There are various types of volumes, such as emptyDir, hostPath, and
NFS.
44. What is the difference between a ReplicaSet and a Deployment in
Kubernetes?
Answer: A ReplicaSet ensures that a specified number of pod replicas are
running at any given time. A Deployment manages the lifecycle of ReplicaSets
and provides additional features like rolling updates and rollback.
45. How does Kubernetes handle service discovery?
Answer: Kubernetes provides service discovery through its DNS system,
allowing applications to discover and communicate with services using their
names. The DNS system automatically creates A records for services in the
cluster.
46. What are Kubernetes Affinity and Anti-Affinity rules?
Mayank Singh

Answer:
 Affinity refers to rules that determine which nodes or other pods a pod
should be scheduled on, based on the node’s labels.
 Anti-Affinity prevents a pod from being scheduled on nodes or alongside
other specific pods, helping avoid resource contention.
47. What is the Kubernetes API server?
Answer: The API server is the component of the Kubernetes control plane that
exposes the Kubernetes API. It serves as the gateway for all interactions with
the Kubernetes cluster, handling REST operations and providing API endpoints
for cluster components.
48. What is a Kubernetes admission controller?
Answer: Admission Controllers are plugins that govern and enforce how the
cluster is used. They can modify or reject requests to create or update
resources based on policies or constraints. Common examples include
LimitRanger and NamespaceLifecycle.
49. What is a Kubernetes Helm Chart?
Answer: A Helm Chart is a package format for Helm, which contains all the
resource definitions needed to run an application, tool, or service on
Kubernetes. Helm charts help in defining, installing, and upgrading complex
Kubernetes applications.
50. What is Kubernetes RBAC and how does it work?
Answer: Role-Based Access Control (RBAC) in Kubernetes defines permissions
based on roles that can be assigned to users or service accounts. RBAC is used
to control access to Kubernetes resources at a granular level, specifying who
can do what on which resources.

You might also like