blob: f74c8b13a8acd3bce0832744037438c1489e4e9d [file] [log] [blame]
Scott Bakere35e6832022-01-10 15:48:08 -08001# SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org>
2#
Sean Condon160ec1d2022-02-08 12:58:25 +00003# SPDX-License-Identifier: Apache-2.0
Scott Bakere35e6832022-01-10 15:48:08 -08004
5apiVersion: apps/v1
6kind: Deployment
7metadata:
8 name: {{ template "sdcore-adapter.fullname" . }}
9 namespace: {{ .Release.Namespace }}
10 labels:
11 name: {{ template "sdcore-adapter.fullname" . }}
12spec:
13 replicas: {{ .Values.replicaCount }}
14 selector:
15 matchLabels:
16 {{- include "sdcore-adapter.selectorLabels" . | nindent 6 }}
17 template:
18 metadata:
19 labels:
20 name: {{ template "sdcore-adapter.fullname" . }}
21 {{- include "sdcore-adapter.selectorLabels" . | nindent 8 }}
22 spec:
23 {{- with .Values.imagePullSecrets }}
24 imagePullSecrets:
25 {{- toYaml . | nindent 6 }}
26 {{- end }}
27 securityContext:
28 {{- toYaml .Values.podSecurityContext | nindent 8 }}
29 containers:
30 - name: {{ .Chart.Name }}
31 image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
32 imagePullPolicy: {{ .Values.image.pullPolicy }}
33 env:
34 - name: POD_NAMESPACE
35 valueFrom:
36 fieldRef:
37 fieldPath: metadata.namespace
38 - name: POD_NAME
39 valueFrom:
40 fieldRef:
41 fieldPath: metadata.name
42 - name: NODE_NAME
43 valueFrom:
44 fieldRef:
45 fieldPath: spec.nodeName
46 args:
47 - "/usr/local/bin/sdcore-adapter"
48 - "-bind_address=:{{ .Values.ports.gnmi.secure }}"
49 - "-key=/etc/sdcore-adapter/certs/tls.key"
50 - "-cert=/etc/sdcore-adapter/certs/tls.crt"
51 - "-ca=/etc/sdcore-adapter/certs/tls.cacert"
52 - "-alsologtostderr"
53 - "-hostCheckDisabled"
54 {{ if .Values.initialConfig }}
55 - "-config={{ .Values.initialConfig }}"
56 {{ end }}
57 {{ if .Values.output }}
58 - "-output={{ .Values.output }}"
59 {{ end }}
60 {{ if .Values.spgwEndpoint }}
61 - "-spgw_endpoint={{ .Values.spgwEndpoint }}"
62 {{ end }}
63 {{ if not .Values.partialUpdateEnabled }}
64 - "-partial_update_disable"
65 {{ end }}
66 ports:
67 {{- range $key, $port := .Values.ports.gnmi }}
68 - name: gnmi{{ $key }}
69 containerPort: {{ $port }}
70 {{- end}}
71 readinessProbe:
72 tcpSocket:
73 port: {{ .Values.ports.gnmi.secure }}
74 initialDelaySeconds: 5
75 periodSeconds: 10
76 livenessProbe:
77 tcpSocket:
78 port: {{ .Values.ports.gnmi.secure }}
79 initialDelaySeconds: 15
80 periodSeconds: 20
81 volumeMounts:
82 - name: targetconfig
83 mountPath: /etc/sdcore-adapter/configs
84 readOnly: true
85 - name: secret
86 mountPath: /etc/sdcore-adapter/certs
87 readOnly: true
88 - name: logconfig
89 mountPath: /etc/onos/config
90 readOnly: true
91 volumes:
92 - name: logconfig
93 configMap:
94 name: {{ template "sdcore-adapter.fullname" . }}-logconfig
95 - name: targetconfig
96 configMap:
97 name: {{ template "sdcore-adapter.fullname" . }}-targetconfig
98 - name: secret
99 secret:
100 secretName: {{ template "sdcore-adapter.fullname" . }}-secret