Page cover

How to Create a New Pod use CLI

To create a Pod through the CLI by running the following syntax.

nano pod.yaml

The pod.yaml file page appears automatically and includes the following lines of code. You can customize the name and namespaces.

apiVersion: v1
kind: Pod
metadata:
  name: pod-bmb4e
  namespace: default
spec:
  containers:
    - name: nginx
      image: nginx
      ports:
        - containerPort: 80

To apply the configuration to pod.yaml , you need to run the following syntax.

kubectl apply -f pod.yaml

Last updated