updating the deployment, need to change multiple values

10/19/2016

I am trying to automate the update to the deployment using

kubectl set

I have no issues using kubectl set image command to push new version of the docker image out, but I also need to add a new persistent disk for the new image to use. I don't believe i can set 2 different options using the set command. What would be the best option to do this?

-- Vit Dolphin
gcloud
kubernetes

1 Answer

10/19/2016

http://kubernetes.io/docs/user-guide/managing-deployments/#in-place-updates-of-resources has the different options you have.


You can use kubectl apply to modify multiple fields at once.

Apply a configuration to a resource by filename or stdin. This resource will be created if it doesn’t exist yet. To use ‘apply’, always create the resource initially with either ‘apply’ or ‘create –save-config’. JSON and YAML formats are accepted.

Alternately, one can use kubectl patch.

Update field(s) of a resource using strategic merge patch JSON and YAML formats are accepted.

-- Anirudh Ramanathan
Source: StackOverflow