After completing this session , you will be able to create Pod declaratively
So lets get started.
apiVersion: v1
kind: Pod
metadata:
name: mypod
labels:
app: nginx
spec:
containers:
- name: nginx-demo
image: nginx:1.9.1
ports:
- containerPort: 80
$ kubectl create -f webserver.yaml
$ kubectl get pods
$ kubectl -n default port-forward mypod 8080:80
$ kubectl logs mypod
$ kubectl get pods -o wide
$ kubectl describe pod mypod
$ kubectl get pod mypod -o yaml
$ kubectl delete pod mypod