Scott Baker | 2f8fe3a | 2022-05-09 10:48:16 -0700 | [diff] [blame] | 1 | # SPDX-FileCopyrightText: 2022-present Intel Corporation |
Scott Baker | 9e83ea8 | 2021-10-13 08:55:41 -0700 | [diff] [blame] | 2 | # SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org> |
| 3 | # |
Sean Condon | 160ec1d | 2022-02-08 12:58:25 +0000 | [diff] [blame] | 4 | # SPDX-License-Identifier: Apache-2.0 |
Scott Baker | 9e83ea8 | 2021-10-13 08:55:41 -0700 | [diff] [blame] | 5 | |
| 6 | apiVersion: apps/v1 |
| 7 | kind: Deployment |
| 8 | metadata: |
| 9 | name: {{ template "sdcore-adapter.fullname" . }} |
| 10 | namespace: {{ .Release.Namespace }} |
| 11 | labels: |
| 12 | name: {{ template "sdcore-adapter.fullname" . }} |
| 13 | spec: |
| 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 Baker | aefb927 | 2022-04-18 09:47:47 -0700 | [diff] [blame] | 55 | {{ if .Values.defaultTarget }} |
| 56 | - "-default_target={{ .Values.defaultTarget }}" |
Scott Baker | 9e83ea8 | 2021-10-13 08:55:41 -0700 | [diff] [blame] | 57 | {{ end }} |
Scott Baker | 2bd5bc0 | 2021-11-18 13:43:42 -0800 | [diff] [blame] | 58 | {{ if not .Values.partialUpdateEnabled }} |
| 59 | - "-partial_update_disable" |
| 60 | {{ end }} |
Scott Baker | 2f8fe3a | 2022-05-09 10:48:16 -0700 | [diff] [blame] | 61 | {{ if .Values.kafkaURI }} |
| 62 | - "-kafka_uri={{ .Values.kafkaURI }}" |
| 63 | {{ end }} |
Scott Baker | 9e83ea8 | 2021-10-13 08:55:41 -0700 | [diff] [blame] | 64 | 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 Baker | 9e83ea8 | 2021-10-13 08:55:41 -0700 | [diff] [blame] | 80 | - name: secret |
| 81 | mountPath: /etc/sdcore-adapter/certs |
| 82 | readOnly: true |
| 83 | - name: logconfig |
| 84 | mountPath: /etc/onos/config |
| 85 | readOnly: true |
Scott Baker | 9e83ea8 | 2021-10-13 08:55:41 -0700 | [diff] [blame] | 86 | volumes: |
| 87 | - name: logconfig |
| 88 | configMap: |
Scott Baker | aefb927 | 2022-04-18 09:47:47 -0700 | [diff] [blame] | 89 | name: {{ template "sdcore-adapter.fullname" . }}-logconfig |
Scott Baker | 9e83ea8 | 2021-10-13 08:55:41 -0700 | [diff] [blame] | 90 | - name: secret |
| 91 | secret: |
| 92 | secretName: {{ template "sdcore-adapter.fullname" . }}-secret |