https://kubernetes.io/docs/concepts/workloads/controllers/deployment/
Create a new deployment called nginx-deploy
, with image nginx:1.16
and 1
replica. Next upgrade the deployment to version 1.17
using rolling update.
Deployment : nginx-deploy. Image: nginx:1.16
Image: nginx:1.16
Task: Upgrade the version of the deployment to 1:17
Task: Record the changes for the image upgrade
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deploy
labels:
app: nginx:1.16
spec:
replicas: 1
selector:
matchLabels:
app: nginx:1.16
template:
metadata:
labels:
app: nginx:1.16
spec:
containers:
- name: nginx
image: nginx:1.16
ports:
- containerPort: 80
kubectl set image deployment/nginx-deploy nginx=nginx:1.17