Yi Tseng | 1765789 | 2021-10-11 16:04:59 -0700 | [diff] [blame] | 1 | # Copyright 2021-present Open Networking Foundation |
Charles Chan | d1b4bf9 | 2022-02-02 16:27:10 -0800 | [diff] [blame] | 2 | # SPDX-License-Identifier: Apache-2.0 |
Yi Tseng | 1765789 | 2021-10-11 16:04:59 -0700 | [diff] [blame] | 3 | --- |
| 4 | apiVersion: apps/v1 |
| 5 | kind: DaemonSet |
| 6 | metadata: |
| 7 | name: {{ template "int-host-reporter.fullname" . }} |
| 8 | namespace: {{ .Release.Namespace }} |
| 9 | labels: |
| 10 | k8s-app: {{ template "int-host-reporter.fullname" . }} |
| 11 | spec: |
| 12 | selector: |
| 13 | matchLabels: |
| 14 | name: {{ template "int-host-reporter.fullname" . }} |
| 15 | template: |
| 16 | metadata: |
| 17 | labels: |
| 18 | name: {{ template "int-host-reporter.fullname" . }} |
| 19 | spec: |
| 20 | nodeSelector: |
| 21 | kubernetes.io/os: linux |
| 22 | hostNetwork: true |
| 23 | {{- if .Values.image.pullSecrets }} |
| 24 | imagePullSecrets: |
| 25 | {{- range .Values.image.pullSecrets }} |
| 26 | - name: {{ . | quote }} |
| 27 | {{- end }} |
| 28 | {{- end }} |
| 29 | containers: |
| 30 | - name: {{ template "int-host-reporter.fullname" . }} |
| 31 | image: {{ .Values.image.repository }}:{{ .Values.image.tag }} |
| 32 | imagePullPolicy: {{ .Values.image.pullPolicy }} |
| 33 | env: |
| 34 | - name: CNI |
| 35 | value: "{{ .Values.cni }}" |
| 36 | - name: DATA_INTERFACE |
| 37 | value: "{{ .Values.dataInterface }}" |
| 38 | - name: COLLECTOR |
| 39 | value: "{{ .Values.intCollector }}" |
| 40 | # we use Node IP as switch ID |
| 41 | - name: NODE_IP |
| 42 | valueFrom: |
| 43 | fieldRef: |
| 44 | fieldPath: status.hostIP |
| 45 | command: |
| 46 | - "int-host-reporter" |
| 47 | args: |
| 48 | - "--cni" |
| 49 | - "$(CNI)" |
| 50 | - "--data-interface" |
| 51 | - "$(DATA_INTERFACE)" |
| 52 | - "--collector" |
| 53 | - "$(COLLECTOR)" |
| 54 | - "--switch-id" |
| 55 | - "$(NODE_IP)" |
| 56 | - "-f" |
| 57 | - "/etc/watchlist/watchlist.yaml" |
| 58 | volumeMounts: |
| 59 | - name: bpffs |
| 60 | mountPath: /sys/fs/bpf |
| 61 | - name: int-watchlist |
| 62 | mountPath: /etc/watchlist/watchlist.yaml |
| 63 | subPath: watchlist.yaml |
| 64 | securityContext: |
| 65 | privileged: true |
| 66 | capabilities: |
| 67 | add: |
| 68 | - "NET_ADMIN" |
| 69 | - "NET_RAW" |
| 70 | volumes: |
| 71 | - name: bpffs |
| 72 | hostPath: |
| 73 | path: /sys/fs/bpf |
| 74 | - name: int-watchlist |
| 75 | configMap: |
| 76 | name: int-watchlist |