Skip to Content
Learn OpenShift
book

Learn OpenShift

by Denis Zuev, Artemii Kropachev, Aleksey Usov
July 2018
Intermediate to advanced
504 pages
11h 34m
English
Packt Publishing
Content preview from Learn OpenShift

Running Kubernetes pods

As with Docker, we can run a Kubernetes pod with the kubectl run command. Let's start with a simple web server example:

$ kubectl run httpd --image=httpd

We can verify the result by getting a list of Kubernetes pods, by running the kubectl get pods command:

$ kubectl get podsNAME                      READY    STATUS    RESTARTS    AGEhttpd-8576c89d7-qjd62      1/1     Running    0          6m
The first time you run this command, you will probably see that the Kubernetes pod status shows up as ContainerCreating. What is happening behind the scenes is that the Docker httpd image is being downloaded to Minikube VM. Be patient and give it some time to download the image. A few minutes later you should be able to see the container status is Running. The kubectl run command ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Operating OpenShift

Operating OpenShift

Rick Rackow, Manuel Dewald
OpenShift for Developers, 2nd Edition

OpenShift for Developers, 2nd Edition

Joshua Wood, Brian Tannous
Kubernetes: Up and Running, 2nd Edition

Kubernetes: Up and Running, 2nd Edition

Brendan Burns, Joe Beda, Kelsey Hightower

Publisher Resources

ISBN: 9781788992329Supplemental Content