blob: f925dc43f35096eea4b5972861ac519211577982 [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 }}"
Scott Bakerc9d3d842021-09-17 11:32:53 -070054 {{- range $key, $corsorigin := .Values.corsOrigins }}
Matteo Scandolo73b03402022-03-02 11:18:41 -080055 - {{ printf "-allowCorsOrigin=%s" $corsorigin }}
56 {{end}}
Scott Bakerc9d3d842021-09-17 11:32:53 -070057 ports:
58 - name: http
59 containerPort: 8181
60 startupProbe:
61 tcpSocket:
62 port: 8181
63 periodSeconds: 5
64 failureThreshold: 60
65 readinessProbe:
66 tcpSocket:
67 port: 8181
68 initialDelaySeconds: 10
69 periodSeconds: 10
70 livenessProbe:
71 tcpSocket:
72 port: 8181
73 initialDelaySeconds: 10
74 periodSeconds: 10
75 volumeMounts:
76 - name: secret
77 mountPath: /etc/aether-roc-api/certs
78 readOnly: true
79 - name: config
80 mountPath: /etc/onos/config
81 readOnly: true
82 resources:
83 {{- toYaml .Values.resources | nindent 12 }}
84 # Enable ptrace for debugging
85 securityContext:
86 {{- if .Values.debug }}
87 capabilities:
88 add:
89 - SYS_PTRACE
90 {{- end }}
Scott Bakerc9d3d842021-09-17 11:32:53 -070091 volumes:
92 - name: secret
93 secret:
94 secretName: {{ template "aether-roc-api.fullname" . }}-secret
95 - name: config
96 configMap:
97 name: {{ template "aether-roc-api.fullname" . }}-config
98 {{- with .Values.nodeSelector }}
99 nodeSelector:
100 {{- toYaml . | nindent 8 }}
101 {{- end }}
102 {{- with .Values.affinity }}
103 affinity:
104 {{- toYaml . | nindent 8 }}
105 {{- end }}
106 {{- with .Values.tolerations }}
107 tolerations:
108 {{- toYaml . | nindent 8 }}
109 {{- end }}