Kubernetes Interview Questions Hindi mein

Kubernetes कोर्स के 25 सवाल, हर सवाल के सही जवाब और explanation के साथ। जवाब देखने से पहले ख़ुद सोचें।

Kubernetes Fundamentals

1. What does Kubernetes do when a pod's node fails?

  1. Deletes the Deployment
  2. Nothing until an admin intervenes
  3. Creates replacement pods elsewhere to restore the desired count
  4. Shuts down the cluster
जवाब देखें

जवाब: Creates replacement pods elsewhere to restore the desired count

Controllers reconcile toward desired state.

पाठ: What Kubernetes Does

2. Which component decides which node a new pod runs on?

  1. The scheduler
  2. etcd
  3. The kubelet
  4. The container image
जवाब देखें

जवाब: The scheduler

Scheduling is a control-plane decision.

पाठ: Cluster Architecture

3. What is the difference between spec and status?

  1. spec is only for Services
  2. They are identical
  3. status is written by users
  4. spec is the desired state you declare; status is the observed state reported by the cluster
जवाब देखें

जवाब: spec is the desired state you declare; status is the observed state reported by the cluster

Controllers drive status toward spec.

पाठ: kubectl and Declarative Objects

Workloads

4. What happens to a pod when its node dies?

  1. It moves with the same IP
  2. It is gone; a controller creates a replacement pod with a new IP
  3. It is paused until the node returns
  4. The cluster stops
जवाब देखें

जवाब: It is gone; a controller creates a replacement pod with a new IP

Pods are ephemeral.

पाठ: Pods

5. What does a Deployment create to manage its pods?

  1. A StatefulSet
  2. A ReplicaSet for each version of the pod template
  3. A new cluster
  4. A Service automatically
जवाब देखें

जवाब: A ReplicaSet for each version of the pod template

ReplicaSets keep the replica count; Deployments manage versions.

पाठ: Deployments and ReplicaSets

6. What does maxUnavailable: 0 guarantee during a rollout?

  1. Old pods are never removed
  2. The rollout is instant
  3. No new pods are created
  4. Available pods never drop below the desired replica count
जवाब देखें

जवाब: Available pods never drop below the desired replica count

Capacity is preserved; surge provides the room.

पाठ: Rolling Updates: maxSurge and maxUnavailable

7. Why should Jobs be idempotent?

  1. Retries and occasional duplicate runs can execute the same work more than once
  2. Jobs never retry
  3. Kubernetes forbids side effects
  4. It makes images smaller
जवाब देखें

जवाब: Retries and occasional duplicate runs can execute the same work more than once

Design for at-least-once execution.

पाठ: Jobs and CronJobs

Networking and Service Discovery

8. How does a Service know which pods to send traffic to?

  1. By pod name prefix
  2. By pod IP addresses written in the Service
  3. Its label selector matches pod labels, and only ready pods receive traffic
  4. Randomly across the cluster
जवाब देखें

जवाब: Its label selector matches pod labels, and only ready pods receive traffic

Labels connect Services to pods.

पाठ: Services and Label Selectors

9. What must be installed for an Ingress resource to do anything?

  1. A database
  2. A second cluster
  3. An ingress controller
  4. Nothing, it works by itself
जवाब देखें

जवाब: An ingress controller

Ingress is a spec; a controller implements it.

पाठ: Ingress and the Gateway API

10. What does a headless Service return in DNS?

  1. The individual pod addresses instead of a single virtual IP
  2. Nothing
  3. The node's IP only
  4. A public IP
जवाब देखें

जवाब: The individual pod addresses instead of a single virtual IP

Used for stable per-pod identities.

पाठ: DNS and Service Discovery

Configuration and Secrets

11. Why keep configuration in ConfigMaps rather than in the image?

  1. It makes pods start faster
  2. Images cannot contain files
  3. ConfigMaps are encrypted
  4. The same image can run in every environment with different settings
जवाब देखें

जवाब: The same image can run in every environment with different settings

Build once, configure per environment.

पाठ: ConfigMaps

12. What protection does base64 encoding in a Secret provide?

  1. Strong encryption
  2. None; it is reversible encoding, not encryption
  3. It hides values from cluster admins
  4. It rotates passwords
जवाब देखें

जवाब: None; it is reversible encoding, not encryption

Use encryption at rest, RBAC and external secret stores.

पाठ: Secrets: Encoding Is Not Encryption

