...

>

A Quick and Dirty Way to Run Pods

A Quick and Dirty Way to Run Pods

Learn to create Pods using the imperative method.

Creating a Pod with Mongo

Just as we can execute docker run to create containers, kubectl allows us to create Pods with a single command. For example, if we’d like to create a Pod with a Mongo database, the command is as follows:

Shell
kubectl run db --image mongo

You’ll notice that the output says that “pod/db created”. We have created our first Pod. We can confirm that by listing all the Pods in the cluster.

Shell
kubectl get pods

The output should be ...

Shell
NAME READY STATUS RESTARTS AGE
db 0/1 ContainerCreating 0 1m
...