The official kubernetes guidelines, instructs on updating the deployment either by performing a command line set
:
kubectl set image deployment/nginx-deployment nginx=nginx:1.9.1
or by inline editing (that will launch the default editor I guess)
kubectl edit deployment/nginx-deployment
However both processes make consistency more difficult given that one needs to go and udpate offline the my-deployment.yml
file, where the up & running deployment came from. (and this deprives one from the advantage of keeping their manifests version-controlled).
Is there a way to
You can edit a Deployment by changing the container image from one version to the other, decreasing or increasing the number of instances by changing the ReplicaSet value.
Updating an application You can use kubectl apply to update a resource by applying a new or updated configuration. Note: To update a resource with kubectl apply , the resource must be created using kubectl apply or kubectl create --save-config . Replace MANIFEST with the name of the manifest file.
You can do it simply by following steps -
Run below command -
kubectl apply -f deployment.yaml
This is what I usually follow. You can use a kubectl patch or edit also.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With