Pod Connectivity
How to deploy pods?
Lets now take a look to create a nginx pod using kubectl.
Step 1: To deploy a docker container by creating a POD.
kubectl run myapp --image nginxStep 2: To get the list of pods
kubectl get podsStep 3: Run the command **kubectl describe pod <<podname>>**look under the containers section.
kubectl describe pod myappkubectl delete pod myappStep 4: Create a pod definition YAML file and use it to create a POD or use the command kubectl run myapp-pod --image=nginx.
kubectl run myapp-pod --image=nginx --dry-run=client -o yaml > myapp-pod.yamlkubectl create -f myapp-pod.yamlStep 5: View the Manifest and the file would like something like this or you can modify the file as below. Some not important structure is removed from the original file.
apiVersion: v1
kind: Pod
metadata:
labels:
run: myapp
name: myapp-pod
spec:
containers:
- image: nginx
name: myapp-container
restartPolicy: AlwaysLast updated