Day 16 Deployment
Day 16 Deployment
-------------------------------------
Migration of Pods :
- Its an API-resource of k8s likewise pod, rs
- Deployment ---> it supports rolling update and rollback which not allowed
in replicaset.
- To avoid manually migration of s/w version in deployment.
- Replica Set is the base of Deployment resource.
- Its namespace oriented resource of k8s
-----------------------
vi deploy-test.yaml
-----------------------
apiVersion: apps/v1
kind: Deployment
metadata:
name: myapp2
namespace: cdts
spec:
replicas: 10
selector:
matchLabels:
app: nginx
env: prod
template:
metadata:
labels:
app: nginx
env: prod
spec:
containers:
- name: c1
image: nginx:1.14
ports:
- containerPort: 80
--------------------------------
------------------------------------------------------------------------------
We can check revision hisotry of rolling update ( migration / rollback )
------------------------------------------------------------------------------
kubectl rollout history deployment myapp2 -n cdts
-----------------------------------------------------------------------
We can change surge value which help to create pods without minimal downtime , we
can follow this
We need to change as per below : ( deploy edit will open in vi editor so save
properly )
strategy:
rollingUpdate:
maxSurge: 25% ---> 50%
maxUnavailable: 25% --> 50%
-------------------------------------------------------
When we deploy next time it will create new pods as per updated surge value.
--------------------------------------------------------