DaemonSet控制器会在每个节点上运行单一的副本,他非常适合部署那些节点本身提供服务或者执行维护的 Pod

例如 :

  1. 存储相关,每个节点上运行glusterd, ceph
  2. 日志收集相关,每个节点上运行Fluentd, logstash
  3. 监控相关, Prometheus Node Exporter

新增node到集群,会自动增加一个DaemonSet Pod
举例

[root@master01]# cat daemonset-nginx.yaml
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: mydaemonset-nginx
spec:
  selector:
    matchLabels:
      apps: nginx
  updateStrategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 1
  template:
    metadata:
      labels:
        apps: nginx
    spec:
      containers:
      - name: mydaemonset-nginx-containers
        image: nginx:1.18
        imagePullPolicy: Always
        ports:
        - containerPort: 80
          hostPort: 84
          protocol: TCP


[root@master01 klaus]#

DaemonSet的更新方式
1)RollingUpdate -- 只有maxUnavailable可以设置,没有maxSurge
2) OnDelete --只有手动删除旧的DaemonSet Pod,才会更新新的Pod

相关文章:

  • 2022-12-23
  • 2023-02-08
  • 2022-12-23
  • 2021-09-09
  • 1970-01-01
  • 2021-06-24
  • 2021-10-22
  • 2022-12-23
猜你喜欢
  • 2021-12-23
  • 2021-08-03
  • 2021-10-25
  • 2022-12-23
  • 2022-12-23
  • 2021-12-23
  • 2021-09-30
相关资源
相似解决方案