skip to content
Alvin Lucillo

Ways to create pod

/ 1 min read

💻 Tech

Three of the ways to create pod. The last two has -f - which means the input is read from th standard input (stdin)

  1. k run nginx --image=nginx
  2. echo "apiVersion: v1
    kind: Pod
    metadata:
      creationTimestamp: null
      labels:
        run: nginx
      name: nginx
    spec:
      containers:
       - image: nginx
         name: nginx "
    | k apply -f - 
  3. k apply -f - <<EOF
    echo "apiVersion: v1
    kind: Pod
    metadata:
      creationTimestamp: null
      labels:
        run: nginx
      name: nginx
    spec:
      containers:
       - image: nginx
         name: nginx
    EOF