Deployment & Replicaset

| Deployments | ReplicaSet |
|---|---|
| High-level abstractions that manage replica sets. It provides additional features such as rolling updates, rollbacks, and versioning of the application. | A lower-level abstraction that manages the desired number of replicas of a pod. Additionally, it provides basic scaling and self-healing mechanisms. |
| Deployment manages a template of pods and uses replica sets to ensure that the specified number of replicas of the pod is running. | ReplicaSet only manages the desired number of replicas of a pod. |
| Deployment provides a mechanism for rolling updates and rollbacks of the application, enabling seamless updates and reducing downtime. | Applications must be manually updated or rolled back. |
| It provides versioning of the application, allowing us to manage multiple versions of the same application. It also makes it easy to roll back to a previous version if necessary. | ReplicaSet doesn’t provide this feature. |
Usage
kubectl run nginx-deployment --image=nginx:1.7.9 --replicas=3
kubectl get deployment nginx-deployment
kubectl describe deployment nginx-deployment
kubectl get replicaset
kubectld describe replicaset nginx-deployment-xxxxxxxxxx
kubectl scale deployment nginx-deployment-new --replicas=5
kubectl delete deployment nginx-deployment-new
Reference
https://thenewstack.io/kubernetes-deployments-work/https://www.baeldung.com/ops/kubernetes-deployment-vs-replicasethttp://wiki.ciscolinux.co.uk/index.php/Kubernetes/Deployment,_ReplicaSet_and_Pod
Some of the content is generated by AI, please be cautious in identifying it.