| # SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org> |
| # |
| # SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0 |
| |
| apiVersion: apps/v1 |
| kind: Deployment |
| metadata: |
| name: {{ template "sdcore-adapter.fullname" . }} |
| namespace: {{ .Release.Namespace }} |
| labels: |
| name: {{ template "sdcore-adapter.fullname" . }} |
| spec: |
| replicas: {{ .Values.replicaCount }} |
| selector: |
| matchLabels: |
| {{- include "sdcore-adapter.selectorLabels" . | nindent 6 }} |
| template: |
| metadata: |
| labels: |
| name: {{ template "sdcore-adapter.fullname" . }} |
| {{- include "sdcore-adapter.selectorLabels" . | nindent 8 }} |
| spec: |
| {{- with .Values.imagePullSecrets }} |
| imagePullSecrets: |
| {{- toYaml . | nindent 6 }} |
| {{- end }} |
| securityContext: |
| {{- toYaml .Values.podSecurityContext | nindent 8 }} |
| containers: |
| - name: {{ .Chart.Name }} |
| image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" |
| imagePullPolicy: {{ .Values.image.pullPolicy }} |
| env: |
| - name: POD_NAMESPACE |
| valueFrom: |
| fieldRef: |
| fieldPath: metadata.namespace |
| - name: POD_NAME |
| valueFrom: |
| fieldRef: |
| fieldPath: metadata.name |
| - name: NODE_NAME |
| valueFrom: |
| fieldRef: |
| fieldPath: spec.nodeName |
| args: |
| - "/usr/local/bin/sdcore-adapter" |
| - "-bind_address=:{{ .Values.ports.gnmi.secure }}" |
| - "-key=/etc/sdcore-adapter/certs/tls.key" |
| - "-cert=/etc/sdcore-adapter/certs/tls.crt" |
| - "-ca=/etc/sdcore-adapter/certs/tls.cacert" |
| - "-alsologtostderr" |
| - "-hostCheckDisabled" |
| {{ if .Values.initialConfig }} |
| - "-config={{ .Values.initialConfig }}" |
| {{ end }} |
| {{ if .Values.output }} |
| - "-output={{ .Values.output }}" |
| {{ end }} |
| {{ if .Values.spgwEndpoint }} |
| - "-spgw_endpoint={{ .Values.spgwEndpoint }}" |
| {{ end }} |
| ports: |
| {{- range $key, $port := .Values.ports.gnmi }} |
| - name: gnmi{{ $key }} |
| containerPort: {{ $port }} |
| {{- end}} |
| readinessProbe: |
| tcpSocket: |
| port: {{ .Values.ports.gnmi.secure }} |
| initialDelaySeconds: 5 |
| periodSeconds: 10 |
| livenessProbe: |
| tcpSocket: |
| port: {{ .Values.ports.gnmi.secure }} |
| initialDelaySeconds: 15 |
| periodSeconds: 20 |
| volumeMounts: |
| - name: targetconfig |
| mountPath: /etc/sdcore-adapter/configs |
| readOnly: true |
| - name: secret |
| mountPath: /etc/sdcore-adapter/certs |
| readOnly: true |
| - name: logconfig |
| mountPath: /etc/onos/config |
| readOnly: true |
| volumes: |
| - name: logconfig |
| configMap: |
| name: {{ template "sdcore-adapter.fullname" . }}-logconfig |
| - name: targetconfig |
| configMap: |
| name: {{ template "sdcore-adapter.fullname" . }}-targetconfig |
| - name: secret |
| secret: |
| secretName: {{ template "sdcore-adapter.fullname" . }}-secret |