May 2018
Intermediate to advanced
554 pages
13h 51m
English
In this scenario, we would focus on the communications between containers within single Pod:
// configuration file of creating two containers within a pod$ cat two-container-pod.yamlapiVersion: v1kind: Podmetadata: name: two-containerspec: containers: - name: web image: nginx ports: - containerPort: 80 hostPort: 80 - name: centos image: centos command: ["/bin/sh", "-c", "while : ;do curl http://localhost:80/; sleep 30; done"]// create the pod$ kubectl create -f two-container-pod.yamlpod "two-container" created// check the status of the newly-created Pod$ kubectl get pod two-containerNAME READY ...
Read now
Unlock full access