Scott Baker | e3090f0 | 2022-05-31 15:51:41 -0700 | [diff] [blame] | 1 | # SPDX-FileCopyrightText: 2022-present Intel Corporation |
| 2 | # SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org> |
| 3 | # |
| 4 | # SPDX-License-Identifier: Apache-2.0 |
| 5 | |
| 6 | apiVersion: apps/v1 |
| 7 | kind: Deployment |
| 8 | metadata: |
| 9 | name: {{ template "fabric-adapter.fullname" . }} |
| 10 | namespace: {{ .Release.Namespace }} |
| 11 | labels: |
| 12 | name: {{ template "fabric-adapter.fullname" . }} |
| 13 | spec: |
| 14 | replicas: {{ .Values.replicaCount }} |
| 15 | selector: |
| 16 | matchLabels: |
| 17 | {{- include "fabric-adapter.selectorLabels" . | nindent 6 }} |
| 18 | template: |
| 19 | metadata: |
| 20 | labels: |
| 21 | name: {{ template "fabric-adapter.fullname" . }} |
| 22 | {{- include "fabric-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/fabric-adapter" |
| 49 | - "-bind_address=:{{ .Values.ports.gnmi.secure }}" |
| 50 | - "-key=/etc/fabric-adapter/certs/tls.key" |
| 51 | - "-cert=/etc/fabric-adapter/certs/tls.crt" |
| 52 | - "-ca=/etc/fabric-adapter/certs/tls.cacert" |
| 53 | - "-alsologtostderr" |
| 54 | - "-hostCheckDisabled" |
| 55 | {{ if .Values.defaultTarget }} |
| 56 | - "-default_target={{ .Values.defaultTarget }}" |
| 57 | {{ end }} |
| 58 | {{ if not .Values.partialUpdateEnabled }} |
| 59 | - "-partial_update_disable" |
| 60 | {{ end }} |
| 61 | {{ if .Values.kafkaURI }} |
| 62 | - "-kafka_uri={{ .Values.kafkaURI }}" |
| 63 | {{ end }} |
| 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: |
| 80 | - name: secret |
| 81 | mountPath: /etc/fabric-adapter/certs |
| 82 | readOnly: true |
| 83 | - name: logconfig |
| 84 | mountPath: /etc/onos/config |
| 85 | readOnly: true |
| 86 | volumes: |
| 87 | - name: logconfig |
| 88 | configMap: |
| 89 | name: {{ template "fabric-adapter.fullname" . }}-logconfig |
| 90 | - name: secret |
| 91 | secret: |
| 92 | secretName: {{ template "fabric-adapter.fullname" . }}-secret |