/images/avatar.png

八、Access POD metadata and other resources from applications

1. Downward API passing metadata To be honest, this chapter is also in the clouds, and it feels similar to the environment variable configuration. My understanding is that the Downward API is used to configure the metadata of the POD or container, and the environment variables are used to define some regular variable parameters. Downward API supports environment variables and files, which is more flexible. 2. Kubernetes API server interaction In fact, this section mainly talks about how to use the Kubernetes API.

七、ConfigMap and Secret configuration application

1. Configuration of container command line parameters Docker uses command line parameters by defining Entrypoint and CMD in Dockerfile, but there is a problem, this is packaged into the image. Let’s take a look at the difference between the two first. Entrypoint: Defines the executable program that is invoked when the container starts. CMD: Specifies the parameters passed to Entrypoint. So the usual practice is to define these two. When starting with the command line, you can use the argu of the command line to override the definition of CMD in the file.

六、Volume - mount the disk to the container

1. volume Finally waiting for you, volume, volume. It is also a very important component of kubernetes. No, it should not be said to be a component of k8s, it should be said to be a part of POD. What problem is the volume used to solve? POD is actually equivalent to a logical host, and each POD may have multiple containers. We know that these containers are actually processes equivalent to logical hosts.

五、POD service and communication

1. Service and port The service is actually easy to understand. Think about it, how do you manage a group of the same POD? Do you need to know all their IPs, and then manually configure and connect them one by one? Obviously not needed, how to solve this problem, use services, services are actually equivalent to a routing function. Look at this, there are 3 PODs on the front end, and a Backend, how to make the whole system run normally, using services.

四、Deploy managed POD by copy mechanism

1. Survival Probe Why come up with such a profound word? We know that if a container program in the POD crashes, kubenetes will restart the program, but the problem is, if it is not a crash, such as a deadlock, or throwing an exception, etc., what to do at this time, kubenetes does not know Whether your container is normal or not, you need to use a probe at this time.

三、Containers running in Kubernetes

1. Why create a POD We know that POD is the smallest unit managed by Kubernetes. Why does Kubernetes not directly manage containers, but manage PODs? There is a reason for this. We know that a container is a single process. What does it mean? The design idea of a container is that each container only runs one process. If you use dry bernetes to directly manage these containers, it must be complicated, so I will do it The POD is introduced to realize resource and network isolation between containers.