Why am i not able to set image using this command?

kubectl set image frontend kodekloud/webapp-color:v1=kodekloud/webapp-color:v2
error: the server doesn’t have a resource type “frontend”
root@controlplane:~# kubectl set image deployment frontend kodekloud/webapp-color:v1=kodekloud/webapp-color:v2
error: unable to find container named “kodekloud/webapp-color:v1”

@ajey, you need to provide the container name instead of the image.

kubectl set image deployment frontend simple-webapp=kodekloud/webapp-color:v2

1 Like

@ajey You can use this format to easily remember how this cmd works:

kubectl set image deployment <deployment-name> <container-name>=<image-name>:<version>

Hope this helps!

If you want to connect, feel free to share an invite at Linkedin.

Thanks, @malirashid1994 for sharing the pattern.