blob: e85f2e1a431c5b7ffea5d9675889049e5da3cdf4 [file] [log] [blame]
Scott Baker9e83ea82021-10-13 08:55:41 -07001# 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 Baker9e83ea82021-10-13 08:55:41 -07004
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"
Scott Bakeraefb9272022-04-18 09:47:47 -070054 {{ if .Values.defaultTarget }}
55 - "-default_target={{ .Values.defaultTarget }}"
Scott Baker9e83ea82021-10-13 08:55:41 -070056 {{ end }}
Scott Baker2bd5bc02021-11-18 13:43:42 -080057 {{ if not .Values.partialUpdateEnabled }}
58 - "-partial_update_disable"
59 {{ end }}
Scott Baker9e83ea82021-10-13 08:55:41 -070060 ports:
61 {{- range $key, $port := .Values.ports.gnmi }}
62 - name: gnmi{{ $key }}
63 containerPort: {{ $port }}
64 {{- end}}
65 readinessProbe:
66 tcpSocket:
67 port: {{ .Values.ports.gnmi.secure }}
68 initialDelaySeconds: 5
69 periodSeconds: 10
70 livenessProbe:
71 tcpSocket:
72 port: {{ .Values.ports.gnmi.secure }}
73 initialDelaySeconds: 15
74 periodSeconds: 20
75 volumeMounts:
Scott Baker9e83ea82021-10-13 08:55:41 -070076 - name: secret
77 mountPath: /etc/sdcore-adapter/certs
78 readOnly: true
79 - name: logconfig
80 mountPath: /etc/onos/config
81 readOnly: true
Scott Baker9e83ea82021-10-13 08:55:41 -070082 volumes:
83 - name: logconfig
84 configMap:
Scott Bakeraefb9272022-04-18 09:47:47 -070085 name: {{ template "sdcore-adapter.fullname" . }}-logconfig
Scott Baker9e83ea82021-10-13 08:55:41 -070086 - name: secret
87 secret:
88 secretName: {{ template "sdcore-adapter.fullname" . }}-secret