13. What happens to environment variables from a ConfigMap when the ConfigMap changes?

  1. They update instantly
  2. Running containers keep the old values until they restart
  3. The pod crashes
  4. The ConfigMap is deleted
जवाब देखें

जवाब: Running containers keep the old values until they restart

Env vars are read at start.

पाठ: Consuming Configuration in Pods

Resources and Scheduling

14. What happens when a container exceeds its memory limit?

  1. Nothing
  2. It is throttled
  3. It gets more memory automatically
  4. It is OOM-killed and restarted
जवाब देखें

जवाब: It is OOM-killed and restarted

Memory is not compressible; CPU is.

पाठ: Requests, Limits and Units

15. What does the scheduler compare against node capacity?

  1. The pods' resource requests
  2. Their actual current usage only
  3. Their image size
  4. Their names
जवाब देखें

जवाब: The pods' resource requests

Requests drive placement.

पाठ: How the Scheduler Places Pods

16. Which pods are evicted first when a node runs out of memory?

  1. The newest pods regardless of class
  2. Guaranteed pods
  3. BestEffort pods with no requests or limits
  4. Pods with the longest names
जवाब देखें

जवाब: BestEffort pods with no requests or limits

Set requests to protect important pods.

पाठ: QoS Classes and Eviction

Health Checks and Scaling

17. What happens when a readiness probe fails?

  1. The node is drained
  2. The container is restarted
  3. The pod is removed from Service endpoints but not restarted
  4. The Deployment is deleted
जवाब देखें

जवाब: The pod is removed from Service endpoints but not restarted

Readiness controls traffic; liveness controls restarts.

पाठ: Startup, Liveness and Readiness Probes

18. Why must CPU requests be set for CPU-based autoscaling?

  1. Utilisation is measured as a percentage of the requested CPU
  2. Requests make pods faster
  3. The HPA ignores CPU
  4. Limits are used instead and requests are optional
जवाब देखें

जवाब: Utilisation is measured as a percentage of the requested CPU

No requests, no utilisation percentage.

पाठ: Horizontal Pod Autoscaling

19. What does a PodDisruptionBudget protect against?

  1. High CPU usage
  2. Node hardware failures
  3. Bad code
  4. Too many pods of an app being evicted at once during voluntary disruptions
जवाब देखें

जवाब: Too many pods of an app being evicted at once during voluntary disruptions

It paces drains and evictions.

पाठ: Disruptions and PodDisruptionBudgets

Storage and Packaging

20. What does a StatefulSet provide that a Deployment does not?

  1. Faster image pulls
  2. Stable pod identities and a dedicated volume per replica
  3. Automatic autoscaling
  4. Public IP addresses
जवाब देखें

जवाब: Stable pod identities and a dedicated volume per replica

Identity and storage per replica.

पाठ: Persistent Volumes and StatefulSets

21. How does Kustomize customise manifests per environment?

  1. It edits files in place
  2. Overlays patch a shared base without a templating language
  3. It uses Go templates
  4. It requires a separate server
जवाब देखें

जवाब: Overlays patch a shared base without a templating language

Base plus overlays.

पाठ: Kustomize Overlays

22. When is Helm especially useful?

  1. Building container images
  2. Writing a single Pod by hand
  3. Replacing kubectl entirely
  4. Installing and upgrading configurable third-party software packages
जवाब देखें

जवाब: Installing and upgrading configurable third-party software packages

Charts package configurable installs.

पाठ: Helm Charts

Security, Linting and a Checklist

23. Which setting should a manifest linter flag?

  1. An image tag of latest
  2. A pinned image digest
  3. A readiness probe
  4. Memory requests
जवाब देखें

जवाब: An image tag of latest

Unpinned images make deployments unpredictable.

पाठ: Linting Manifests

24. What is the default network behaviour between pods without NetworkPolicies?

  1. Only same-node traffic is allowed
  2. All traffic is blocked
  3. All pods can talk to all pods
  4. Only DNS is allowed
जवाब देखें

जवाब: All pods can talk to all pods

Policies are needed to restrict traffic.

पाठ: Security Basics

25. Which item belongs on a Kubernetes production checklist?

  1. Run a single replica for simplicity
  2. Use the latest image tag
  3. Containers run as non-root with a hardened securityContext
  4. Store Secret manifests in git as plain base64
जवाब देखें

जवाब: Containers run as non-root with a hardened securityContext

Secure, resilient, observable defaults.

पाठ: A Kubernetes Production Checklist

← कोर्स पर वापस जाएँ