Deployment update strategy – rolling-update

The following will introduce the subcommands edit and set, for the purpose of updating the containers under Deployment:

  1. First, let's update the Pods in Deployment with a new command:
// get into editor mode with the command below// the flag "--record" is for recording the update// add the command argument as below and save the change$ kubectl edit deployment simple-nginx --recordspec:  replicas: 5  ...  template:    ...    spec:      containers:      - image: nginx        command:           - sh          - -c          - echo "Happy Programming with Kubernetes!" > /usr/share/nginx/html/index.html && service nginx stop && nginx -g "daemon off;"        imagePullPolicy: Always        ...deployment.extensions "simple-nginx" edited

We are not only doing the update; ...

Get Getting Started with Containerization now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.