Here's how you can do it:
1. List the pods within the deployment to see the container names. Run the following command:
# kubectl get pods -l app=nginx-deployment
This will display a list of pods in the deployment along with their names.
2. Identify the correct container name from the list of pods.
3. Replace "nginx" in the `kubectl set image` command with the correct container name. For example, if the correct container name is "nginx-container", your command would be:
# kubectl set image deployment/nginx-deployment nginx-container=nginx:1.17
Make sure to replace "nginx-container" with the actual container name you found in your deployment.
4. Run the updated `kubectl set image` command.
No comments:
Post a Comment