<p>I'm trying to update an image in Kubernetes by using the following command:</p>

<pre><code>kubectl set image deployment/ms-userservice ms-userservice=$DOCKER_REGISTRY_NAME/$BITBUCKET_REPO_SLUG:$BITBUCKET_COMMIT --insecure-skip-tls-verify
</code></pre>

<p>But when I receive the following error:</p>

<pre><code>error: the server doesn't have a resource type "deployment"
</code></pre>

<p>I have checked that i am in the right namespace, and that the pod with the name exists and is running.</p>

<p>I can't find any meaningful resources in regards to this error.</p>

<p>Sidenote: I'm doing this through Bitbucket and a pipeline, which also builds the image i want to use. </p>

<p>Any suggestions?</p>

TietjeDK
<p>I've had this error fixed by explicitly setting the namespace as an argument, e.g.:</p>

<pre><code>kubectl set image -n foonamespace deployment/ms-userservice.....
</code></pre>

<p><a href="https://www.mankier.com/1/kubectl-set-image#--namespace" rel="nofollow noreferrer">https://www.mankier.com/1/kubectl-set-image#--namespace</a></p>
