Kubernetes Interview Questions and Answers

Last Updated : 3 Aug, 2026

Kubernetes is an open-source container orchestration platform used to automate the deployment, scaling, and management of containerized applications. Preparing for a Kubernetes interview requires understanding its architecture, core components, networking, storage, security, and deployment strategies.

1. Explain Kubernetes Architecture.

Kubernetes consists of two main components:

  • Control Plane manages the cluster and makes scheduling decisions.
  • Worker Nodes execute and run containerized applications.
file
Worker Node

2. What is Container Orchestration?

Container orchestration is the automated management of containerized applications. It handles deployment, scaling, networking, load balancing, and health monitoring across multiple machines. Kubernetes automates these tasks to keep applications highly available.

frame_3333
Container Orchastration

3. Explain the Kubernetes Control Plane and its Components.

The Control Plane is responsible for managing the Kubernetes cluster. It receives user requests, schedules workloads, stores cluster information, and maintains the desired state. Components:

  • API Server: The entry point of Kubernetes. It accepts REST API requests and coordinates communication among cluster components.
  • etcd: A distributed key-value database that stores the cluster configuration and state. It is the source of truth for Kubernetes.
  • Scheduler: Selects the most suitable Worker Node for newly created Pods based on available resources and scheduling policies.
  • Controller Manager: Runs controllers that continuously compare the current state with the desired state and take corrective actions when required.

4. Difference Between Docker and Kubernetes

  • Docker: Creates and runs containers, Single-host container platform, Focuses on containerization, Does not provide auto-healing.
  • Kubernetes: Manages containers, Multi-node orchestration platform, Focuses on container management, Supports self-healing and auto-scaling.

5. What is kubectl?

kubectl is the official command-line tool used to interact with a Kubernetes cluster. It communicates with the Kubernetes API Server to deploy applications, manage resources, view cluster information, and troubleshoot issues. Common Commands

kubectl get pods
kubectl get nodes
kubectl describe pod <pod-name>
kubectl logs <pod-name>

6. What is kubeconfig?

A kubeconfig file stores the configuration required for kubectl to connect to a Kubernetes cluster. It contains cluster details, user credentials, contexts, and authentication information. Default Location:

~/.kube/config

7. Why does Kubernetes use YAML files?

