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