1. Pod: a group of containers in operation. Pod is the smallest unit used in Kubernetes. For example, there are two containers inside the POD, each running an application, namely file upload and Web service. Users can upload images using file uploads and then query images using web services. These two services constitute a complete application external service.

In the figure below, the numbers in red indicate how many apps are crowded into the POD, and the green box indicates how many apps are running properlyKubectl run mynginx –image=nginx –image=nginx –image=nginx –image=nginx As shown below, the container is being createdCheck the pod. Check Pod kubectl get Pod in the default namespace

Describe the pod creation process: Kubectl describe pod mynginx

2. Use kubectl apply -f mutil-container-pod.ymal to create a pod

Yaml content is explained below:

2.1. labels name is the name of pod (the name must not be the same every time pod is created).

2.2. The following two elements represent two containers, namely NGX and TomcatFrom the dashboard you can see that the POD has been created with two containers crammed inside, Tom and NGX

3. Container application access: We have deployed a multi-container POD, and then the container instance running inside can be accessed through the external network. When creating a POD, K8S assigns each pod an IP. You can see the IP of myApp from the Dash consoleWe can access the application via pod’s IP + the application’s port, as shown in the two figures belowAccess Tomcat and Nginx In addition, applications between pod containers can use 127.0.0.1:port to access another application. For example, I can use 127.0.0.1::8080 to access Tomcat in an Nginx container. (Think of a POD as a dormitory, where each container is a resident employee who shares the pod’s network space and storage). To test if this is the case, see the diagram below, where I access Tom from dashboard inside the NGX containerOnce in the nginx container, access Tomcat. 127.0.0.1:8080, you can see the Tomcat home page

Delete pod: kubectl delete pod name Query pod run logs. Kubectl get pod-owide kubectl get pod-owide kubectl get pod-owide Any machine in the cluster and any application can access the Pod through its ASSIGNED IP address