Skip to main content

Command Palette

Search for a command to run...

Day 06 Updating Kubernetes Deployments

Published
1 min read
Day 06 Updating Kubernetes Deployments
P

Experienced DevOps & Software Engineer, Creating and Scaling applications over various emerging technologies. :)

(1) why do we need to update the Deployment?

(2) previously created Deployment.

  • Create Deployment

kubectl create -f nginx-deployment.yaml

(3) Different ways to update the deployment.

  1. using kubectl set image option.

  2. updating deployment YAML file and applying kubect apply -f.

  3. using edit deployment.

(1) Using kubectl set image deployment/deployment-name

kubectl set image deployment/nginx-deployment nginx=nginx:1.15.0 --record=true
# Verify Rollout Status 
kubectl rollout status deployment/nginx-deployment

(2) Making changes in (*deployment).yaml file.

  • you can change metadata in YAML like replicas, image names etc and apply changes by running kubectl apply -f nginx-deployment.yaml

(3) Using edit deployment

# get deployment
kubectl get deployment

#edit deployment

kubectl edit deployment/nginx-deployment

# edit open in vi editor you can change value in here and save it.
# Verify the same using `kubectl get pods` command.

Made with :heart: by Pratikkumar Panchal

More from this blog

Pratikkumar Panchal

19 posts

Experienced DevOps & Software Engineer, Creating and Scaling applications over various emerging technologies. :)