pod-definition.yml

Kubernetes use yml file as input to create objects such as pod, replicaSet, deployment, service.

The yml file have 4 required fields

  • apiVersion => Version of Kubernetes API used to create the object. For example: POD -> v1, Service -> v1, ReplicaSet -> apps/v1, Deployment -> apps/v1

  • kind => Type of object we are trying to create (pod, replicaSet, deployment, service)

  • metadata => Data about the object (Only two and any two that kubernetes expect like name, label, etc). For labels, you can indicate any key value pair as you wish that can be used to for pod identification and grouping. For example, "type: front-end" is for front-end pods.

  • spec => For info about containers and image. There is different format for different object (so check documentation)

kubectl create -f pod-definition.yml

Last updated