blob: 32aebb237399a4f8e37b0ef4278818ec6e2ddadd [file] [log] [blame]
Scott Bakerc9d3d842021-09-17 11:32:53 -07001# SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org>
2#
3# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
4
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 }}
39 image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
40 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:
49 {{- range $key, $corsorigin := .Values.corsOrigins }}
50 - {{ printf "-allowCorsOrigin=%s" $corsorigin }}{{end}}
51 ports:
52 - name: http
53 containerPort: 8181
54 startupProbe:
55 tcpSocket:
56 port: 8181
57 periodSeconds: 5
58 failureThreshold: 60
59 readinessProbe:
60 tcpSocket:
61 port: 8181
62 initialDelaySeconds: 10
63 periodSeconds: 10
64 livenessProbe:
65 tcpSocket:
66 port: 8181
67 initialDelaySeconds: 10
68 periodSeconds: 10
69 volumeMounts:
70 - name: secret
71 mountPath: /etc/aether-roc-api/certs
72 readOnly: true
73 - name: config
74 mountPath: /etc/onos/config
75 readOnly: true
76 resources:
77 {{- toYaml .Values.resources | nindent 12 }}
78 # Enable ptrace for debugging
79 securityContext:
80 {{- if .Values.debug }}
81 capabilities:
82 add:
83 - SYS_PTRACE
84 {{- end }}
85 - name: {{ .Chart.Name }}-websocket
86 image: "{{ .Values.image.websocketsidecar.repository }}:{{ .Values.image.tag }}"
87 imagePullPolicy: {{ .Values.image.pullPolicy }}
88 env:
89 - name: NAMESPACE
90 valueFrom:
91 fieldRef:
92 fieldPath: metadata.namespace
93 args:
94 {{- range $key, $corsorigin := .Values.corsOrigins }}
95 - {{ printf "-allowCorsOrigin=%s" $corsorigin }}{{end}}
96 ports:
97 - name: http
98 containerPort: {{ .Values.websocketsidecar.port }}
99 startupProbe:
100 tcpSocket:
101 port: {{ .Values.websocketsidecar.port }}
102 periodSeconds: 5
103 failureThreshold: 60
104 readinessProbe:
105 tcpSocket:
106 port: {{ .Values.websocketsidecar.port }}
107 initialDelaySeconds: 10
108 periodSeconds: 10
109 livenessProbe:
110 tcpSocket:
111 port: {{ .Values.websocketsidecar.port }}
112 initialDelaySeconds: 10
113 periodSeconds: 10
114 resources:
115 {{- toYaml .Values.resources | nindent 12 }}
116 securityContext: {}
117 volumes:
118 - name: secret
119 secret:
120 secretName: {{ template "aether-roc-api.fullname" . }}-secret
121 - name: config
122 configMap:
123 name: {{ template "aether-roc-api.fullname" . }}-config
124 {{- with .Values.nodeSelector }}
125 nodeSelector:
126 {{- toYaml . | nindent 8 }}
127 {{- end }}
128 {{- with .Values.affinity }}
129 affinity:
130 {{- toYaml . | nindent 8 }}
131 {{- end }}
132 {{- with .Values.tolerations }}
133 tolerations:
134 {{- toYaml . | nindent 8 }}
135 {{- end }}