Command

Kubernetes Run a Pod Command

The Kubernetes command to run a pod is kubectl run nginx --image=nginx -n mynamespace.

Quick Answer

Command
kubectl run nginx --image=nginx -n mynamespace
KubernetesCommand

Run a Pod

Type this command
kubectl run nginx --image=nginx -n mynamespace

Runs a single instance of nginx pod in a namespace.

Learn More

How to run a pod in Kubernetes

  1. Open the terminal or command interface for Kubernetes.
  2. Type kubectl run nginx --image=nginx -n mynamespace, replace any placeholders, and run it.

Kubernetes Run a Pod Command

Run kubectl run nginx --image=nginx -n mynamespace.

Related Commands

Frequently asked questions

What is the Kubernetes command to run a pod?

Run kubectl run nginx --image=nginx -n mynamespace.

Where do I type this Kubernetes command?

Type it in the terminal or command-line interface used by Kubernetes.

Does this Kubernetes command work on Mac and Windows?

Yes. The command text is the same on both platforms when the tool is installed.

Official source · How we verify