• Kubernetes-DaemonSet


    1 介绍

      DaemonSet确保创建足够的pod,并在自己的节点上部署每个pod,确保一个pod匹配它的选择器并在每个节点上运行。要在所有集群节点上运行一个pod,就需要创建这样一个DaemonSet对象。
      若节点下线,DaemonSet不会在其他地方重建pod;若一个新节点添加到集群中,DaemonSet会立刻部署一个新的pod实例;若无意中删除一个pod,则会从配置的pod模板创建一个新的pod。

    2 DS使用

    2.1 使用DaemonSet在特定的节点上运行pod

      DaemonSet将pod部署到集群中的所有节点上,除非指定这些pod只在部分节点上运行。通过pod模板中的nodeSelector属性指定。

    2.2 创建DS

    写好yaml文件:

    • 版本号:apiVersion为apps/v1beta2
    • DS定义:kind配置为DaemonSet;
    • DS名字:metadata.name
    • pod选择器:spec.selector中可以使用matchLabels选择器
    • pod模板:spec.template,其中模板中可以包含一个节点选择器,spec.nodeSelector
      DS的yaml文件范例

    by k8s in action

    创建DS命令
    $ kubectl create -f xxx.yaml

    给节点打标签
    $ kubectl label node node_name tag_key=tag_value

    2.3 查看DS

    查看DS
    $ kubectl get ds

  • 相关阅读:
    Epic OA Day2 2014/11/7
    LeetCode day15 2014/11/3
    LeetCode day14 2014/11/2
    Bluetooth BQB PTS(Profile Tuning Suite)
    音频编码:ADPCM
    软件推荐 : USB Over Network
    IOS的BLE蓝牙连接参数限制
    python pyinstaller
    QCC3003x BLE 设置私有地址
    QCC300x UART
  • 原文地址:https://www.cnblogs.com/Andya/p/12434443.html
Copyright © 2020-2023  润新知