3596 articles
how to update pod image in Kubernetes
-
- 2024/3/6 11:32
- Default
- image deployment kubectl
- 710
Method 1: Edit Deployment
-
Find the deployment you want to update:
kubectl get deployments
-
Edit the deployment with the updated image:
kubectl edit deployment <deployment-name>
-
In the YAML file, update the
image
field under thespec.template.spec.containers
section with the new image. For example:containers: - name: my-app image: my-app:latest
-
Save and exit the YAML file.