Skip to main content

Posts

Showing posts with the label yaml

Yaml in kubernetes

A kubernetes yaml file will always contain top 4 level fields (required field) apiVersion: kind: metadata: spec: ______________________________________________________________________ kinds : Pod (can be Pod , service , ReplicaSet , Deployment) metadata:     name: myapp-pod     labels:       app: myapp metadata values are in the form of the dictionary metadata can only have name and labels however, labels can have as many properties as u wish spec  is a dictionary spec:    containers: (this is an list or an array bcz pods can have multiple containers within them)        - name : nginx-container (the - indicates that this is the first item in the list)           image : nginx create the pod using the command kubectl create -f pod-definition.yml once you create the pod,, to see it use the command kubectl get pods to get the detailed descripti...