Running your container

Now, let's run the container we just made. We will use the kubectl run command as with the Python example, but replacing flask with nodejs to specify the container we just made and uploaded:

kubectl run nodejs --image=quay.io/kubernetes-for-developers/nodejs:0.2.0 --port=3000deployment “nodejs” created

To see what it's doing, we need to ask the cluster for the current state of the resources we just created:

kubectl get deploymentsNAME      DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGEnodejs    1         1         1            1           1dkubectl get podsNAME                     READY     STATUS    RESTARTS   AGEnodejs-568183341-2bw5v   1/1       Running   0          1d

The kubectl run command works regardless of the language, and in the same fashion as the Python example. The simple deployment created in this ...

Get Kubernetes for Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.