<p>I'm using Kubernetes to deploy my latest app. I've containerized it using docker and when I deploy it with docker it works fine. If I then take the same image and try to deploy it using Kubernetes with</p>

<pre><code>kubectl create deployment mydeploy --image=myimage
</code></pre>

<p>I get the following error showing as the status of my pod <code>crashloopbackoff</code>.</p>

<p>If I log the pod I can see that the app is crashing because of this error:
<code>/bin/sh: 1: [npm,: not found</code> 
Even more strange is that if I now try and use that same image in docker again the container fails to start and I get the exact same error in docker. If I rebuild the image it will start working with docker again but I still have yet to get a working deployment with Kubernetes.</p>

<p>I've used the <code>kubectl create deployment</code> with other peoples' images and it works fine, only seems to be an issue when I'm using the image I am building for my app.</p>

<p>Please help!</p>

MantisLanguage
<p>I actually had this same issue a while back.</p>

<p>The cause of the issue for me had to do with how Kubernetes uses permissions when it is loading the image.  I am using Kubernetes on a Mac for all my dev work and in that setup docker and Kubernetes are kinda linked together with docker desktop.  The problem is that if Kube doesn't think it has permissions to access the image it will try and create a deployment but won't use the image you specified, because it hasn't been given access.  You will get the same error if you have a misspelling your image tag name as well.</p>

<p>In my case the tag name was correct but I needed to push my newly created image up to docker before I tried to run it in Kube.  Once I did that Kube had the permissions access it needed to use the image and I was able to deploy without issue.</p>

<p>First I'd check the spelling on your image tag and if that looks good try pushing it to docker before you deploy with Kube.  Hope this helps!</p>
