blob: 55e90ff8879b97b0c97b17b2b48f977811e40627 [file] [log] [blame]
Yi Tseng32561422021-10-07 15:03:21 -07001
2# Copyright 2020-present Open Networking Foundation
Charles Chand1b4bf92022-02-02 16:27:10 -08003# SPDX-License-Identifier: Apache-2.0
Yi Tseng32561422021-10-07 15:03:21 -07004
5apiVersion: apps/v1
6kind: Deployment
7metadata:
8 name: {{ include "dbuf.fullname" . }}
9 labels:
10 {{- include "dbuf.labels" . | nindent 4 }}
11spec:
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:
25 {{- if hasKey .Values.image "pullSecrets" }}
26 imagePullSecrets:
27 {{- range .Values.image.pullSecrets }}
28 - name: {{ . | quote }}
29 {{- end }}
30 {{- end }}
31 securityContext:
32 {{- toYaml .Values.podSecurityContext | nindent 8 }}
33 containers:
34 - name: {{ .Chart.Name }}
35 securityContext:
36 {{- toYaml .Values.securityContext | nindent 12 }}
37 image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
38 imagePullPolicy: {{ .Values.image.pullPolicy }}
39 command: [ "dbuf", {{ template "extraParams" .Values.extraParams }} ]
40 resources:
41 requests:
42 intel.com/{{ .Values.sriovResourceName }}: '{{ .Values.sriovNICSize }}'
43 limits:
44 intel.com/{{ .Values.sriovResourceName }}: '{{ .Values.sriovNICSize }}'
45 ports:
46 - name: grpc
47 containerPort: 10000
48 protocol: {{ .Values.service.grpc.protocol }}
49 - name: exporter
50 containerPort: 8080
51 protocol: {{ .Values.service.stats.protocol }}
52 # Push data plane address to ONOS via netcfgc
53 # Add the static route for sr-iov interface
54 - name: config
55 image: curlimages/curl:7.75.0
56 imagePullPolicy: IfNotPresent
57 env:
58 - name: NAMESPACE
59 valueFrom:
60 fieldRef:
61 fieldPath: metadata.namespace
62 - name: ONOS_SERVER
63 value: "{{ .Values.onos.server }}"
64 - name: ONOS_PORT
65 value: "{{ .Values.onos.port }}"
66 - name: ONOS_USERNAME
67 value: "{{ .Values.onos.username }}"
68 - name: ONOS_PASSWORD
69 value: "{{ .Values.onos.password }}"
70 - name: GRPC_SERVICE_NAME
71 value: {{ include "dbuf.fullname" . }}
72 - name: GRPC_PORT
73 value: "{{ .Values.service.grpc.port }}"
74 - name: DP_INTERFACE
75 value: "{{ .Values.dataplane.interface }}"
76 - name: DP_PORT
77 value: "{{ .Values.dataplane.port }}"
78 - name: STATIC_ROUTES
79 value: "{{ .Values.network.route }}"
80 volumeMounts:
81 - name: config-script
82 mountPath: /tmp/config
83 subPath: config
84 command: ["sh", "-c", "/tmp/config"]
85 securityContext:
86 runAsUser: 0
87 capabilities:
88 add: ["NET_ADMIN"]
89 {{- with .Values.nodeSelector }}
90 nodeSelector:
91 {{- toYaml . | nindent 8 }}
92 {{- end }}
93 {{- with .Values.affinity }}
94 affinity:
95 {{- toYaml . | nindent 8 }}
96 {{- end }}
97 {{- with .Values.tolerations }}
98 tolerations:
99 {{- toYaml . | nindent 8 }}
100 {{- end }}
101 volumes:
102 - name: config-script
103 configMap:
104 name: {{ include "dbuf.fullname" . }}
105 defaultMode: 0755