pudelkoM | 3f0efb1 | 2021-01-12 13:55:48 -0800 | [diff] [blame] | 1 | |
| 2 | # Copyright 2020-present Open Networking Foundation |
| 3 | # SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0 |
| 4 | |
| 5 | apiVersion: apps/v1 |
| 6 | kind: Deployment |
| 7 | metadata: |
| 8 | name: {{ include "dbuf.fullname" . }} |
| 9 | labels: |
| 10 | {{- include "dbuf.labels" . | nindent 4 }} |
| 11 | spec: |
| 12 | replicas: {{ .Values.replicaCount }} |
| 13 | selector: |
| 14 | matchLabels: |
| 15 | {{- include "dbuf.selectorLabels" . | nindent 6 }} |
| 16 | template: |
| 17 | metadata: |
| 18 | {{- with .Values.podAnnotations }} |
| 19 | annotations: |
| 20 | {{- toYaml . | nindent 8 }} |
| 21 | {{- end }} |
| 22 | labels: |
| 23 | {{- include "dbuf.selectorLabels" . | nindent 8 }} |
| 24 | spec: |
Hung-Wei Chiu | e6541c7 | 2021-05-11 19:23:54 -0700 | [diff] [blame] | 25 | {{- if hasKey .Values.image "pullSecrets" }} |
pudelkoM | 3f0efb1 | 2021-01-12 13:55:48 -0800 | [diff] [blame] | 26 | imagePullSecrets: |
Hung-Wei Chiu | e6541c7 | 2021-05-11 19:23:54 -0700 | [diff] [blame] | 27 | {{ toYaml .Values.image.pullSecrets | indent 8 }} |
| 28 | {{- end }} |
pudelkoM | 3f0efb1 | 2021-01-12 13:55:48 -0800 | [diff] [blame] | 29 | securityContext: |
| 30 | {{- toYaml .Values.podSecurityContext | nindent 8 }} |
| 31 | containers: |
| 32 | - name: {{ .Chart.Name }} |
| 33 | securityContext: |
| 34 | {{- toYaml .Values.securityContext | nindent 12 }} |
| 35 | image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" |
| 36 | imagePullPolicy: {{ .Values.image.pullPolicy }} |
| 37 | command: [ "dbuf", {{ template "extraParams" .Values.extraParams }} ] |
| 38 | resources: |
| 39 | requests: |
| 40 | intel.com/{{ .Values.sriovResourceName }}: '{{ .Values.sriovNICSize }}' |
| 41 | limits: |
| 42 | intel.com/{{ .Values.sriovResourceName }}: '{{ .Values.sriovNICSize }}' |
| 43 | ports: |
| 44 | - name: grpc |
| 45 | containerPort: 10000 |
Hung-Wei Chiu | 9de579b | 2021-02-03 12:39:22 -0800 | [diff] [blame] | 46 | protocol: {{ .Values.service.grpc.protocol }} |
| 47 | - name: exporter |
pudelkoM | 3f0efb1 | 2021-01-12 13:55:48 -0800 | [diff] [blame] | 48 | containerPort: 8080 |
Hung-Wei Chiu | 9de579b | 2021-02-03 12:39:22 -0800 | [diff] [blame] | 49 | protocol: {{ .Values.service.stats.protocol }} |
Hung-Wei Chiu | 3713e56 | 2021-02-17 14:14:35 -0800 | [diff] [blame] | 50 | # Push data plane address to ONOS via netcfgc |
Hung-Wei Chiu | 8bc0756 | 2021-02-24 18:19:36 -0800 | [diff] [blame] | 51 | # Add the static route for sr-iov interface |
| 52 | - name: config |
Hung-Wei Chiu | 3713e56 | 2021-02-17 14:14:35 -0800 | [diff] [blame] | 53 | image: curlimages/curl:7.75.0 |
| 54 | imagePullPolicy: IfNotPresent |
| 55 | env: |
| 56 | - name: NAMESPACE |
| 57 | valueFrom: |
| 58 | fieldRef: |
| 59 | fieldPath: metadata.namespace |
| 60 | - name: ONOS_SERVER |
| 61 | value: "{{ .Values.onos.server }}" |
| 62 | - name: ONOS_PORT |
| 63 | value: "{{ .Values.onos.port }}" |
| 64 | - name: ONOS_USERNAME |
| 65 | value: "{{ .Values.onos.username }}" |
| 66 | - name: ONOS_PASSWORD |
| 67 | value: "{{ .Values.onos.password }}" |
| 68 | - name: GRPC_SERVICE_NAME |
| 69 | value: {{ include "dbuf.fullname" . }} |
| 70 | - name: GRPC_PORT |
| 71 | value: "{{ .Values.service.grpc.port }}" |
| 72 | - name: DP_INTERFACE |
| 73 | value: "{{ .Values.dataplane.interface }}" |
| 74 | - name: DP_PORT |
| 75 | value: "{{ .Values.dataplane.port }}" |
Hung-Wei Chiu | 8bc0756 | 2021-02-24 18:19:36 -0800 | [diff] [blame] | 76 | - name: STATIC_ROUTES |
| 77 | value: "{{ .Values.network.route }}" |
Hung-Wei Chiu | 3713e56 | 2021-02-17 14:14:35 -0800 | [diff] [blame] | 78 | volumeMounts: |
Hung-Wei Chiu | 8bc0756 | 2021-02-24 18:19:36 -0800 | [diff] [blame] | 79 | - name: config-script |
| 80 | mountPath: /tmp/config |
| 81 | subPath: config |
| 82 | command: ["sh", "-c", "/tmp/config"] |
| 83 | securityContext: |
| 84 | runAsUser: 0 |
| 85 | capabilities: |
| 86 | add: ["NET_ADMIN"] |
pudelkoM | 3f0efb1 | 2021-01-12 13:55:48 -0800 | [diff] [blame] | 87 | {{- with .Values.nodeSelector }} |
| 88 | nodeSelector: |
| 89 | {{- toYaml . | nindent 8 }} |
| 90 | {{- end }} |
| 91 | {{- with .Values.affinity }} |
| 92 | affinity: |
| 93 | {{- toYaml . | nindent 8 }} |
| 94 | {{- end }} |
| 95 | {{- with .Values.tolerations }} |
| 96 | tolerations: |
| 97 | {{- toYaml . | nindent 8 }} |
| 98 | {{- end }} |
Hung-Wei Chiu | 3713e56 | 2021-02-17 14:14:35 -0800 | [diff] [blame] | 99 | volumes: |
Hung-Wei Chiu | 8bc0756 | 2021-02-24 18:19:36 -0800 | [diff] [blame] | 100 | - name: config-script |
Hung-Wei Chiu | 3713e56 | 2021-02-17 14:14:35 -0800 | [diff] [blame] | 101 | configMap: |
| 102 | name: {{ include "dbuf.fullname" . }} |
| 103 | defaultMode: 0755 |