Deployment provides us the capability to upgrade underlying instances seamlessly using rolling update, undo changes, pause and resume changes as required
Deployment definition
apiVersion: apps/v1
kind: Deployment
metadata:
name: frontend
labels:
app: guestbook
tier: frontend
spec:
# modify replicas according to your case
replicas: 3
// template content from the pod definition file
selector:
matchLabels:
tier: frontend
template:
metadata:
labels:
tier: frontend
spec:
containers:
- name: php-redis
image: gcr.io/google_samples/gb-frontend:v3
kubectl create -f deployment-definition.yml
kubectl get deployments
kubectl get replicaset
//shows replcaset in the name of new deployment