blob: bc068bbcd644fc8ca38e6a6629cf298ce4832af1 [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 }}
Sean Condon38ee7b62021-10-23 15:51:20 +010083 {{ if .Values.websocketsidecar.enabled }}
Scott Bakerc9d3d842021-09-17 11:32:53 -070084 - name: {{ .Chart.Name }}-websocket
85 image: "{{ .Values.image.websocketsidecar.repository }}:{{ .Values.image.tag }}"
86 imagePullPolicy: {{ .Values.image.pullPolicy }}
87 env:
88 - name: NAMESPACE
89 valueFrom:
90 fieldRef:
91 fieldPath: metadata.namespace
92 args:
93 {{- range $key, $corsorigin := .Values.corsOrigins }}
94 - {{ printf "-allowCorsOrigin=%s" $corsorigin }}{{end}}
95 ports:
96 - name: http
97 containerPort: {{ .Values.websocketsidecar.port }}
98 startupProbe:
99 tcpSocket:
100 port: {{ .Values.websocketsidecar.port }}
101 periodSeconds: 5
102 failureThreshold: 60
103 readinessProbe:
104 tcpSocket:
105 port: {{ .Values.websocketsidecar.port }}
106 initialDelaySeconds: 10
107 periodSeconds: 10
108 livenessProbe:
109 tcpSocket:
110 port: {{ .Values.websocketsidecar.port }}
111 initialDelaySeconds: 10
112 periodSeconds: 10
113 resources:
114 {{- toYaml .Values.resources | nindent 12 }}
115 securityContext: {}
Sean Condon38ee7b62021-10-23 15:51:20 +0100116 {{ end }}
Scott Bakerc9d3d842021-09-17 11:32:53 -0700117 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
Sean Condon38ee7b62021-10-23 15:51:20 +0100124 {{- with .Values.nodeSelector }}
Scott Bakerc9d3d842021-09-17 11:32:53 -0700125 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 }}