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 description about the pods use:
kubectl describe pod {name from get pods command}
eg.
plugin for help (pycharm)
https://plugins.jetbrains.com/plugin/9354-kubernetes-and-openshift-resource-support
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 description about the pods use:
kubectl describe pod {name from get pods command}
eg.
apiVersion: v1 kind: Pod metadata: name: myapp-pod labels: name: myapp type: pod spec: containers: - name: nginx-image image: nginx
plugin for help (pycharm)
https://plugins.jetbrains.com/plugin/9354-kubernetes-and-openshift-resource-support
Comments
Post a Comment