Deployments
Deployment make sure that the pods are updated without hampering the access to the services. It makes the updates like rolling updates and rollbacks to previous version seamless as all the pods in deployments are not updated all at once. Updates happen one by one so that the application is accessible to the user.
Deployment comes on top of Replicaset.
The definition file of deployment is same as replicaset with kind
set to Deployment
.
apiVersion: apps/v1
kind: Deployment
metadata:
name: app-rs
labels:
type: router-rs
spec:
template:
metadata:
name: router-pod
labels:
type: router
spec:
containers:
- name: nginx
image: nginx
replicas: 2
selector:
matchLabels:
type: router
Resources
- Learn Kubernetes in simple, easy and fun way with hands-on coding exercises. For beginners in DevOps. By Mumshad Mannambeth. Udemy.