summaryrefslogtreecommitdiffstats
path: root/kud/deployment_infra/helm/ovn4nfv/templates/daemonset.yaml
blob: aeecb797cdde25de8709a9b58d5a088b1c9a7b86 (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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: {{ include "ovn4nfv.fullname" . }}-cni
  labels:
    {{- include "ovn4nfv.labels" . | nindent 4 }}
    role: cni
spec:
  updateStrategy:
    type: RollingUpdate
  selector:
    matchLabels:
      {{- include "ovn4nfv.selectorLabels" . | nindent 6 }}
      role: cni
  template:
    metadata:
      labels:
        {{- include "ovn4nfv.selectorLabels" . | nindent 8 }}
        role: cni
    spec:
      {{- with .Values.imagePullSecrets }}
      imagePullSecrets:
        {{- toYaml . | nindent 8 }}
      {{- end }}
      hostNetwork: true
      {{- with .Values.cni.nodeSelector }}
      nodeSelector:
        {{- toYaml . | nindent 8 }}
      {{- end }}
      {{- with .Values.cni.tolerations }}
      tolerations:
        {{- toYaml . | nindent 6 }}
      {{- end }}
      serviceAccountName: {{ include "ovn4nfv.serviceAccountName" . }}
      containers:
      - name: ovn4nfv
        image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
        imagePullPolicy: {{ .Values.image.pullPolicy }}
        command: ["/usr/local/bin/entrypoint", "cni"]
        lifecycle:
          preStop:
            exec:
              command: ["/bin/bash", "-c", "rm /host/etc/cni/net.d/00-network.conf"]
        resources:
          {{- toYaml .Values.cni.resources | nindent 10 }}
        securityContext:
          {{- toYaml .Values.cni.securityContext | nindent 10 }}
        volumeMounts:
        - name: cni
          mountPath: /host/etc/cni/net.d
        - name: cnibin
          mountPath: /host/opt/cni/bin
        - name: cniconf
          mountPath: /host/etc/openvswitch
        - name: ovn4nfv-cfg
          mountPath: /tmp/ovn4nfv-conf
        - name: ovn4nfv-cni-net-conf
          mountPath: /tmp/ovn4nfv-cni
      volumes:
        - name: cni
          hostPath:
            path: /etc/cni/net.d
        - name: cnibin
          hostPath:
            path: /opt/cni/bin
        - name: cniconf
          hostPath:
            path: /etc/openvswitch
        - name: ovn4nfv-cfg
          configMap:
            name: {{ .Values.cni.config.name }}
            items:
            - key: ovn4nfv_k8s.conf
              path: ovn4nfv_k8s.conf
        - name: ovn4nfv-cni-net-conf
          configMap:
            name: {{ .Values.cni.config.name }}
            items:
            - key: 00-network.conf
              path: 00-network.conf
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: {{ include "ovn4nfv.fullname" . }}-nfn-agent
  labels:
    {{- include "ovn4nfv.labels" . | nindent 4 }}
    role: nfn-agent
spec:
  selector:
    matchLabels:
      {{- include "ovn4nfv.selectorLabels" . | nindent 6 }}
      role: nfn-agent
  updateStrategy:
    type: RollingUpdate
  template:
    metadata:
      labels:
        {{- include "ovn4nfv.selectorLabels" . | nindent 8 }}
        role: nfn-agent
    spec:
      {{- with .Values.imagePullSecrets }}
      imagePullSecrets:
        {{- toYaml . | nindent 8 }}
      {{- end }}
      hostNetwork: true
      hostPID: true
      {{- with .Values.nfnAgent.nodeSelector }}
      nodeSelector:
        {{- toYaml . | nindent 8 }}
      {{- end }}
      {{- with .Values.nfnAgent.tolerations }}
      tolerations:
        {{- toYaml . | nindent 6 }}
      {{- end }}
      serviceAccountName: {{ include "ovn4nfv.serviceAccountName" . }}
      containers:
      - name: nfn-agent
        image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
        imagePullPolicy: {{ .Values.image.pullPolicy }}
        command: ["/usr/local/bin/entrypoint", "agent"]
        resources:
          {{- toYaml .Values.nfnAgent.resources | nindent 10 }}
        env:
          - name: NFN_NODE_NAME
            valueFrom:
              fieldRef:
                fieldPath: spec.nodeName
        securityContext:
          {{- toYaml .Values.nfnAgent.securityContext | nindent 10 }}
        volumeMounts:
        - mountPath: /var/run/dbus/
          name: host-var-run-dbus
          readOnly: true
        - mountPath: /run/openvswitch
          name: host-run-ovs
        - mountPath: /var/run/openvswitch
          name: host-var-run-ovs
        - mountPath: /var/run
          name: host-var-run
          mountPropagation: Bidirectional
        - mountPath: /host/proc
          name: host-proc
        - mountPath: /host/sys
          name: host-sys
        - mountPath: /var/run/ovn4nfv-k8s-plugin
          name: host-var-cniserver-socket-dir
      volumes:
      - name: host-run-ovs
        hostPath:
          path: /run/openvswitch
      - name: host-var-run-ovs
        hostPath:
          path: /var/run/openvswitch
      - name: host-var-run-dbus
        hostPath:
          path: /var/run/dbus
      - name: host-var-cniserver-socket-dir
        hostPath:
          path: /var/run/ovn4nfv-k8s-plugin
      - name: host-var-run
        hostPath:
          path: /var/run
      - name: host-proc
        hostPath:
          path: /proc
      - name: host-sys
        hostPath:
          path: /sys