Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to conduct a case study of DaemonSet-playing with Docker container technology for 5 minutes a day

Shulou Source: shulou.com Published: 2022-06-01 00:54:42 09月12日 Update

How to conduct a case study of DaemonSet-play with Docker container technology for 5 minutes a day. I believe many inexperienced people don't know what to do about it. Therefore, this article summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

Analyze the DaemonSet:kube-flannel-ds and kube-proxy of two K8s in detail.

Kube-flannel-ds

Let's learn DaemonSet by analyzing kube-flannel-ds.

Remember how the flannel network was deployed before? We executed the following two commands:

Kubectl apply-f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml

The DaemonSet of flannel is defined in kube-flannel.yml:

Note: the complete content of the configuration file is more complex, and only the most important content is retained here in order to learn DaemonSet better.

The syntax and structure of the ① DaemonSet configuration file are almost exactly the same as Deployment, except that kind is set to DaemonSet.

② hostNetwork specifies that Pod directly uses Node's network, which is equivalent to docker run-- network=host. Considering that flannel needs to provide network connectivity to the cluster, this requirement is reasonable.

③ containers defines two containers that run flannel services.

Let's analyze another DaemonSet kube-proxy.

Kube-proxy

Since the YAML file for kube-proxy is not available, you can only run the following command to view its configuration:

Kubectl edit daemonset kube-proxy-namespace=kube-system

Again, for ease of understanding, only the most important information is retained here.

① kind: DaemonSet specifies that this is a resource of type DaemonSet.

② containers defines the container for kube-proxy.

③ status is the runtime state of the current DaemonSet, and this part is unique to kubectl edit. In fact, every currently running resource in the Kubernetes cluster can view its configuration and running status through kubectl edit, such as kubectl edit deployment nginx-deployment.

After reading the above, have you mastered how to conduct a case study of DaemonSet-how to play with Docker container technology for 5 minutes a day? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Tags: Analysis operation container content configuration two files networks technologies cases case studies importance commands methods more status resources problems clusters learning Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker Shulou Technology Apple Huawei Xiaomi