blob: 132bf6584926ec494a71e35f09e2e1ec10beeca0 [file] [log] [blame]
Scott Baker2f8fe3a2022-05-09 10:48:16 -07001# SPDX-FileCopyrightText: 2022-present Intel Corporation
Scott Baker9e83ea82021-10-13 08:55:41 -07002# SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org>
3#
Sean Condon160ec1d2022-02-08 12:58:25 +00004# SPDX-License-Identifier: Apache-2.0
Scott Baker9e83ea82021-10-13 08:55:41 -07005
6apiVersion: apps/v1
7kind: Deployment
8metadata:
9 name: {{ template "sdcore-adapter.fullname" . }}
10 namespace: {{ .Release.Namespace }}
11 labels:
12 name: {{ template "sdcore-adapter.fullname" . }}
13spec:
14 replicas: {{ .Values.replicaCount }}
15 selector:
16 matchLabels:
17 {{- include "sdcore-adapter.selectorLabels" . | nindent 6 }}
18 template:
19 metadata:
20 labels:
21 name: {{ template "sdcore-adapter.fullname" . }}
22 {{- include "sdcore-adapter.selectorLabels" . | nindent 8 }}
23 spec:
24 {{- with .Values.imagePullSecrets }}
25 imagePullSecrets:
26 {{- toYaml . | nindent 6 }}
27 {{- end }}
28 securityContext:
29 {{- toYaml .Values.podSecurityContext | nindent 8 }}
30 containers:
31 - name: {{ .Chart.Name }}
32 image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
33 imagePullPolicy: {{ .Values.image.pullPolicy }}
34 env:
35 - name: POD_NAMESPACE
36 valueFrom:
37 fieldRef:
38 fieldPath: metadata.namespace
39 - name: POD_NAME
40 valueFrom:
41 fieldRef:
42 fieldPath: metadata.name
43 - name: NODE_NAME
44 valueFrom:
45 fieldRef:
46 fieldPath: spec.nodeName
47 args:
48 - "/usr/local/bin/sdcore-adapter"
49 - "-bind_address=:{{ .Values.ports.gnmi.secure }}"
50 - "-key=/etc/sdcore-adapter/certs/tls.key"
51 - "-cert=/etc/sdcore-adapter/certs/tls.crt"
52 - "-ca=/etc/sdcore-adapter/certs/tls.cacert"
53 - "-alsologtostderr"
54 - "-hostCheckDisabled"
Scott Bakeraefb9272022-04-18 09:47:47 -070055 {{ if .Values.defaultTarget }}
56 - "-default_target={{ .Values.defaultTarget }}"
Scott Baker9e83ea82021-10-13 08:55:41 -070057 {{ end }}
Scott Baker2bd5bc02021-11-18 13:43:42 -080058 {{ if not .Values.partialUpdateEnabled }}
59 - "-partial_update_disable"
60 {{ end }}
Scott Baker2f8fe3a2022-05-09 10:48:16 -070061 {{ if .Values.kafkaURI }}
62 - "-kafka_uri={{ .Values.kafkaURI }}"
63 {{ end }}
Scott Baker9e83ea82021-10-13 08:55:41 -070064 ports:
65 {{- range $key, $port := .Values.ports.gnmi }}
66 - name: gnmi{{ $key }}
67 containerPort: {{ $port }}
68 {{- end}}
69 readinessProbe:
70 tcpSocket:
71 port: {{ .Values.ports.gnmi.secure }}
72 initialDelaySeconds: 5
73 periodSeconds: 10
74 livenessProbe:
75 tcpSocket:
76 port: {{ .Values.ports.gnmi.secure }}
77 initialDelaySeconds: 15
78 periodSeconds: 20
79 volumeMounts:
Scott Baker9e83ea82021-10-13 08:55:41 -070080 - name: secret
81 mountPath: /etc/sdcore-adapter/certs
82 readOnly: true
83 - name: logconfig
84 mountPath: /etc/onos/config
85 readOnly: true
Scott Baker9e83ea82021-10-13 08:55:41 -070086 volumes:
87 - name: logconfig
88 configMap:
Scott Bakeraefb9272022-04-18 09:47:47 -070089 name: {{ template "sdcore-adapter.fullname" . }}-logconfig
Scott Baker9e83ea82021-10-13 08:55:41 -070090 - name: secret
91 secret:
92 secretName: {{ template "sdcore-adapter.fullname" . }}-secret