Kubernetes uses YAML (YAML Ain't Markup Language) files to define the desired state of cluster resources such as Pods, Deployments, Services, and ConfigMaps. YAML is easy to read, write, and version-control. Benefits Human-readable, Declarative configuration, Easy to maintain, Supports Infrastructure as Code (IaC).

8. Explain the Worker Node and its Components.

A Worker Node is responsible for running containerized applications. Each Worker Node contains components required to execute and manage Pods. Components:

  • Kubelet: An agent that communicates with the API Server and ensures Pods are running correctly.
  • kube-proxy: Manages networking and enables communication between Services and Pods.
  • Container Runtime: Responsible for pulling container images and running containers. Common runtimes include containerd and CRI-O.

9. What is a Pod?

A Pod is the smallest deployable unit in Kubernetes. It contains one or more containers that share the same network namespace and storage volumes. Kubernetes schedules and manages Pods instead of individual containers.

10. What is a Static Pod?

A Static Pod is managed directly by the kubelet on a Worker Node rather than by the Kubernetes API Server. The kubelet monitors a local manifest file and automatically creates or restarts the Pod if needed. Common Use Cases Running control plane components, Bootstrapping a Kubernetes cluster.

11. Explain the Pod Lifecycle.

A Pod passes through different phases during its lifecycle.

  • Pending: Pod has been accepted but is waiting to start.
  • Running: At least one container is running.
  • Succeeded: All containers completed successfully.
  • Failed: One or more containers terminated with an error.
  • Unknown: Kubernetes cannot determine the Pod status.

12. What are Multi-Container Pods?

A Multi-Container Pod contains two or more containers that work together while sharing the same network and storage. Each container performs a specific responsibility. Common patterns include: Sidecar, Ambassador, Adapter.

13. What is the Sidecar, Ambassador, and Adapter Pattern?

  • Sidecar Pattern: Runs alongside the main application to provide supporting functionality such as logging, monitoring, or proxy services. Example Fluent Bit collecting application logs.
  • Ambassador Pattern: Acts as a proxy between the application and external services, simplifying communication. Example Envoy proxy connecting an application to external APIs.
  • Adapter Pattern: Transforms or formats data generated by the application into a format required by external monitoring or logging systems. Example Converting application metrics into Prometheus-compatible metrics.

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

Difference between pod and container:

  • Pod: Smallest deployable Kubernetes object, Can contain one or more containers, Shares network and storage, Managed by Kubernetes.
  • Container: Smallest executable unit, Runs a single application, Has its own isolated filesystem, Managed by the container runtime.

15. What is a ReplicaSet?

A ReplicaSet ensures that a specified number of Pod replicas are always running. If a Pod fails or is deleted, it automatically creates a new Pod to maintain the desired state. Key Points: Maintains desired number of Pods, Provides self-healing, Usually managed by a Deployment, Not commonly created directly

16. What is a Deployment?

A Deployment is a Kubernetes workload object used to deploy and manage stateless applications. It creates and manages ReplicaSets while supporting updates, rollbacks, and scaling. Key Features Creates ReplicaSets, Supports Rolling Updates, Supports Rollbacks, Easy scaling, Declarative configuration.

17. What is a StatefulSet?

A StatefulSet manages stateful applications that require stable Pod names, persistent storage, and ordered deployment. It is commonly used for databases and distributed systems. Common Examples MySQL, PostgreSQL, MongoDB, Cassandra, Kafka..

18. What is a DaemonSet?

A DaemonSet ensures that one Pod runs on every Worker Node (or selected nodes). It is mainly used for node-level services such as logging, monitoring, and security. Common Examples: Fluentd, Prometheus Node Exporter, Falco.

19. Difference between DaemonSet and ReplicaSet.

  • DaemonSet: One Pod per node, Used for node-level services, Runs on all nodes.
  • ReplicaSet: Fixed number of replicas, Used for application scaling, Runs based on replica count.

20. What are Jobs and CronJobs?

  • Job: A Job creates one or more Pods to perform a task until it completes successfully. It is suitable for one-time or batch operations. Examples Database migration, Backup, Data processing.
  • CronJob: A CronJob schedules Jobs to run automatically at specified times using cron expressions. Examples Nightly backups, Log cleanup, Scheduled report generation.

21. Explain Deployment Strategies.

Deployment strategies define how a new application version replaces the old one while minimizing downtime and risk.

  • Rolling Update: Gradually replaces old Pods with new Pods while keeping the application available. Best for: Most production deployments.
  • Recreate: Stops all existing Pods before starting new Pods. Best for: Applications that cannot run multiple versions simultaneously.
  • Blue-Green Deployment: Runs two identical environments: Blue (current version), Green (new version). Traffic is switched to the Green environment after validation.
  • Canary Deployment: Releases the new version to a small percentage of users before gradually rolling it out to everyone. Benefits Lower deployment risk, Early issue detection, Gradual rollout.

22. What is a Rollback?

Rollback restores the previous stable version of an application if a deployment fails or introduces issues. Kubernetes performs the rollback by reverting to the previous ReplicaSet. Benefits Quick recovery, Reduced downtime, Safer application updates.

23. Difference between Deployment and StatefulSet.

  • Deployment: Used for stateless applications, Pods are interchangeable, Dynamic Pod names, Shared or ephemeral storage, Suitable for web applications.
  • StatefulSet: Used for stateful applications, Pods have unique identities, Stable Pod names, Persistent storage, Suitable for databases.

24. Difference Between ReplicaSet, Deployment, StatefulSet, DaemonSet, Job, and CronJob

  • ReplicaSet: Maintains the desired number of Pod replicas.
  • Deployment: Manages stateless applications and updates.
  • StatefulSet: Manages stateful applications with stable identities.
  • DaemonSet: Runs one Pod on every Worker Node.
  • Job: Executes a task once until completion.
  • CronJob: Runs Jobs on a schedule.

25. What is Scaling in Kubernetes?

Scaling is the process of increasing or decreasing application resources to handle changes in workload. Kubernetes supports scaling by adjusting the number of Pods or the cluster's infrastructure. Types of Scaling Horizontal Scaling, Vertical Scaling, Cluster Scaling.

26. What is the Horizontal Pod Autoscaler (HPA)?

The Horizontal Pod Autoscaler (HPA) automatically increases or decreases the number of Pod replicas based on metrics such as CPU utilization, memory usage, or custom metrics. Example Traffic Increases

Traffic Increases -> CPU Usage-> HPA Adds More Pods

27. What is the Vertical Pod Autoscaler (VPA)?

The Vertical Pod Autoscaler (VPA) automatically adjusts the CPU and memory requests and limits assigned to a Pod instead of changing the number of Pod replicas. Example

Application Needs More Memory -> VPA Increases CPU/Memory -> Same Pod Gets More Resources

28. What is the Cluster Autoscaler?

The Cluster Autoscaler automatically adds or removes Worker Nodes based on resource demand. It increases the cluster size when Pods cannot be scheduled and removes unused nodes when demand decreases.

Pods Pending -> No Worker Node Available -> Cluster Autoscaler Adds Node

29. Difference Between HPA, VPA, and Cluster Autoscaler

  • HPA: Pods, Number of replicas, CPU, Memory, Custom Metrics, Stateless applications.
  • VPA: Pod Resources, CPU & Memory, Resource recommendations, Resource optimization.
  • Cluster Autoscaler: Worker Nodes, Number of Nodes, Unschedulable Pods, Cluster capacity management.

30. What is a Namespace and Why do we use Namespaces?

A Namespace is a logical partition within a Kubernetes cluster that groups and isolates resources. It allows multiple teams or applications to share the same cluster without resource conflicts. Common Namespaces default, kube-system, kube-public, kube-node-lease.

31. What are Labels and Selectors?

Labels: Labels are key-value pairs attached to Kubernetes objects such as Pods, Services, and Deployments. They help identify, organize, and categorize resources. Example:

labels:
app: nginx
environment: production

Selectors: Selectors are used to identify Kubernetes objects based on their labels. Services and ReplicaSets use selectors to locate the Pods they should manage.

selector:
app: nginx

32. What is a ConfigMap?

A ConfigMap stores non-sensitive configuration data as key-value pairs. It enables applications to access configuration without modifying the container image. Examples Application settings, Environment variables, Configuration files, Feature flags.

33. What is a Secret?

A Secret stores sensitive information such as passwords, API keys, tokens, and certificates. It helps keep confidential data separate from application code. Examples Database passwords, API tokens, SSH keys, TLS certificates.

34. What are Init Containers and Sidecar Containers?

  • Init Container: An Init Container runs before the main application container starts. It performs initialization tasks and must complete successfully before the application begins.
  • Sidecar Container: A Sidecar Container runs alongside the main application container throughout the Pod's lifecycle. It provides supporting services without modifying the main application.

35. Difference Between ConfigMap and Secret.

  • ConfigMap: Stores non-sensitive configuration, Plain-text configuration data, Used for application settings, Does not require confidentiality.
  • Secret: Stores sensitive information, Sensitive data (stored in base64-encoded form by default), Used for passwords, tokens, and certificates, Requires controlled access.

36. What is Networking in Kubernetes?

Kubernetes networking allows Pods, Services, and external users to communicate with each other. Every Pod receives its own IP address, and Kubernetes provides networking components to route traffic within and outside the cluster.

37. What is a Service?

A Service is a Kubernetes object that provides a stable network endpoint for a group of Pods. Since Pod IP addresses can change, a Service ensures applications can always communicate using a consistent IP address or DNS name.

38. What are the Types of Kubernetes Services?

Kubernetes provides different Service types based on how an application should be accessed.

  • ClusterIP: Exposes the application only within the cluster. It is the default Service type. Use Case: Communication between internal microservices.
  • NodePort: Exposes the application on a fixed port of every Worker Node, allowing external access using the node's IP address and port. Use Case: Development and testing environments.
  • LoadBalancer: Creates an external load balancer provided by the cloud platform and assigns a public IP address to the Service. Use Case: Production applications running on cloud providers.
  • ExternalName: Maps a Kubernetes Service to an external DNS name without creating a proxy. Use Case: Accessing external databases or third-party services.
  • Headless Service: A Headless Service does not assign a Cluster IP. Instead, it returns the IP addresses of individual Pods, allowing direct communication. Use Case: Stateful applications such as databases.

39. What is Ingress and an Ingress Controller?

  • Ingress: An Ingress is a Kubernetes API object that manages external HTTP and HTTPS access to Services. It provides routing rules based on hostnames and URL paths.
  • Ingress Controller: An Ingress Controller is the component that implements Ingress rules by routing incoming traffic to the appropriate Services.
frame_3332
Ingress and Controller

40. What is a Network Policy?

A Network Policy controls how Pods communicate with other Pods and external network endpoints. It acts as a firewall for Kubernetes workloads by defining allowed inbound and outbound traffic. Benefits Restricts unauthorized communication, Improves application security, Implements network segmentation.

41. Difference Between Ingress and LoadBalancer

  • Ingress: Routes HTTP/HTTPS traffic, Supports host-based and path-based routing, Requires an Ingress Controller, Can route multiple Services through one IP.
  • LoadBalancer: Exposes a Service externally, Exposes a single Service, Uses a cloud provider's load balancer, Typically assigns one external IP per Service.

42. What is a StorageClass?

A StorageClass defines different classes or types of storage available in a Kubernetes cluster. It enables dynamic provisioning, allowing Persistent Volumes to be created automatically when a Persistent Volume Claim is requested. Benefits Dynamic storage provisioning, Supports different storage types, Simplifies storage management.

43. What is CSI (Container Storage Interface)?

The Container Storage Interface (CSI) is a standard interface that enables Kubernetes to communicate with different storage providers. It allows storage vendors to develop CSI drivers that integrate seamlessly with Kubernetes. Common CSI Providers AWS EBS CSI, Azure Disk CSI, Google Persistent Disk CSI, Ceph CSI.

44. What is an Ephemeral Volume?

An Ephemeral Volume provides temporary storage that exists only for the lifetime of a Pod. When the Pod is deleted, the associated storage is also removed. Use Cases Temporary cache, Scratch space, Intermediate processing data.

45. Difference Between Volume, Persistent Volume (PV), Persistent Volume Claim (PVC), and StorageClass.

  • Volume: Provides storage for containers within a Pod.
  • Persistent Volume (PV): Represents persistent storage available in the cluster.
  • Persistent Volume Claim (PVC): Requests persistent storage for an application.
  • StorageClass: Defines storage types and enables dynamic provisioning.

46. What is Scheduling?

Scheduling is the process by which Kubernetes assigns newly created Pods to the most appropriate Worker Node. The Kubernetes Scheduler evaluates available nodes and selects one based on factors such as CPU, memory, scheduling constraints, and policies.

47. What are Resource Requests and Resource Limits?

Resource Requests define the minimum CPU and memory required for a container, while Limits specify the maximum CPU and memory a container is allowed to use.

  • Request: Minimum resources reserved for a container.
  • Limit: Maximum resources a container can consume.

48. What is a ResourceQuota?

A ResourceQuota limits the total amount of resources that can be consumed within a namespace. It helps prevent a single team or application from using excessive cluster resources. Resources That Can Be Limited CPU, Memory, Pods, Persistent Volume Claims, Services.

49. How does Service Discovery work in Kubernetes?

Kubernetes automatically assigns a DNS name to each Service. Pods use this DNS name instead of Pod IP addresses to communicate, ensuring reliable communication even if Pods are recreated.

50. What is CoreDNS?

CoreDNS is the default DNS server in Kubernetes. It resolves Service and Pod names into IP addresses, enabling communication between applications using DNS instead of IP addresses. Responsibilities Service name resolution, Pod DNS resolution, Internal cluster DNS.

51. Explain nodeSelector and Node Affinity.

  • nodeSelector: nodeSelector is the simplest way to schedule a Pod on a specific node. It matches a Pod with a node based on predefined labels. Deploy applications only on nodes with specific hardware or configurations.
nodeSelector:
disktype: ssd
  • Node Affinity: Node Affinity is an advanced scheduling mechanism that allows Pods to be scheduled on nodes based on label rules. It provides more flexibility than nodeSelector by supporting required and preferred matching conditions.

52. Explain Pod Affinity and Pod Anti-Affinity.

  • Pod Affinity: Pod Affinity schedules Pods close to other Pods with specific labels. This is useful when applications communicate frequently and benefit from being on the same node or within the same availability zone.
  • Pod Anti-Affinity: Pod Anti-Affinity prevents Pods with specific labels from being scheduled on the same node. It improves application availability by distributing Pods across multiple nodes.

53. Explain Taints and Tolerations.

  • Taints: A Taint is applied to a Worker Node to prevent Pods from being scheduled on it unless they explicitly tolerate the taint. Purpose Reserve nodes for specific workloads.
  • Tolerations: A Toleration allows a Pod to be scheduled on a node that has a matching taint. It does not force scheduling but permits the Pod to run on that node. Common Use Cases GPU nodes etc.

54. Difference Between nodeSelector, Node Affinity, and Taints & Tolerations.

  • nodeSelector: Select specific nodes, Node labels, Simple scheduling.
  • Node Affinity: Flexible node selection, Node labels and rules, Advanced scheduling.
  • Taints & Tolerations: Restrict Pod scheduling, Node taints and Pod tolerations, Dedicated or isolated nodes.

55. Explain Kubernetes Health Probes.

Kubernetes provides three types of health probes: Liveness Probe, Readiness Probe, Startup Probe. Each probe serves a different purpose.

  • Liveness Probe: A Liveness Probe checks whether a container is still running properly. If the probe fails repeatedly, Kubernetes automatically restarts the container.
  • Readiness Probe: A Readiness Probe checks whether a container is ready to serve client requests. If the probe fails, Kubernetes temporarily removes the Pod from the Service endpoints without restarting it.
  • Startup Probe: A Startup Probe checks whether an application has started successfully. While it is running, Kubernetes delays Liveness and Readiness probes, giving slow-starting applications enough time to initialize.

56. What is RBAC?

Role-Based Access Control (RBAC) is Kubernetes' authorization mechanism that controls access to cluster resources. It defines which users, groups, or service accounts can perform specific actions on Kubernetes objects. Benefits Fine-grained access control, Supports multi-user environments, Improved cluster security.

frame_3331
RBAC

57. Explain Roles, ClusterRoles, RoleBindings, and ClusterRoleBindings.

  • Role: A Role defines a set of permissions within a specific namespace. It specifies what actions can be performed on Kubernetes resources in that namespace.
  • ClusterRole: A ClusterRole defines permissions that apply across the entire Kubernetes cluster or to cluster-level resources.
  • RoleBinding: A RoleBinding grants the permissions defined in a Role to a user, group, or Service Account within a namespace.
  • ClusterRoleBinding: A ClusterRoleBinding grants the permissions defined in a ClusterRole across the entire cluster.

58. What is a Service Account?

A Service Account is a Kubernetes identity used by applications or Pods to communicate securely with the Kubernetes API. Unlike user accounts, Service Accounts are intended for workloads rather than human users. Common Uses Access Kubernetes API, Authenticate Pods, Interact with cluster resources.

59. What is Helm?

Helm is the package manager for Kubernetes. It simplifies the deployment, upgrade, rollback, and management of Kubernetes applications using reusable packages called Helm Charts. Benefits Simplifies deployments, Supports versioning, Easy upgrades and rollbacks, Reusable application templates.

60. Explain Helm Charts and Helm Repositories.

  • Helm Chart: A Helm Chart is a collection of YAML templates, configuration files, and metadata that defines a Kubernetes application. It allows applications to be packaged and deployed consistently.
  • Helm Repository: A Helm Repository is a collection of Helm Charts that can be shared and downloaded. It functions similarly to a software package repository.

61. What is a Custom Resource Definition (CRD)?

A Custom Resource Definition (CRD) extends the Kubernetes API by allowing you to create your own custom resource types. Once a CRD is installed, the new resource behaves like built-in Kubernetes objects such as Pods or Services.

62. What is a Custom Controller?

A Custom Controller is a program that watches Custom Resources and continuously compares their desired state with the current state. If there is a difference, it performs the necessary actions to bring the application back to the desired state.

63. What is a Kubernetes Operator?

A Kubernetes Operator is an application that automates the deployment, configuration, scaling, backup, recovery, and lifecycle management of complex applications. It combines a Custom Resource Definition (CRD) with a Custom Controller.

64. Difference Between CRD and Operator.

  • CRD: Extends the Kubernetes API, Defines a new resource type, Stores the desired configuration, Does not perform actions by itself.
  • Operator: Automates application lifecycle management, Uses a CRD and a Controller, Continuously manages the resource, Automatically performs operational tasks.

65. How do you upgrade a Kubernetes cluster?

Upgrading a Kubernetes cluster involves updating the Control Plane and Worker Nodes to a newer Kubernetes version while minimizing downtime. It is recommended to upgrade one minor version at a time and verify cluster health after each upgrade.

  • Review the Kubernetes release notes.
  • Back up the etcd database.
  • Upgrade the Control Plane components.
  • Upgrade the Worker Nodes.
  • Update cluster add-ons (CNI, CoreDNS, etc.).
  • Verify that all nodes and Pods are healthy.

66. How do you back up and restore a Kubernetes cluster?

A Kubernetes backup primarily includes the etcd database, which stores the cluster state, and persistent application data stored in Persistent Volumes (PVs). During recovery, these backups are restored to recover the cluster configuration and application data.

67. How does Kubernetes handle node failures?

Kubernetes continuously monitors the health of Worker Nodes. If a node becomes unavailable, the Control Plane marks it as NotReady and schedules replacement Pods on healthy nodes, provided sufficient resources are available.

68. What is CrashLoopBackOff, and how do you troubleshoot it?

CrashLoopBackOff occurs when a container repeatedly starts, crashes, and Kubernetes continuously attempts to restart it with an increasing delay between restart attempts. Common Causes Application crash, Incorrect startup command, Missing ConfigMap or Secret, Failed Liveness Probe, Insufficient resources.

kubectl describe pod <pod-name>
kubectl logs <pod-name>
kubectl logs <pod-name> --previous
kubectl get events

69. What is ImagePullBackOff, and how do you troubleshoot it?

ImagePullBackOff occurs when Kubernetes cannot pull the required container image from the container registry. Common Causes Incorrect image name or tag, Private registry authentication failure, Image does not exist, Network connectivity issues, Registry unavailable. Troubleshooting:

kubectl describe pod <pod-name>
kubectl get events

70. What is OOMKilled?

OOMKilled (Out of Memory Killed) occurs when a container exceeds its configured memory limit. The Linux kernel terminates the container to protect the node from running out of memory. Common Causes Low memory limits, Memory leaks, High application memory usage.

71. Why does a Pod remain in the Pending state?

A Pod remains in the Pending state when Kubernetes cannot schedule or start it successfully. Common Causes Insufficient CPU or memory, No suitable Worker Node, Unbound Persistent Volume Claim (PVC), Taints without matching tolerations, Unsatisfied node affinity rules. Troubleshooting:

kubectl describe pod <pod-name>
kubectl get nodes
kubectl get pvc
kubectl get events

72. What is an Evicted Pod?

A Pod is Evicted when Kubernetes removes it from a node due to resource pressure, such as insufficient memory, disk space, or ephemeral storage. Common Causes Memory pressure, Disk pressure, Ephemeral storage exhaustion.

73. What is an ExternalName Service?

An ExternalName Service maps a Kubernetes Service to an external DNS name, allowing Pods to access external services using a Kubernetes Service name.

74. What are Cordon, Drain, and Uncordon Commands?

These commands are used to safely manage Worker Nodes during maintenance.

  • Cordon: Marks a node as unschedulable, preventing new Pods from being scheduled while existing Pods continue running.
  • Drain: Safely evicts Pods from a node before maintenance. New Pods are scheduled on other available nodes.
  • Uncordon: Marks a node as schedulable again after maintenance is complete.

75. Difference Between kubectl apply, kubectl create, and kubectl replace

  • kubectl create: Creates a new resource. Fails if the resource already exists.
  • kubectl apply: Creates a resource if it doesn't exist or updates it if it does. Recommended for declarative management.
  • kubectl replace: Replaces an existing resource with the provided configuration. Fails if the resource does not exist.

76. You're managing a Kubernetes cluster shared by multiple teams working on different projects. How would you isolate their resources and avoid naming conflicts?

In this scenario, Namespaces are the ideal solution. Kubernetes Namespaces allow you to divide a single cluster into virtual sub-clusters, each with its own scope for resources like Pods, Services, and ConfigMaps. Benefits of Using Namespaces

  • Isolation: Each team gets its own namespace, preventing accidental interference with others’ workloads.
  • Avoids naming conflicts: Resources like web-service can exist in multiple namespaces without clashing.
  • Access control: You can apply Role-Based Access Control (RBAC) to restrict who can access or modify resources in each namespace.
  • Resource quotas: Set limits on CPU, memory, and object counts per namespace to prevent overuse.
Kubernetes Namespace

77. You're deploying a mix of latency-sensitive services and batch jobs in a Kubernetes cluster. How would you ensure each workload is scheduled appropriately?

In a Kubernetes cluster hosting both latency-sensitive services and batch jobs, scheduling decisions must be tailored to meet the unique demands of each workload. This is where the kube-scheduler and its extensibility come into play. The default kube-scheduler evaluates Pods in the scheduling queue and assigns them to Nodes based on:

  • Resource availability (CPU, memory)
  • Constraints like affinity/anti-affinity, taints/tolerations
  • Scoring functions that rank eligible nodes for optimal placement
Comment