A Quick Way to Run Pods
Understand how to quickly create Pods in Kubernetes using kubectl commands and why using declarative YAML specifications is preferred for repeatability and maintainability. Explore how to confirm Pod status and troubleshoot when running containers like MongoDB within a cluster.
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:
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.
The output should be something like this:
In the output, we can see the following:
- The name of the Pod
- Its readiness