kubernetes -- helm charts 开发: 2、 编写daemonset

本文详细介绍了如何使用Helm Charts来编写和管理Kubernetes DaemonSet,包括必须字段、Pod Selector、nodeSelector的设置,以及如何调度、通信、更新DaemonSet,并提供了一个ceilometer-compute的DaemonSet实例。
摘要由CSDN通过智能技术生成

1 概要介绍

DaemonSet:
特点:
确保全部Node上运行一个Pod副本(单副本)
Node加入集群,则新增Pod;移除,则回收
删除Daemonset,删除创建的Pod

2编写

2.1 必须字段

apiVersion:
可用值: extensions/v1beta1
kind :
可用值:DaemonSet
metadata:
例如:name: nova-compute
.spec:
唯一必须的字段:
.spec.template
例如:
    metadata:
      labels:
{ { tuple $envAll .Chart.Name $daemonset | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
      annotations:
        configmap-bin-hash: { { tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }}

.spec.template:
含义:是Pod模板。Pod有明确的格式。Pod中必须指明标签合重启策略,默认always。
具体参见:
https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#pod-template


2.2 Pod Selector

.spec.selector:
表示Pod Selector.是对象,包含:
matchLabels:
matchEx[ressions:

终于发现不能运行的原因:
zabbix-damonset:
{ { tuple $envAll "zabbix_agent" | include "helm-toolkit.snippets.kubernetes_upgrades_daemonset" | indent 2 }}

nova-daemonset:
{ { tuple $envAll $daemonset | include "helm-toolkit.snippets.kubernetes_upgrades_daemonset" | indent 2 }}

ceilometer现在写的是:
{ { tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }}

如果指定spec.selector必须和.spec.template.metadata.labels
匹配,目前没有发现spec.selector

2.3 .spec.template.spec.nodeSelector

如果指定.spec.template.spec.nodeSelector,则Daemonset Controller将在能够匹配上Node Selector的Node上创建Pod,在能够匹配上的Node Affinity的N

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值