Scott Baker | c9d3d84 | 2021-09-17 11:32:53 -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 | c9d3d84 | 2021-09-17 11:32:53 -0700 | [diff] [blame] | 4 | |
| 5 | apiVersion: apps/v1 |
| 6 | kind: Deployment |
| 7 | metadata: |
| 8 | name: {{ include "aether-roc-api.fullname" . }} |
| 9 | namespace: {{ .Release.Namespace }} |
| 10 | labels: |
| 11 | {{- include "aether-roc-api.labels" . | nindent 4 }} |
| 12 | spec: |
| 13 | replicas: {{ .Values.replicaCount }} |
| 14 | selector: |
| 15 | matchLabels: |
| 16 | name: {{ template "aether-roc-api.fullname" . }} |
| 17 | app: aether |
| 18 | type: api |
| 19 | resource: {{ template "aether-roc-api.fullname" . }} |
| 20 | {{- include "aether-roc-api.selectorLabels" . | nindent 6 }} |
| 21 | template: |
| 22 | metadata: |
| 23 | labels: |
| 24 | name: {{ template "aether-roc-api.fullname" . }} |
| 25 | app: aether |
| 26 | type: api |
| 27 | resource: {{ template "aether-roc-api.fullname" . }} |
| 28 | {{- include "aether-roc-api.selectorLabels" . | nindent 8 }} |
| 29 | spec: |
| 30 | serviceAccountName: aether-roc-api |
| 31 | securityContext: |
| 32 | {{- toYaml .Values.podSecurityContext | nindent 8 }} |
| 33 | {{- with .Values.imagePullSecrets }} |
| 34 | imagePullSecrets: |
| 35 | {{- toYaml . | nindent 8 }} |
| 36 | {{- end }} |
| 37 | containers: |
| 38 | - name: {{ .Chart.Name }} |
Matteo Scandolo | 73b0340 | 2022-03-02 11:18:41 -0800 | [diff] [blame] | 39 | image: "{{ .Values.image.repository }}:{{ tpl .Values.image.tag . }}" |
Scott Baker | c9d3d84 | 2021-09-17 11:32:53 -0700 | [diff] [blame] | 40 | imagePullPolicy: {{ .Values.image.pullPolicy }} |
| 41 | env: |
| 42 | - name: NAMESPACE |
| 43 | valueFrom: |
| 44 | fieldRef: |
| 45 | fieldPath: metadata.namespace |
Sean Condon | 2a3b5b7 | 2021-10-06 13:29:03 +0100 | [diff] [blame] | 46 | - name: OIDC_SERVER_URL |
| 47 | value: {{ .Values.openidc.issuer }} |
Scott Baker | c9d3d84 | 2021-09-17 11:32:53 -0700 | [diff] [blame] | 48 | args: |
Matteo Scandolo | 73b0340 | 2022-03-02 11:18:41 -0800 | [diff] [blame] | 49 | - "-gnmiEndpoint={{ .Values.gnmiEndpoint }}" |
| 50 | # TODO add support for certificates |
| 51 | - "-gnmiTimeout={{ .Values.gnmiTimeout }}" |
| 52 | - "-port={{ .Values.port }}" |
| 53 | - "-logLevel={{ .Values.logging.loggers.root.level }}" |
kmarquardsen | 0394540 | 2022-03-16 14:41:06 -0700 | [diff] [blame] | 54 | - "-analyticsEndpoint={{ .Values.analyticsEndpoint }}" |
Scott Baker | c9d3d84 | 2021-09-17 11:32:53 -0700 | [diff] [blame] | 55 | {{- range $key, $corsorigin := .Values.corsOrigins }} |
Matteo Scandolo | 73b0340 | 2022-03-02 11:18:41 -0800 | [diff] [blame] | 56 | - {{ printf "-allowCorsOrigin=%s" $corsorigin }} |
| 57 | {{end}} |
Scott Baker | c9d3d84 | 2021-09-17 11:32:53 -0700 | [diff] [blame] | 58 | ports: |
| 59 | - name: http |
| 60 | containerPort: 8181 |
| 61 | startupProbe: |
| 62 | tcpSocket: |
| 63 | port: 8181 |
| 64 | periodSeconds: 5 |
| 65 | failureThreshold: 60 |
| 66 | readinessProbe: |
| 67 | tcpSocket: |
| 68 | port: 8181 |
| 69 | initialDelaySeconds: 10 |
| 70 | periodSeconds: 10 |
| 71 | livenessProbe: |
| 72 | tcpSocket: |
| 73 | port: 8181 |
| 74 | initialDelaySeconds: 10 |
| 75 | periodSeconds: 10 |
| 76 | volumeMounts: |
| 77 | - name: secret |
| 78 | mountPath: /etc/aether-roc-api/certs |
| 79 | readOnly: true |
| 80 | - name: config |
| 81 | mountPath: /etc/onos/config |
| 82 | readOnly: true |
| 83 | resources: |
| 84 | {{- toYaml .Values.resources | nindent 12 }} |
| 85 | # Enable ptrace for debugging |
| 86 | securityContext: |
| 87 | {{- if .Values.debug }} |
| 88 | capabilities: |
| 89 | add: |
| 90 | - SYS_PTRACE |
| 91 | {{- end }} |
Scott Baker | c9d3d84 | 2021-09-17 11:32:53 -0700 | [diff] [blame] | 92 | volumes: |
| 93 | - name: secret |
| 94 | secret: |
| 95 | secretName: {{ template "aether-roc-api.fullname" . }}-secret |
| 96 | - name: config |
| 97 | configMap: |
| 98 | name: {{ template "aether-roc-api.fullname" . }}-config |
| 99 | {{- with .Values.nodeSelector }} |
| 100 | nodeSelector: |
| 101 | {{- toYaml . | nindent 8 }} |
| 102 | {{- end }} |
| 103 | {{- with .Values.affinity }} |
| 104 | affinity: |
| 105 | {{- toYaml . | nindent 8 }} |
| 106 | {{- end }} |
| 107 | {{- with .Values.tolerations }} |
| 108 | tolerations: |
| 109 | {{- toYaml . | nindent 8 }} |
| 110 | {{- end }} |