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