The following will introduce the subcommands edit and set, for the purpose of updating the containers under Deployment:
- 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; ...