aboutsummaryrefslogtreecommitdiffstats
path: root/kud/deployment_infra/helm/multus-cni/templates/daemonset.yaml
blob: 551d6db639e93bd2dc0e4d201e86b05a7ae7922b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: {{ include "multus.fullname" . }}-ds
  labels:
    {{- include "multus.labels" . | nindent 4 }}
    tier: node
spec:
  selector:
    matchLabels:
      {{- include "multus.selectorLabels" . | nindent 6 }}
  updateStrategy:
    type: RollingUpdate
  template:
    metadata:
      labels:
        {{- include "multus.selectorLabels" . | nindent 8 }}
        tier: node
    spec:
      {{- with .Values.imagePullSecrets }}
      imagePullSecrets:
        {{- toYaml . | nindent 8 }}
      {{- end }}
      hostNetwork: true
      {{- with .Values.nodeSelector }}
      nodeSelector:
        {{- toYaml . | nindent 8 }}
      {{- end }}
      {{- with .Values.tolerations }}
      tolerations:
        {{- toYaml . | nindent 6 }}
      {{- end }}
      serviceAccountName: {{ include "multus.serviceAccountName" . }}
      containers:
      - name: kube-multus
        image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
        imagePullPolicy: {{ .Values.image.pullPolicy }}
        env:
        - name: KUBERNETES_NODE_NAME
          valueFrom:
            fieldRef:
              fieldPath: spec.nodeName
        command:
        {{- if .Values.config.enabled }}
        - /bin/bash
        - -cex
        - |
          #!/bin/bash
          sed "s|__KUBERNETES_NODE_NAME__|${KUBERNETES_NODE_NAME}|g" /tmp/multus-conf/{{ .Values.config.path }}.template > /tmp/{{ .Values.config.path }}
          /entrypoint.sh --multus-conf-file=/tmp/{{ .Values.config.path }}
        {{- else }}
        - /entrypoint.sh
        - "--multus-conf-file=auto"
        - "--cni-version=0.3.1"
        {{- end }}
        lifecycle:
          preStop:
            exec:
              command: ["/bin/bash", "-c", "rm /host/etc/cni/net.d/*-multus.conf"]
        resources:
          {{- toYaml .Values.resources | nindent 10 }}
        securityContext:
          {{- toYaml .Values.securityContext | nindent 10 }}
        volumeMounts:
        - name: cni
          mountPath: /host/etc/cni/net.d
        - name: cnibin
          mountPath: /host/opt/cni/bin
        - name: multus-cfg
          mountPath: /tmp/multus-conf
      volumes:
        - name: cni
          hostPath:
            path: /etc/cni/net.d
        - name: cnibin
          hostPath:
            path: /opt/cni/bin
        - name: multus-cfg
          configMap:
            name: {{ .Values.config.name }}
            items:
            - key: cni-conf.json
              path: {{ .Values.config.path }}.template