Deploying a node.js application with Bluemix

3/30/2017

I am trying to deploy a simple node.js application with the new Kubernetes support in Bluemix. When I run the container I made, I get a ImagePullBackOff error, which means it can't pull down the image.

NAME                                  READY     STATUS             RESTARTS   AGE
hello-node-2399519400-6m8dz           0/1       ImagePullBackOff   0          13m

My Docker image uses the node.js base image.

FROM node:6.9.2
EXPOSE 8080
COPY server.js .
CMD node server.js

I deployed using:

docker build -t hello-node:v1 .
kubectl run hello-node --image=hello-node:v1 --port=8080

I am thinking that Bluemix can't pull down the node.js image, but I am not certain.

-- Robert F. Dickerson
containers
ibm-cloud
kubernetes

2 Answers

4/1/2017

I had to first push the image to Bluemix with:

docker build -t registry.ng.bluemix.net/namespace/hello-node:1
docker push registry.ng.bluemix.net/namespace/hello-node:1
kubectl run hello-node-deployment --image=registry.ng.bluemix.net/namespace/hello-node:1
-- Robert F. Dickerson
Source: StackOverflow

3/31/2017

I see the docker build of the image, and I'm presuming that you're using the kubectl with the exported cluster config (bx cs cluster-config ...), so that it's targetting your cluster.

Did you tag and push that image from your local docker into the bluemix registry, or to another remote registry that would be accessible from the container service? (My apologies if this is obvious - just didn't see the step there to tag and push it to a registry that would be available).

-- N Fritze
Source: StackOverflow