Skip to main content

Command Palette

Search for a command to run...

YAML templates for pod creation in Kubernetes

Published
1 min read

A pod can be created using a YAML template

$vim pod_definition.yml

A simple pod_definition template in YAML is as follows:

apiVersion: v1

kind: Pod

metadata:

name: new-pod

spec:

containers:

- name: nginx

image: nginx

Then, execute the command:

$kubectl create -f pod_definition.yml

Now, Kubernetes creates a pod.

To see the list of pods created: $kubectl get pods

To describe a pod: $kubectl describe pod <pod_name>

R

Hey There!

P

How can I help you?

R

can we connect? PARINITHA B.S