Scott Baker | 9e83ea8 | 2021-10-13 08:55:41 -0700 | [diff] [blame] | 1 | # SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org> |
| 2 | # |
| 3 | # SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0 |
| 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 | 9e83ea8 | 2021-10-13 08:55:41 -0700 | [diff] [blame] | 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 }} |
Scott Baker | 2bd5bc0 | 2021-11-18 13:43:42 -0800 | [diff] [blame] | 63 | {{ if not .Values.partialUpdateEnabled }} |
| 64 | - "-partial_update_disable" |
| 65 | {{ end }} |
Scott Baker | 9e83ea8 | 2021-10-13 08:55:41 -0700 | [diff] [blame] | 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 |
Scott Baker | 9e83ea8 | 2021-10-13 08:55:41 -0700 | [diff] [blame] | 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 |