---
tags:
- k8s
- l1
- flashcard-deck
- k8s-workloads
---
<!-- wiki:breadcrumb:start -->
[Portal](../../../../library/portal/index.md) | **Level:** [L1: Foundations](../../../../library/portal/levels.md) | **Topics:** [Kubernetes Pods & Scheduling](../../../../library/portal/topics.md) | **Domain:** Kubernetes
<!-- wiki:breadcrumb:end -->

id	category	difficulty	tags	question	answer	source_path
k8s-workloads/01e0e458f341	k8s-workloads	easy	k8s-workloads, daemonset, pod	What are Daemon sets?	A DaemonSet is a set of pods that runs only once on a host. They are used for host layer attributes like a network or for monitoring a network, which you may not need to run on a host more than once. DaemonSets ensure that all (or some) nodes run a copy of a pod.\n\nRemember: Workload hierarchy: Deployment/StatefulSet/DaemonSet→ReplicaSet→Pod.\n\nGotcha: Use `kubectl explain <resource>` for field reference without leaving the CLI.	projects/knowledge/interview/kubernetes/391-what-are-daemon-sets.txt
k8s-workloads/024ec534efb9	k8s-workloads	hard	k8s-workloads, deployment, pod	How does Kubernetes handle rolling back a deployment?	* Rolling Back a Deployment: Kubernetes allows rolling back a deployment to a previous revision.\n* Users can use the kubectl rollout undo command to revert to a previous version of the deployment.\n* The rollout mechanism gradually replaces new pods with the older version, ensuring a controlled rollback.\n* Rolling back a deployment in Kubernetes involves undoing a previous rollout. Kubernetes ensures a smooth transition by gradually replacing new pods with the older version, maintaining the availability of the application throughout the rollback process.	projects/knowledge/interview/kubernetes/339-how-does-kubernetes-handle-rolling-back-a-deployme.txt
k8s-workloads/04bebbd3a935	k8s-workloads	easy	k8s-workloads, replicaset, pod	How to check which container image was used as part of replica set called "repli"?	`kubectl describe rs repli | grep -i image` shows the container image used by the ReplicaSet. You can also use `kubectl get rs repli -o jsonpath='{.spec.template.spec.containers[*].image}'` for a clean output. \nGotcha: always use specific image tags (nginx:1.25.3) in production — the 'latest' tag is mutable and can change unexpectedly.	projects/knowledge/interview/kubernetes/144-how-to-check-which-container-image-was-used-as-par.txt
k8s-workloads/057136909d7b	k8s-workloads	medium	k8s-workloads, deployment, statefulset, pod	What's the difference between a Deployment and a StatefulSet?	Deployment: suited for stateless pods, pods are interchangeable and get recreated at will. StatefulSet: suited for stateful pods, each pod gets a persistent identity (name, storage) and ordering guarantees (e.g., only one pod starts at a time) – use it when each instance needs stable identity or storage (like databases).\n\nRemember: Deployment > ReplicaSet > Pod. Three layers for declarative management.\n\nExample: `kubectl create deployment web --image=nginx:1.25 --replicas=3 --port=80`	projects/knowledge/interview/kubernetes/421-deployment-vs-statefulset.txt
k8s-workloads/0b95821d7a3d	k8s-workloads	medium	k8s-workloads, job, cronjob	Explain what is CronJob and what is it used for	A CronJob creates Jobs on a repeating schedule. One CronJob object is like one line of a crontab (cron table) file. It runs a job periodically on a given schedule, written in Cron format.\n\nRemember: CronJob = Job on schedule. Fields: minute hour day month weekday. "MHDMW."\n\nGotcha: `concurrencyPolicy: Forbid` prevents overlap. Default allows multiple Jobs.	projects/knowledge/interview/kubernetes/235-explain-what-is-cronjob-and-what-is-it-used-for.txt
k8s-workloads/0c54e7fee7ae	k8s-workloads	medium	k8s-workloads, deployment, replicaset	Create a deployment called "pluck" using the image "redis" and make sure it runs 5 replicas	`kubectl create deployment pluck --image=redis`\n\n`kubectl scale deployment pluck --replicas=5`\n\nExample: `kubectl create deployment web --image=nginx --replicas=3 --port=80`\n\nRemember: Deployments manage ReplicaSets→Pods. `kubectl rollout` for updates.	projects/knowledge/interview/kubernetes/086-create-a-deployment-called-pluck-using-the-image-r.txt
k8s-workloads/14f744175322	k8s-workloads	hard	k8s-workloads, job, cronjob	What possible issue can arise from using the following spec and how to fix it?	If the cron job fails, the next job will not replace the previous one due to the "concurrencyPolicy" value which is "Allow". It will keep spawning new jobs and so eventually the system will be filled with failed cron jobs.\nTo avoid such problem, the "concurrencyPolicy" value should be either "Replace" or "Forbid".\n\nRemember: Workload hierarchy: Deployment/StatefulSet/DaemonSet→ReplicaSet→Pod.\n\nGotcha: Use `kubectl explain <resource>` for field reference without leaving the CLI.	projects/knowledge/interview/kubernetes/236-what-possible-issue-can-arise-from-using-the-follo.txt
k8s-workloads/1a5a7cdf64ad	k8s-workloads	easy	k8s-workloads, replicaset, pod, lifecycle	What is the purpose of Horizontal Pod Autoscaling in Kubernetes?	**Horizontal Pod Autoscaling (HPA):**\n* Automatically adjusts the number of pod replicas based on observed metrics, such as CPU utilization or custom metrics.\n* Ensures optimal resource utilization and responsiveness.\n* Helps maintain a balance between application performance and resource efficiency.\n* HPA allows Kubernetes to dynamically scale the number of pod replicas in response to changing demand. By automatically adjusting the replica count based on specified metrics, * HPA ensures that applications can efficiently handle varying workloads without manual intervention.\n\nRemember: Workload hierarchy: Deployment/StatefulSet/DaemonSet→ReplicaSet→Pod.\n\nGotcha: Use `kubectl explain <resource>` for field reference without leaving the CLI.	projects/knowledge/interview/kubernetes/323-what-is-the-purpose-of-horizontal-pod-autoscaling-.txt
k8s-workloads/1c358b866ed9	k8s-workloads	easy	k8s-workloads, replicaset, deployment	How to delete a replica set called "rori"?	`kubectl delete rs rori` removes the ReplicaSet and all pods it manages. The workload hierarchy is: Deployment -> ReplicaSet -> Pod. \nGotcha: if the ReplicaSet was created by a Deployment, the Deployment will immediately recreate it. Delete the parent Deployment instead to fully remove the workload.	projects/knowledge/interview/kubernetes/146-how-to-delete-a-replica-set-called-rori.txt
k8s-workloads/243a5ed1e01f	k8s-workloads	easy	k8s-workloads, job, cronjob, pod	What is the difference between a Job and a CronJob in Kubernetes?	* Job: A Job in Kubernetes runs a pod to completion and then terminates.\n* It is used for short-lived, batch-style processes, ensuring that the task is executed once successfully.\n* CronJob: A CronJob is a higher-level abstraction that schedules jobs at specified intervals using cron expressions.\n* It is suitable for recurring, automated tasks that need to run periodically.\n* While Jobs are designed for one-time execution of tasks, CronJobs provide a scheduling mechanism for recurring tasks.\n\nRemember: CronJob = Job on schedule. Fields: minute hour day month weekday. "MHDMW."\n\nGotcha: `concurrencyPolicy: Forbid` prevents overlap. Default allows multiple Jobs.	projects/knowledge/interview/kubernetes/338-what-is-the-difference-between-a-job-and-a-cronjob.txt
k8s-workloads/36294d422973	k8s-workloads	medium	k8s-workloads, deployment, pod	Deploy a pod called "my-pod" using the nginx:alpine image	`kubectl run my-pod --image=nginx:alpine`\n\nIf you are a Kubernetes beginner you should know that this is not a common way to run Pods. The common way is to run a Deployment which in turn runs Pod(s).\n\nIn addition, Pods and/or Deployments are usually defined in files rather than executed directly using only the CLI arguments.\n\nRemember: Use specific tags (:1.25.3), never :latest in prod. Latest is mutable.	projects/knowledge/interview/kubernetes/028-deploy-a-pod-called-my-pod-using-the-nginxalpine-i.txt
k8s-workloads/36b2056028f0	k8s-workloads	medium	k8s-workloads, deployment, replicaset	How to scale a deployment to 8 replicas?	`kubectl scale deploy <DEPLOYMENT_NAME> --replicas=8` sets the desired replica count to \n8. Kubernetes gradually creates new pods to match the target. For auto-scaling, use HorizontalPodAutoscaler: `kubectl autoscale deployment <name> --min=2 --max=10 --cpu-percent=80`. \nGotcha: manual scaling is overridden if HPA is active on the same deployment.	projects/knowledge/interview/kubernetes/139-how-to-scale-a-deployment-to-8-replicas.txt
k8s-workloads/38d8a3678400	k8s-workloads	medium	k8s-workloads, replicaset, pod	In case of a ReplicaSet, Which field is mandatory in the spec section?	The field `template` in spec section is mandatory. It's used by the ReplicaSet to create new Pods when needed.\n\nRemember: Don't create ReplicaSets directly. Use Deployments for rolling updates+rollbacks.	projects/knowledge/interview/kubernetes/135-in-case-of-a-replicaset-which-field-is-mandatory-i.txt
k8s-workloads/3ba1a0c2e46b	k8s-workloads	easy	k8s-workloads, deployment, cronjob, replicaset	What is the difference between Pod, Container, and Deployment?	Different abstraction levels:\n\n**Container**: The actual running process - your application. Docker/containerd runs it.\n\n**Pod**: The scheduling unit in Kubernetes. Contains one or more containers that:\n* Share network namespace (same IP, localhost works)\n* Share storage volumes\n* Are scheduled together on same node\n* Live and die together\n\n**Deployment**: Manages ReplicaSets which manage Pods.\n\nRemember: Deployment > ReplicaSet > Pod. Three layers for declarative management.\n\nExample: `kubectl create deployment web --image=nginx:1.25 --replicas=3 --port=80`	projects/knowledge/interview/kubernetes/375-pod-vs-container-vs-deployment.txt
k8s-workloads/4386ec158cfd	k8s-workloads	medium	k8s-workloads, replicaset, pod	What the following block of lines does?	It defines a replicaset for Pods whose type is set to "backend" so at any given point of time there will be 2 concurrent Pods running.\n\nRemember: Workload hierarchy: Deployment/StatefulSet/DaemonSet→ReplicaSet→Pod.\n\nGotcha: Use `kubectl explain <resource>` for field reference without leaving the CLI.	projects/knowledge/interview/kubernetes/126-what-the-following-block-of-lines-does-spec-replic.txt
k8s-workloads/45144af1eff4	k8s-workloads	medium	k8s-workloads, deployment, replicaset, pod	What is the difference between a Pod and a Deployment in Kubernetes?	A Pod is the smallest deployable unit in Kubernetes - it represents one or more\ncontainers that share storage and network resources.\n\nA Deployment is a higher-level controller that manages Pods:\n- Ensures desired number of Pod replicas are running\n- Handles rolling updates and rollbacks\n- Provides declarative updates for Pods and ReplicaSets\n- Self-healing: recreates Pods if they fail\n\nKey differences:\n- Pod: Single instance, no auto-recovery if deleted\n- Deployment: Manages multiple Pod replicas, auto-recovers failures\n\nYou rarely create Pods directly in production.\n\nRemember: Deployment > ReplicaSet > Pod. Three layers for declarative management.\n\nExample: `kubectl create deployment web --image=nginx:1.25 --replicas=3 --port=80`	projects/knowledge/interview/kubernetes/452-pod-vs-deployment.txt
k8s-workloads/45d2cf38eaf4	k8s-workloads	hard	k8s-workloads, replicaset, deployment	Fix the following ReplicaSet definition	The selector doesn't match the label (cache vs cachy). To solve it, fix cachy so it's cache instead.\n\nRemember: Don't create ReplicaSets directly. Use Deployments for rolling updates+rollbacks.	projects/knowledge/interview/kubernetes/143-fix-the-following-replicaset-definition-yaml-apive.txt
k8s-workloads/4a256e19159e	k8s-workloads	medium	k8s-workloads, deployment, statefulset, pod	What is a Kubernetes StatefulSet and when would you use it?	StatefulSet is the workload API object used to manage stateful applications. Manages the deployment and scaling of a set of Pods, and provides guarantees about the ordering and uniqueness of these Pods.[Learn more](https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/)\n\nRemember: StatefulSet = stable identity: pod-0/pod-1, stable storage, ordered operations.\n\nGotcha: Deleting StatefulSet does NOT delete PVCs. By design for data safety.	projects/knowledge/interview/kubernetes/155-explain-statefulset.txt
k8s-workloads/4bf7d8e91284	k8s-workloads	hard	k8s-workloads, pod, lifecycle	Discuss the implications of pod sprawl and how to manage it effectively in Kubernetes.	Implications of Pod Sprawl:\n • Increased resource consumption.\n • More complex cluster management.\n • Potential impact on network performance. \nManagement Strategies:\n • Implement resource quotas and limits.\n • Use Horizontal Pod Autoscaling to adjust pod counts dynamically.\n • Regularly review and decommission unused or redundant pods. projects/knowledge/interview/kubernetes/368-discuss-the-implications-of-pod-sprawl-and-how-to-.txt\n\nRemember: Workload hierarchy: Deployment/StatefulSet/DaemonSet→ReplicaSet→Pod.\n\nGotcha: Use `kubectl explain <resource>` for field reference without leaving the CLI.	
k8s-workloads/4c961fd3752b	k8s-workloads	easy	k8s-workloads, replicaset, pod	What is a "ReplicaSet"?	A ReplicaSet ensures a specified number of identical pod replicas are running at all times. If a pod crashes or is deleted, the ReplicaSet controller creates a replacement to maintain the desired count. \nBest practice: don't create ReplicaSets directly — use Deployments, which manage ReplicaSets and add rolling update and rollback capabilities.	projects/knowledge/interview/kubernetes/428-replicaset.txt
k8s-workloads/4e180f2b30f3	k8s-workloads	hard	k8s-workloads, deployment, statefulset	Fix the following deployment manifest	Change `kind: Deploy` to `kind: Deployment`\n\nExample: `kubectl create deployment web --image=nginx --replicas=3 --port=80`\n\nRemember: Deployments manage ReplicaSets→Pods. `kubectl rollout` for updates.	projects/knowledge/interview/kubernetes/082-fix-the-following-deployment-manifest-yaml-apivers.txt
k8s-workloads/4e87bb99a2b6	k8s-workloads	hard	k8s-workloads, deployment, replicaset, pod	How does Kubernetes handle rolling updates with zero downtime?	Rolling Updates with Zero Downtime:\n* Kubernetes updates a Deployment by creating a new ReplicaSet alongside the existing one.\n* New pods are gradually created and added to the new ReplicaSet, while old pods are gracefully terminated.\n* This ensures a controlled transition without disrupting the availability of the application.\n* During a rolling update, Kubernetes progressively replaces old pods with new ones, ensuring that there is always a sufficient number of healthy pods.\n\nRemember: Workload hierarchy: Deployment/StatefulSet/DaemonSet→ReplicaSet→Pod.\n\nGotcha: Use `kubectl explain <resource>` for field reference without leaving the CLI.	projects/knowledge/interview/kubernetes/326-how-does-kubernetes-handle-rolling-updates-with-ze.txt
k8s-workloads/51687b0319fd	k8s-workloads	medium	k8s-workloads, daemonset, cronjob	How does a Kubernetes DaemonSet work and ensure one pod per node?	Historically, up 1.12, it was done with NodeName attribute.\n\nStarting 1.12, it's achieved with regular scheduler and node affinity.\n\nRemember: DaemonSet = one pod per node. For: log collectors, monitoring, network plugins.\n\nGotcha: DaemonSets use node affinity to ensure one copy per eligible node.	projects/knowledge/interview/kubernetes/153-how-daemonset-works.txt
k8s-workloads/574d869bfca6	k8s-workloads	medium	k8s-workloads, replicaset, deployment	ReplicaSets are running the moment the user executed the command to create them (like kubectl create -f rs.yaml)	False. It can take some time, depends on what exactly you are running. To see if they are up and running, run `kubectl get rs` and watch the 'READY' column.\n\nRemember: Don't create ReplicaSets directly. Use Deployments for rolling updates+rollbacks.	projects/knowledge/interview/kubernetes/140-replicasets-are-running-the-moment-the-user-execut.txt
k8s-workloads/5b21c3ceedd0	k8s-workloads	medium	k8s-workloads, deployment, replicaset	Create a file definition/manifest of a deployment called "dep", with 3 replicas that uses the image 'redis'	`k create deploy dep -o yaml --image=redis --dry-run=client --replicas 3 > deployment.yaml `\n\nExample: `kubectl create deployment web --image=nginx --replicas=3 --port=80`\n\nRemember: Deployments manage ReplicaSets→Pods. `kubectl rollout` for updates.	projects/knowledge/interview/kubernetes/084-create-a-file-definitionmanifest-of-a-deployment-c.txt
k8s-workloads/5d401f158301	k8s-workloads	medium	k8s-workloads, deployment, replicaset, pod	How do you scale a Deployment in Kubernetes?	You can use kubectl scale deployment/<name> --replicas=N to adjust the number of replicas, or update the replicas field in the Deployment manifest and apply it. The Deployment's ReplicaSet will then add or remove pods to match the desired count.\n\nExample: `kubectl create deployment web --image=nginx --replicas=3 --port=80`\n\nRemember: Deployments manage ReplicaSets→Pods. `kubectl rollout` for updates.	projects/knowledge/interview/kubernetes/425-scale-deployment.txt
k8s-workloads/5e47ec3c7506	k8s-workloads	hard	k8s-workloads, deployment, replicaset, pod	How do you define a Kubernetes Deployment?	A Kubernetes Deployment is a resource object used to declare the desired state for a set of pods. It provides declarative updates to applications, allowing users to describe how an application should run and scale over time. Deployments enable rolling updates, rollbacks, and scaling of applications without manual intervention. \nKey elements of a Deployment include:\n* Pod Template: Defines the desired state of the pods.\n* Replica Count: Specifies the desired number of pod replicas.\n* Update Strategy: Defines how updates should be applied (e.g., rolling updates).\	projects/knowledge/interview/kubernetes/310-how-do-you-define-a-kubernetes-deployment.txt
k8s-workloads/6015a054d009	k8s-workloads	medium	k8s-workloads, deployment, statefulset	What the following in a Deployment configuration file means?	USER_PASSWORD environment variable will store the value from password key in the secret called "some-secret"\nIn other words, you reference a value from a Kubernetes Secret.\n\nRemember: Deployment > ReplicaSet > Pod. Three layers for declarative management.\n\nExample: `kubectl create deployment web --image=nginx:1.25 --replicas=3 --port=80`	projects/knowledge/interview/kubernetes/219-what-the-following-in-a-deployment-configuration-f.txt
k8s-workloads/6028cd4de2f6	k8s-workloads	medium	k8s-workloads, deployment, replicaset	How to scale an application (deployment) so it runs more than one instance of the application?	To run two instances of the application:\n\n`kubectl scale deployment <DEPLOYMENT_NAME> --replicas=2`\n\nYou can specify any other number, given that your application knows how to scale.\n\nExample: `kubectl create deployment web --image=nginx --replicas=3 --port=80`\n\nRemember: Deployments manage ReplicaSets→Pods. `kubectl rollout` for updates.	projects/knowledge/interview/kubernetes/124-how-to-scale-an-application-deplyoment-so-it-runs-.txt
k8s-workloads/6420b047e1a6	k8s-workloads	easy	k8s-workloads, deployment, statefulset	How to delete a deployment?	One way is by specifying the deployment name: `kubectl delete deployment [deployment_name]`\n\nAnother way is using the deployment configuration file: `kubectl delete -f deployment.yaml`\n\nExample: `kubectl create deployment web --image=nginx --replicas=3 --port=80`\n\nRemember: Deployments manage ReplicaSets→Pods. `kubectl rollout` for updates.	projects/knowledge/interview/kubernetes/078-how-to-delete-a-deployment.txt
k8s-workloads/65672c7c9d06	k8s-workloads	easy	k8s-workloads, replicaset, pod	True or False? Deleting a ReplicaSet will delete the Pods it created	True (and not only the Pods but anything else it created).\n\nRemember: Don't create ReplicaSets directly. Use Deployments for rolling updates+rollbacks.	projects/knowledge/interview/kubernetes/137-true-or-false-deleting-a-replicaset-will-delete-th.txt
k8s-workloads/657aef031db4	k8s-workloads	easy	k8s-workloads, replicaset, pod	True or False? In case of a ReplicaSet, if Pods specified in the selector field don't exists, the ReplicaSet will wait for them to run before doing anything	False. A ReplicaSet actively creates pods to match its desired replica count — it does not wait for pods to appear on their own. If the selector matches existing pods, they count toward the desired number. If not enough exist, the ReplicaSet creates new ones immediately. This is the core reconciliation loop of Kubernetes controllers.	projects/knowledge/interview/kubernetes/134-true-or-false-in-case-of-a-replicaset-if-pods-spec.txt
k8s-workloads/689bdb80487e	k8s-workloads	hard	k8s-workloads, job, cronjob	What issue might arise from using the following CronJob and how to fix it?	The following lines placed under the template:\n\n```\nconcurrencyPolicy: Forbid\nsuccessfulJobsHistoryLimit: 1\nfailedJobsHistoryLimit: 1\n```\n\nAs a result this configuration isn't part of the cron job spec hence the cron job has no limits which can cause issues like OOM and potentially lead to API server being down. \nTo fix it, these lines should placed in the spec of the cron job, above or under the "schedule" directive in the above example.\n\nRemember: CronJob = Job on schedule. Fields: minute hour day month weekday. "MHDMW."\n\nGotcha: `concurrencyPolicy: Forbid` prevents overlap. Default allows multiple Jobs.	projects/knowledge/interview/kubernetes/237-what-issue-might-arise-from-using-the-following-cr.txt
k8s-workloads/7328f3d290d2	k8s-workloads	hard	k8s-workloads, deployment, daemonset, replicaset	Explain the differences between a DaemonSet and a Deployment in Kubernetes.	**Deployment:**\n* Used for stateless applications.\n* Manages the deployment and scaling of replicas across nodes.\n* Suitable for applications that can be replicated and scaled horizontally.\n**DaemonSet:**\n* Ensures that a copy of a pod runs on all (or a subset of) nodes.\n* Typically used for cluster-level services or agents.\n* Ensures that specific pods are present on each node in the cluster.\n* While Deployments are suitable for stateless applications that can be replicated, DaemonSets are designed for scenarios where at least one instance of a pod is required on each node.	projects/knowledge/interview/kubernetes/324-explain-the-differences-between-a-daemonset-and-a-.txt
k8s-workloads/73db8fbd5566	k8s-workloads	medium	k8s-workloads, deployment, pod	How Service and Deployment are connected?	The truth is they aren't connected. Service points to Pod(s) directly, without connecting to the Deployment in any way.\n\nExample: `kubectl create deployment web --image=nginx --replicas=3 --port=80`\n\nRemember: Deployments manage ReplicaSets→Pods. `kubectl rollout` for updates.	projects/knowledge/interview/kubernetes/094-how-service-and-deployment-are-connected.txt
k8s-workloads/764fcd4cced5	k8s-workloads	hard	k8s-workloads, deployment, replicaset, pod	What happens when you delete a deployment?	The pod related to the deployment will terminate and the replicaset will be removed.\n\nRemember: Deployment > ReplicaSet > Pod. Three layers for declarative management.\n\nExample: `kubectl create deployment web --image=nginx:1.25 --replicas=3 --port=80`	projects/knowledge/interview/kubernetes/079-what-happens-when-you-delete-a-deployment.txt
k8s-workloads/7b19a27b8adb	k8s-workloads	medium	k8s-workloads, deployment, statefulset	Explain Canary deployments/rollouts in detail	Canary deployment steps:\n\n1. Traffic coming from users through a load balancer to the application which is currently version 1\n\nUsers -> Load Balancer -> App Version 1\n\n2. A new application version 2 is deployed (while version 1 still running) and part of the traffic is redirected to the new version\n\nUsers -> Load Balancer ->(95% of the traffic) App Version 1\n                       ->(5% of the traffic) App Version 2\n\n3.\n\nRemember: Deployment > ReplicaSet > Pod. Three layers for declarative management.\n\nExample: `kubectl create deployment web --image=nginx:1.25 --replicas=3 --port=80`	projects/knowledge/interview/kubernetes/299-explain-canary-deploymentsrollouts-in-detail.txt
k8s-workloads/8322e4d1a02e	k8s-workloads	easy	k8s-workloads, statefulset, pod	What is a StatefulSet in Kubernetes?	A StatefulSet is a workload API object for managing stateful applications. It ensures that each pod has a unique, stable identity (hostname) and persistent storage across rescheduling. Use StatefulSets for applications like databases where ordering and stable network ID matters.\n\nRemember: StatefulSet = stable identity: pod-0/pod-1, stable storage, ordered operations.\n\nGotcha: Deleting StatefulSet does NOT delete PVCs. By design for data safety.	projects/knowledge/interview/kubernetes/420-what-is-statefulset.txt
k8s-workloads/844b693bd198	k8s-workloads	easy	k8s-workloads, job, cronjob, pod	What is the job of the kube-scheduler?	The kube-scheduler assigns nodes to newly created pods. It watches for newly created pods that have no node assigned, and selects a node for them to run on based on resource requirements, hardware/software/policy constraints, affinity and anti-affinity specifications, data locality, and workload interference.\n\nRemember: Job = run-to-completion. Tracks successful completions. "One-time task."\n\nExample: `kubectl create job db-migrate --image=myapp -- python manage.py migrate`	projects/knowledge/interview/kubernetes/388-what-is-the-job-of-the-kube-scheduler.txt
k8s-workloads/8603d81113a4	k8s-workloads	medium	k8s-workloads, deployment, statefulset	Delete the deployment `depdep`	`kubectl delete deploy depdep` removes the Deployment and its managed ReplicaSets and Pods. This is the clean way to remove a workload — deleting individual pods or ReplicaSets will just cause the Deployment to recreate them. Add `--grace-period=0 --force` for immediate deletion, but only in dev environments.	projects/knowledge/interview/kubernetes/085-delete-the-deployment-depdep.txt
k8s-workloads/8746af605862	k8s-workloads	easy	k8s-workloads, daemonset, deployment	How to list all daemonsets in the current namespace?	`kubectl get ds`\n\nRemember: DaemonSet = one pod per node. For: log collectors, monitoring, network plugins.\n\nGotcha: DaemonSets use node affinity to ensure one copy per eligible node.	projects/knowledge/interview/kubernetes/154-how-to-list-all-daemonsets-in-the-current-namespac.txt
k8s-workloads/8b7e51ec7734	k8s-workloads	medium	k8s-workloads, deployment, statefulset, replicaset	What is the difference between a StatefulSet and a Deployment in Kubernetes?	**Deployment:**\n • Used for stateless applications.\n • Provides a way to manage and scale replica sets.\n • Pods created by a deployment are not uniquely identified.\n • Suitable for applications that can be easily replicated and scaled horizontally. \n**StatefulSet:**\n • Designed for stateful applications with unique network identities and stable hostnames.\n • Maintains a unique identifier for each pod, allowing for ordered scaling and predictable naming.\n • Suitable for applications that require stable network identities and persistent storage.\n\nRemember: Deployment > ReplicaSet > Pod. Three layers for declarative management.\n\nExample: `kubectl create deployment web --image=nginx:1.25 --replicas=3 --port=80`	
k8s-workloads/8bf250f57ab7	k8s-workloads	medium	k8s-workloads, deployment, statefulset	How to verify a deployment was created?	`kubectl get deployments` or `kubectl get deploy`\n\nThis command lists all the Deployment objects created and exist in the cluster. It doesn't mean the deployments are ready and running. This can be checked with the "READY" and "AVAILABLE" columns.\n\nExample: `kubectl create deployment web --image=nginx --replicas=3 --port=80`\n\nRemember: Deployments manage ReplicaSets→Pods. `kubectl rollout` for updates.	projects/knowledge/interview/kubernetes/075-how-to-verify-a-deployment-was-created.txt
k8s-workloads/8cbfff99da00	k8s-workloads	easy	k8s-workloads, replicaset, pod	What is the purpose of ReplicaSet?	[kubernetes.io](https://kubernetes.io/docs/concepts/workloads/controllers/replicaset): "A ReplicaSet's purpose is to maintain a stable set of replica Pods running at any given time. As such, it is often used to guarantee the availability of a specified number of identical Pods."\n\nIn simpler words, a ReplicaSet will ensure the specified number of Pods replicas is running for a selected Pod. If there are more Pods than defined in the ReplicaSet, some will be removed. If there are less than what is defined in the ReplicaSet then, then more replicas will be added.	projects/knowledge/interview/kubernetes/125-what-is-the-purpose-of-replicaset.txt
k8s-workloads/92dc8b85abe7	k8s-workloads	easy	k8s-workloads, replicaset, deployment	How to list ReplicaSets in the current namespace?	`kubectl get rs` lists all ReplicaSets in the current namespace showing NAME, DESIRED, CURRENT, and READY counts. Add `-o wide` to see container images and selectors. In practice, you rarely interact with ReplicaSets directly — Deployments create and manage them automatically during rollouts and rollbacks.	projects/knowledge/interview/kubernetes/130-how-to-list-replicasets-in-the-current-namespace.txt
k8s-workloads/951db676d665	k8s-workloads	easy	k8s-workloads, deployment, replicaset, pod	What is a "Deployment" in Kubernetes?	A Kubernetes Deployment is used to tell Kubernetes how to create or modify instances of the pods that hold a containerized application.\nDeployments can scale the number of replica pods, enable rollout of updated code in a controlled manner, or roll back to an earlier deployment version if necessary. \n\nA Deployment is a declarative statement for the desired state for Pods and Replica Sets.\n\nRemember: Deployment > ReplicaSet > Pod. Three layers for declarative management.\n\nExample: `kubectl create deployment web --image=nginx:1.25 --replicas=3 --port=80`	projects/knowledge/interview/kubernetes/073-what-is-a-deployment-in-kubernetes.txt
k8s-workloads/993cfe9aaea9	k8s-workloads	medium	k8s-workloads, daemonset, replicaset, pod	What's the difference between a ReplicaSet and DaemonSet?	A ReplicaSet's purpose is to maintain a stable set of replica Pods running at any given time.\nA DaemonSet ensures that all Nodes run a copy of a Pod.\n\nRemember: Don't create ReplicaSets directly. Use Deployments for rolling updates+rollbacks.	projects/knowledge/interview/kubernetes/151-whats-the-difference-between-a-replicaset-and-daem.txt
k8s-workloads/9d120d133774	k8s-workloads	medium	k8s-workloads, daemonset, pod	What is a Kubernetes DaemonSet and when would you use it?	[Kubernetes.io](https://kubernetes.io/docs/concepts/workloads/controllers/daemonset): "A DaemonSet ensures that all (or some) Nodes run a copy of a Pod. As nodes are added to the cluster, Pods are added to them. As nodes are removed from the cluster, those Pods are garbage collected. Deleting a DaemonSet will clean up the Pods it created."\n\nRemember: DaemonSet = one pod per node. For: log collectors, monitoring, network plugins.\n\nGotcha: DaemonSets use node affinity to ensure one copy per eligible node.	projects/knowledge/interview/kubernetes/150-whats-a-daemonset.txt
k8s-workloads/a1ac5f46475a	k8s-workloads	medium	k8s-workloads, deployment, statefulset	What ways are you familiar with to implement deployment strategies (like canary, blue/green) in Kubernetes?	There are multiple ways. One of them is Argo Rollouts.\n\nRemember: Deployment > ReplicaSet > Pod. Three layers for declarative management.\n\nExample: `kubectl create deployment web --image=nginx:1.25 --replicas=3 --port=80`	projects/knowledge/interview/kubernetes/300-what-ways-are-you-familiar-with-to-implement-deplo.txt
k8s-workloads/a1b42ed3bc2a	k8s-workloads	hard	k8s-workloads, deployment, replicaset, pod	How does Kubernetes ensure high availability of applications?	Kubernetes ensures high availability through several mechanisms:\n* ReplicaSets: Deployments in Kubernetes are often managed by ReplicaSets, which ensure a specified number of replicas (pod instances) are running at all times. If a pod or node fails, ReplicaSets automatically create replacements on healthy nodes.\n* Pod Distribution: Kubernetes spreads pods across multiple nodes to avoid a single point of failure.\n\nRemember: Workload hierarchy: Deployment/StatefulSet/DaemonSet→ReplicaSet→Pod.\n\nGotcha: Use `kubectl explain <resource>` for field reference without leaving the CLI.	projects/knowledge/interview/kubernetes/308-how-does-kubernetes-ensure-high-availability-of-ap.txt
k8s-workloads/b5d8cd8cf3fd	k8s-workloads	hard	k8s-workloads, deployment, replicaset, pod	How does rolling deployment work in Kubernetes?	**Rolling Deployment:**\n* Strategy for updating an application without downtime.\n* Involves gradually replacing old pods with new ones.\n* Ensures a smooth transition, as each new pod is ready before an old one is terminated.\n**Deployment Update:** A new version of the application is deployed using a Deployment resource.\n* ReplicaSet Transition: Kubernetes creates a new ReplicaSet for the updated version while maintaining the old one.\n* Pod Replacement: Pods are gradually replaced by new ones, ensuring a controlled rollout.\\n\nExample: `kubectl create deployment web --image=nginx --replicas=3 --port=80`\n\nRemember: Deployments manage ReplicaSets→Pods. `kubectl rollout` for updates.	projects/knowledge/interview/kubernetes/317-how-does-rolling-deployment-work-in-kubernetes.txt
k8s-workloads/b9ebad351c55	k8s-workloads	easy	k8s-workloads, replicaset, pod	How to check how many Pods are ready as part of a replica set called "repli"?	`k describe rs repli | grep -i "Pods Status"`\n\nRemember: Workload hierarchy: Deployment/StatefulSet/DaemonSet→ReplicaSet→Pod.\n\nGotcha: Use `kubectl explain <resource>` for field reference without leaving the CLI.	projects/knowledge/interview/kubernetes/145-how-to-check-how-many-pods-are-ready-as-part-of-a-.txt
k8s-workloads/bc6accdb9807	k8s-workloads	medium	k8s-workloads, replicaset, pod	Scale up a replica set called "rori" to run 5 Pods instead of 2	`kubectl scale rs rori --replicas=5` increases the ReplicaSet to 5 pods. Kubernetes creates 3 new pods to reach the target. For production, prefer scaling through Deployments (`kubectl scale deploy`) or HPA for automatic scaling based on CPU/memory metrics. \nGotcha: scaling a ReplicaSet directly may conflict with its parent Deployment's desired state.	projects/knowledge/interview/kubernetes/148-scale-up-a-replica-set-called-rori-to-run-5-pods-i.txt
k8s-workloads/bfe0871c2bf8	k8s-workloads	medium	k8s-workloads, replicaset, pod	Is it possible to delete ReplicaSet without deleting the Pods it created?	Yes, with `kubectl delete rs rori --cascade=orphan` (or the older `--cascade=false`). This removes the ReplicaSet object but leaves its pods running as orphans without a controller. Useful when you want to adopt pods under a new controller. \nGotcha: orphaned pods will not be recreated if they crash — they lose their self-healing capability.	projects/knowledge/interview/kubernetes/131-is-it-possible-to-delete-replicaset-without-deleti.txt
k8s-workloads/c13234b7d2ce	k8s-workloads	easy	k8s-workloads, deployment, replicaset, pod	What is a "Deployment"?	An object that manages multiple replicas of pods.\n\nRemember: Deployment > ReplicaSet > Pod. Three layers for declarative management.\n\nExample: `kubectl create deployment web --image=nginx:1.25 --replicas=3 --port=80`	projects/knowledge/interview/kubernetes/420-deployment.txt
k8s-workloads/c6f020781415	k8s-workloads	hard	k8s-workloads, statefulset, pod	What are the challenges in managing stateful applications in Kubernetes?	* Challenges in Managing Stateful Applications: Persistent Storage: Ensuring data persistence and managing stateful data storage.\n* Unique Network Identities: Assigning stable network identities to stateful pods.\n* Orderly Scaling: Scaling stateful applications in a specific order to maintain relationships.\n* Backup and Restore: Implementing robust backup and restore mechanisms for data.\n* Stateful applications often have unique challenges compared to stateless ones, especially related to data persistence and maintaining stable identities.\n\nRemember: Workload hierarchy: Deployment/StatefulSet/DaemonSet→ReplicaSet→Pod.\n\nGotcha: Use `kubectl explain <resource>` for field reference without leaving the CLI.	projects/knowledge/interview/kubernetes/341-what-are-the-challenges-in-managing-stateful-appli.txt
k8s-workloads/c7eee5b364aa	k8s-workloads	medium	k8s-workloads, pod, lifecycle	Explain "Horizontal Pod Autoscaler"	In Kubernetes, a HorizontalPodAutoscaler automatically updates a workload resource with the aim of automatically scaling the workload to match demand.\n\nExample: Manual: `kubectl scale deploy web --replicas=5`. Auto: HPA with --cpu-percent.	projects/knowledge/interview/kubernetes/243-explain-horizontal-pod-autoscaler.txt
k8s-workloads/c7fcda01ed25	k8s-workloads	hard	k8s-workloads, cronjob, replicaset, pod	Describe the sequence of events in case of creating a ReplicaSet	* The client (e.g. kubectl) sends a request to the API server to create a ReplicaSet\n* The Controller detects there is a new event requesting for a ReplicaSet\n* The controller creates new Pod definitions (the exact number depends on what is defined in the ReplicaSet definition)\n* The scheduler detects unassigned Pods and decides to which nodes to assign the Pods.\n\nRemember: Don't create ReplicaSets directly. Use Deployments for rolling updates+rollbacks.	projects/knowledge/interview/kubernetes/129-describe-the-sequence-of-events-in-case-of-creatin.txt
k8s-workloads/d048b66ace0b	k8s-workloads	medium	k8s-workloads, daemonset, pod	What are some use cases for using a DaemonSet?	* Monitoring: You would like to perform monitoring on every node part of cluster. For example datadog pod runs on  every node using a daemonset\n* Logging: You would like to having logging set up on every node part of your cluster\n* Networking: there is networking component you need on every node for all nodes to communicate between them\n\nRemember: DaemonSet = one pod per node. For: log collectors, monitoring, network plugins.\n\nGotcha: DaemonSets use node affinity to ensure one copy per eligible node.	projects/knowledge/interview/kubernetes/152-what-are-some-use-cases-for-using-a-daemonset.txt
k8s-workloads/d15f93e7a5cf	k8s-workloads	medium	k8s-workloads, replicaset, pod	Scale down a replica set called "rori" to run 1 Pod instead of 5	`kubectl scale rs rori --replicas=1` reduces the ReplicaSet from 5 to 1 pod. Kubernetes terminates 4 pods, respecting terminationGracePeriodSeconds (default 30s) to allow graceful shutdown. \nGotcha: if pods have preStop hooks or need to drain connections, ensure the grace period is long enough to avoid dropped requests.	projects/knowledge/interview/kubernetes/149-scale-down-a-replica-set-called-rori-to-run-1-pod-.txt
k8s-workloads/d498276457f3	k8s-workloads	medium	k8s-workloads, replicaset, pod	What will happen when a Pod, created by ReplicaSet, is deleted directly with kubectl delete po ...?	The ReplicaSet will create a new Pod in order to reach the desired number of replicas.\n\nRemember: Don't create ReplicaSets directly. Use Deployments for rolling updates+rollbacks.	projects/knowledge/interview/kubernetes/127-what-will-happen-when-a-pod-created-by-replicaset-.txt
k8s-workloads/d5dab59d56f1	k8s-workloads	hard	k8s-workloads, deployment, statefulset, pod	Explain the considerations for deploying stateful applications in a Kubernetes cluster.	**Considerations for Stateful Applications:* • \n • Use StatefulSets to ensure stable network identities for pods.\n • Implement persistent volumes for data persistence.\n • Consider ordering and coordination when scaling stateful applications.\n • Configure affinity and anti-affinity rules for predictable pod placement. projects/knowledge/interview/kubernetes/367-explain-the-considerations-for-deploying-stateful-.txt\n\nRemember: Workload hierarchy: Deployment/StatefulSet/DaemonSet→ReplicaSet→Pod.\n\nGotcha: Use `kubectl explain <resource>` for field reference without leaving the CLI.	
k8s-workloads/dc9e0e657729	k8s-workloads	hard	k8s-workloads, deployment, statefulset	What rollout/deployment strategies are you familiar with?	* Blue/Green Deployments: You deploy a new version of your app, while old version still running, and you start redirecting traffic to the new version of the app\n* Canary Deployments: You deploy a new version of your app and start redirecting **portion** of your users/traffic to the new version. So you the migration to the new version is much more gradual\n\nRemember: Deployment > ReplicaSet > Pod. Three layers for declarative management.\n\nExample: `kubectl create deployment web --image=nginx:1.25 --replicas=3 --port=80`	projects/knowledge/interview/kubernetes/297-what-rolloutdeployment-strategies-are-you-familiar.txt
k8s-workloads/e042b8791fff	k8s-workloads	medium	k8s-workloads, replicaset, pod	True or False? If a ReplicaSet defines 2 replicas but there 3 Pods running matching the ReplicaSet selector, it will do nothing	False. It will terminate one of the Pods to reach the desired state of 2 replicas.\n\nRemember: Don't create ReplicaSets directly. Use Deployments for rolling updates+rollbacks.	projects/knowledge/interview/kubernetes/128-true-or-false-if-a-replicaset-defines-2-replicas-b.txt
k8s-workloads/e4375fcb3fb8	k8s-workloads	medium	k8s-workloads, replicaset, pod	You've created a ReplicaSet, how to check whether the ReplicaSet found matching Pods or it created new Pods?	`kubectl describe rs <ReplicaSet Name>`\n\nIt will be visible under `Events` (the very last lines)\n\nRemember: Don't create ReplicaSets directly. Use Deployments for rolling updates+rollbacks.	projects/knowledge/interview/kubernetes/136-youve-created-a-replicaset-how-to-check-whether-th.txt
k8s-workloads/e4eac356d4dc	k8s-workloads	medium	k8s-workloads, replicaset, pod	True or False? Removing the label from a Pod that is tracked by a ReplicaSet, will cause the ReplicaSet to create a new Pod	True. When the label, used by a ReplicaSet in the selector field, removed from a Pod, that Pod no longer controlled by the ReplicaSet and the ReplicaSet will create a new Pod to compensate for the one it "lost".\n\nRemember: Don't create ReplicaSets directly. Use Deployments for rolling updates+rollbacks.	projects/knowledge/interview/kubernetes/138-true-or-false-removing-the-label-from-a-pod-that-i.txt
k8s-workloads/e547454b3721	k8s-workloads	hard	k8s-workloads, deployment, statefulset	Explain Blue/Green deployments/rollouts in detail	Blue/Green deployment steps:\n\n1. Traffic coming from users through a load balancer to the application which is currently version 1\n\nUsers -> Load Balancer -> App Version 1\n\n2. A new application version 2 is deployed (while version 1 still running)\n\nUsers -> Load Balancer -> App Version 1\n                          App Version 2\n\n3. If version 2 runs properly, traffic switched to it instead of version 1\n\nUser -> Load Balancer     App version 1\n                       -> App Version 2\n\n4.\n\nRemember: Deployment > ReplicaSet > Pod. Three layers for declarative management.\n\nExample: `kubectl create deployment web --image=nginx:1.25 --replicas=3 --port=80`	projects/knowledge/interview/kubernetes/298-explain-bluegreen-deploymentsrollouts-in-detail.txt
k8s-workloads/e6638a429b90	k8s-workloads	hard	k8s-workloads, deployment, replicaset, pod	What happens after you edit a deployment and change the image?	The pod will terminate and another, new pod, will be created.\n\nAlso, when looking at the replicaset, you'll see the old replica doesn't have any pods and a new replicaset is created.\n\nRemember: Deployment > ReplicaSet > Pod. Three layers for declarative management.\n\nExample: `kubectl create deployment web --image=nginx:1.25 --replicas=3 --port=80`	projects/knowledge/interview/kubernetes/077-what-happens-after-you-edit-a-deployment-and-chang.txt
k8s-workloads/eb9cef59ba89	k8s-workloads	medium	k8s-workloads, replicaset, deployment	How to modify a replica set called "rori" to use a different image?	`kubectl edit rs rori` opens the ReplicaSet manifest in your default editor. Change the container image under spec.template.spec.containers[].image. \nGotcha: editing the ReplicaSet template does not automatically restart existing pods — you must delete old pods manually for the new image to take effect. Use Deployments for automatic rolling updates.	projects/knowledge/interview/kubernetes/147-how-to-modify-a-replica-set-called-rori-to-use-a-d.txt
k8s-workloads/ec530e870a09	k8s-workloads	medium	k8s-workloads, replicaset, pod	What is the difference between a replica set and a replication controller?	A Replication Controller (RC) is a wrapper on a pod. This provides additional functionality to the pods, which offers replicas. It monitors the pods and automatically restarts them if they fail. If the node fails, this controller will respawn all the pods of that node on another node. If the pods die, they won't be spawned again unless wrapped around a replica set.\n\nReplica Set (RS) is the next-generation replication controller. This kind of support has some selector types and supports both equality-based and set-based selectors. It allows filtering by label values and keys.	projects/knowledge/interview/kubernetes/406-what-is-the-difference-between-a-replica-set.txt
k8s-workloads/ec6ccc337918	k8s-workloads	hard	k8s-workloads, deployment, replicaset	Create a deployment with the following properties:	`kubectl create deployment blufer --image=python --replicas=3 -o yaml --dry-run=client > deployment.yaml`\n\nAdd the following section (`vi deployment.yaml`):\n\n```\nspec:\n  affinity:\n    nodeAffinity:\n      requiredDuringSchedulingIgnoredDuringExecution:\n        nodeSelectorTerms:\n        - matchExpressions:\n          - key: blufer\n            operator: Exists\n```\n\n`kubectl apply -f deployment.yaml`\n\nExample: `kubectl create deployment web --image=nginx --replicas=3 --port=80`\n\nRemember: Deployments manage ReplicaSets→Pods. `kubectl rollout` for updates.	projects/knowledge/interview/kubernetes/087-create-a-deployment-with-the-following-properties-.txt
k8s-workloads/ec9173767d20	k8s-workloads	medium	k8s-workloads, replicaset, pod	True or False? Pods specified by the selector field of ReplicaSet must be created by the ReplicaSet itself	False. The Pods can be already running and initially they can be created by any object. It doesn't matter for the ReplicaSet and not a requirement for it to acquire and monitor them.\n\nRemember: Don't create ReplicaSets directly. Use Deployments for rolling updates+rollbacks.	projects/knowledge/interview/kubernetes/133-true-or-false-pods-specified-by-the-selector-field.txt
k8s-workloads/ee64166cc06e	k8s-workloads	medium	k8s-workloads, deployment, statefulset	How to edit a deployment?	`kubectl edit deployment <DEPLOYMENT_NAME>` opens the manifest in your editor for live editing. Changes to the pod template (image, env, resources) trigger an automatic rolling update. Alternative: `kubectl set image deployment/<name> container=image:tag` for quick image updates without opening an editor. Use `kubectl rollout status` to monitor the update progress.	projects/knowledge/interview/kubernetes/076-how-to-edit-a-deployment.txt
k8s-workloads/f48e46c5397b	k8s-workloads	easy	k8s-workloads, deployment, replicaset, pod	True or False? The same as there are "Static Pods" there are other static resources like "deployments" and "replicasets"	False. Static Pods are unique — they are managed directly by the kubelet on a specific node, not by the API server. Deployments, ReplicaSets, and other workloads are API-managed resources with no 'static' equivalent.\n\nRemember: Don't create ReplicaSets directly. Use Deployments for rolling updates+rollbacks.	projects/knowledge/interview/kubernetes/051-true-or-false-the-same-as-there-are-static-pods-th.txt
k8s-workloads/f706f603e563	k8s-workloads	medium	k8s-workloads, deployment, statefulset	How to execute a rollback?	For Helm: `helm rollback RELEASE_NAME REVISION_ID` reverts to a previous release revision. For Deployments: `kubectl rollout undo deployment/<name>` reverts to the previous ReplicaSet, or `kubectl rollout undo deployment/<name> --to-revision=2` for a specific version. Check history first with `kubectl rollout history deployment/<name>`.	projects/knowledge/interview/kubernetes/262-how-to-execute-a-rollback.txt
k8s-workloads/f75ca8028e9b	k8s-workloads	medium	k8s-workloads, deployment, replicaset, pod	How to create a deployment with the image "nginx:alpine"?	`kubectl create deployment my-first-deployment --image=nginx:alpine`\n\nOR\n\n```\ncat << EOF | kubectl create -f -\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n  name: nginx\nspec:\n  replicas: 1\n  selector:\n    matchLabels:\n      app: nginx\n  template:\n    metadata:\n      labels:\n        app: nginx\n    spec:\n      containers:\n      - name: nginx\n        image: nginx:alpine\n```\n\nExample: `kubectl create deployment web --image=nginx --replicas=3 --port=80`\n\nRemember: Deployments manage ReplicaSets→Pods. `kubectl rollout` for updates.	projects/knowledge/interview/kubernetes/074-how-to-create-a-deployment-with-the-image-nginxalp.txt
k8s-workloads/f8c8e45a6102	k8s-workloads	medium	k8s-workloads, replicaset, deployment	You would like to limit the number of resources being used in your cluster. For example no more than 4 replicasets, 2 services, etc. How would you achieve that?	Use ResourceQuotas to limit the total number of objects and resource consumption per namespace. \nExample: `kubectl create quota my-quota --hard=replicasets=4,services=2,pods=10` in a namespace. ResourceQuotas also limit total CPU/memory: `requests.cpu=4,limits.memory=8Gi`. \nGotcha: without LimitRange, users can still create pods without resource requests, so combine both.	projects/knowledge/interview/kubernetes/304-you-would-like-to-limit-the-number-of-resources-be.txt
k8s-workloads/f90bb57a97a1	k8s-workloads	hard	k8s-workloads, deployment, cronjob, pod	What happens behind the scenes when you create a Deployment object?	The following occurs when you run `kubectl create deployment some_deployment --image=nginx`\n\n1. HTTP request sent to kubernetes API server on the cluster to create a new deployment\n2. A new Pod object is created and scheduled to one of the workers nodes\n3. Kublet on the worker node notices the new Pod and instructs the Container runtime engine to pull the image from the registry\n4. A new container is created using the image that was just pulled\n\nRemember: Deployment > ReplicaSet > Pod. Three layers for declarative management.\n\nExample: `kubectl create deployment web --image=nginx:1.25 --replicas=3 --port=80`	projects/knowledge/interview/kubernetes/080-what-happens-behind-the-scenes-when-you-create-a-d.txt

<!-- wiki:related:start -->
---

## Wiki Navigation

### Related Content

- [Kubernetes Pods & Scheduling](../../../../library/topics/k8s-pods-and-scheduling/index.md) (Topic Pack, L1) — Kubernetes Pods & Scheduling

<!-- wiki:related:end -->
