In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the relevant knowledge of "what is the usage scenario of DaemonSet service daemon". The editor shows you the operation process through an actual case. The operation method is simple, fast and practical. I hope this article "what is the usage scenario of DaemonSet service daemon" can help you solve the problem.
What is DaemonSet?
DaemonSet is a set of daemons, abbreviated to ds;, which deploys a Pod on all nodes or matching nodes.
[root@k8s-master01] # kubectl get nodesNAME STATUS ROLES AGE VERSIONk8s-master01 Ready 8d v1.23.3k8s-master02 Ready 8d v1.23.3k8s-master03 Ready 8d v1.23.3k8s-node01 Ready 8d v1.23.3k8s-node02 Ready 8d v1.23.3
For example, we can see from the previous code that our cluster has five nodes, and Daemon will deploy a Pod; on all five nodes, or we only need to deploy on the node node, then we can use the tag to deploy Pod only on the node node. For example, our calico network plug-in is deployed with DaemonSet.
Usage scenarios of DaemonSet:
Monitoring data collection: data needs to be collected on each node
Monitor node status
Responsible for the network, storage and other components of each node, such as calico, ceph, etc.
Use of DaemonSet: apiVersion: apps/v1kind: DaemonSetmetadata: labels: app: nginx name: nginxspec: revisionHistoryLimit: 10 selector: matchLabels: app: nginx template: metadata: creationTimestamp: null labels: app: nginxspec: containers:-name: nginx image: nginx:1.18.0 imagePullPolicy: Always resources: {} terminationMessagePath: / dev/termination-log TerminationMessagePolicy: File dnsPolicy: ClusterFirst restartPolicy: Always schedulerName: default-scheduler securityContext: {} terminationGracePeriodSeconds: 30
Note: there is no parameter for the number of copies
Create a ds; and look at it and you can see that a copy of the nginx is generated on each node.
[root@k8s-master01] # kubectl create-f nginx-ds.yaml daemonset.apps/nginx created [root@k8s-master01] # kubectl get pod-o wide NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATESbusybox 1 Running 21 (2m45s ago) 8d 172.27.14.193 k8s-node02 nginx-2c7xf 1 Running 0 2m2s 172.25.92.79 k8s-master02 nginx-kjdx8 1/1 Running 0 2m2s 172.25.244.200 k8s-master01 nginx-wwltz 1/1 Running 0 2m2s 172.27.14.199 k8s-node02 nginx-zl2lr 1/1 Running 0 2m2s 172.18.195.19 k8s-master03 nginx-znprg 1/1 Running 0 2m2s 172.17.125.7 k8s-node01
Points to pay attention to:
The restartPolicy field defaults to Always
Daemon Set has no number of copies.
The maximum number of failures needs to be numbered. Recommendation 1
Update policy recommends using OnDelete, leaving the historical version as 1
That's all for "what is the usage scenario of the DaemonSet service daemon?" Thank you for reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.