blob: 50d74e9d1e1ad29f3c21792dfc8074f1db19409a [file] [log] [blame]
Scott Bakerc9d3d842021-09-17 11:32:53 -07001# SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org>
2#
Sean Condon160ec1d2022-02-08 12:58:25 +00003# SPDX-License-Identifier: Apache-2.0
Scott Bakerc9d3d842021-09-17 11:32:53 -07004
5apiVersion: apps/v1
6kind: Deployment
7metadata:
8 name: {{ include "aether-roc-api.fullname" . }}
9 namespace: {{ .Release.Namespace }}
10 labels:
11 {{- include "aether-roc-api.labels" . | nindent 4 }}
12spec:
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 Scandolo73b03402022-03-02 11:18:41 -080039 image: "{{ .Values.image.repository }}:{{ tpl .Values.image.tag . }}"
Scott Bakerc9d3d842021-09-17 11:32:53 -070040 imagePullPolicy: {{ .Values.image.pullPolicy }}
41 env:
42 - name: NAMESPACE
43 valueFrom:
44 fieldRef:
45 fieldPath: metadata.namespace
Sean Condon2a3b5b72021-10-06 13:29:03 +010046 - name: OIDC_SERVER_URL
47 value: {{ .Values.openidc.issuer }}
Scott Bakerc9d3d842021-09-17 11:32:53 -070048 args:
Matteo Scandolo73b03402022-03-02 11:18:41 -080049 - "-gnmiEndpoint={{ .Values.gnmiEndpoint }}"
50 # TODO add support for certificates
51 - "-gnmiTimeout={{ .Values.gnmiTimeout }}"
52 - "-port={{ .Values.port }}"
53 - "-logLevel={{ .Values.logging.loggers.root.level }}"
kmarquardsen03945402022-03-16 14:41:06 -070054 - "-analyticsEndpoint={{ .Values.analyticsEndpoint }}"
Scott Bakerc9d3d842021-09-17 11:32:53 -070055 {{- range $key, $corsorigin := .Values.corsOrigins }}
Matteo Scandolo73b03402022-03-02 11:18:41 -080056 - {{ printf "-allowCorsOrigin=%s" $corsorigin }}
57 {{end}}
Scott Bakerc9d3d842021-09-17 11:32:53 -070058 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 Bakerc9d3d842021-09-17 11:32:53 -070092 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 }}