skip to content
Alvin Lucillo

Create a pod and service in one command

/ 1 min read

💻 Tech

With the command below, you can create a pod and expose it with a new service in one command. This is an imperative command to create a pod but with --expose=true flag that exposes a pod (or a deploymenbt if you’re creating a deployment).

kubectl run httpd --image=httpd:alpine --port=80 --expose=true