blob: 33b0435c963dbda4ab4fe76074fecff9e938aa4e [file] [log] [blame]
Joey Armstrong084e4472024-02-10 18:03:13 -05001# Copyright 2022-2024 Open Networking Foundation (ONF) and the ONF Contributors
Tinoj Josephdd1fd9d2022-08-01 23:59:26 +05302#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15apiVersion: apps/v1
16kind: Deployment
17metadata:
abhaykfee1b0d2025-01-13 19:57:04 +053018 name: "{{ template "fullname" . }}"
abhayk0d1cf562025-01-11 13:59:15 +053019 namespace: "{{ .Release.Namespace }}"
abhaykfee1b0d2025-01-13 19:57:04 +053020 {{- if or (hasKey .Values "extra_deployment_labels") (hasKey .Values "vgc_deployment_labels") }}
Tinoj Josephdd1fd9d2022-08-01 23:59:26 +053021 labels:
abhaykfee1b0d2025-01-13 19:57:04 +053022 {{- if hasKey .Values "extra_deployment_labels" }}
23 {{- range $key, $val := .Values.extra_deployment_labels }}
24 {{ $key }}: {{ $val | quote }}
25 {{- end }}
26 {{- end }}
27 {{- if hasKey .Values "vgc_deployment_labels" }}
28 {{- range $key, $val := .Values.vgc_deployment_labels }}
29 {{ $key }}: {{ $val | quote }}
30 {{- end }}
31 {{- end }}
32 {{- end }}
Tinoj Josephdd1fd9d2022-08-01 23:59:26 +053033spec:
Tinoj Josephdd1fd9d2022-08-01 23:59:26 +053034 selector:
35 matchLabels:
abhaykfee1b0d2025-01-13 19:57:04 +053036 app: voltha-go-controller
37 release: {{ .Release.Name }}
Tinoj Josephdd1fd9d2022-08-01 23:59:26 +053038 template:
39 metadata:
40 labels:
abhaykfee1b0d2025-01-13 19:57:04 +053041 app: voltha-go-controller
42 release: {{ .Release.Name }}
43 app.kubernetes.io/name: "voltha-go-controller"
44 app.kubernetes.io/version: {{ quote .Chart.AppVersion }}
45 app.kubernetes.io/component: "controller"
46 app.kubernetes.io/part-of: "voltha"
47 app.kubernetes.io/stack: "{{ .Values.global.stack_name }}"
48 app.kubernetes.io/managed-by: {{ quote .Release.Service }}
49 helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
50 {{- if hasKey .Values "extra_pod_labels" }}
51 {{- range $key, $val := .Values.extra_pod_labels }}
52 {{ $key }}: {{ $val | quote }}
53 {{- end }}
54 {{- end }}
55 {{- if hasKey .Values "vgc_pod_labels" }}
56 {{- range $key, $val := .Values.vgc_pod_labels }}
57 {{ $key }}: {{ $val | quote }}
58 {{- end }}
59 {{- end }}
Tinoj Josephdd1fd9d2022-08-01 23:59:26 +053060 spec:
abhayk9f58b112025-01-11 00:08:02 +053061 {{- if .Values.securityContext.enabled }}
62 securityContext:
63 runAsUser: {{ .Values.securityContext.runAsUser }}
64 runAsGroup: {{ .Values.securityContext.runAsGroup }}
65 fsGroup: {{ .Values.securityContext.fsGroup }}
66 {{- end }}
Tinoj Josephdd1fd9d2022-08-01 23:59:26 +053067 containers:
abhay4a45cc82025-01-10 21:32:07 +053068 - args:
69 - "/app/voltha-go-controller"
70 env:
Tinoj Josephdd1fd9d2022-08-01 23:59:26 +053071 - name: POD_IP
72 valueFrom:
73 fieldRef:
74 fieldPath: status.podIP
75 - name: NAMESPACE
abhayk0d1cf562025-01-11 13:59:15 +053076 value: {{ .Release.Namespace }}
Tinoj Josephdd1fd9d2022-08-01 23:59:26 +053077 - name: VOLTHA_HOST
abhayk0d1cf562025-01-11 13:59:15 +053078 value: "{{ .Release.Namespace }}-voltha-api.{{ .Release.Namespace }}.svc.cluster.local"
Tinoj Josephdd1fd9d2022-08-01 23:59:26 +053079 - name: VOLTHA_PORT
80 value: "55555"
81 - name: KV_STORE_TYPE
abhaykfee1b0d2025-01-13 19:57:04 +053082 value: "{{ tpl .Values.services.kvstore.type . }}"
Tinoj Josephdd1fd9d2022-08-01 23:59:26 +053083 - name: KV_STORE_HOST
abhaykfee1b0d2025-01-13 19:57:04 +053084 value: "{{ tpl .Values.services.kvstore.address . }}"
Tinoj Josephdd1fd9d2022-08-01 23:59:26 +053085 - name: KV_STORE_PORT
abhaykfee1b0d2025-01-13 19:57:04 +053086 value: "{{ tpl .Values.services.kvstore.port . }}"
Tinoj Josephdd1fd9d2022-08-01 23:59:26 +053087 - name: KAFKA_ADAPTER_HOST
Akash Sonia02e9982022-12-09 10:11:41 +053088 value: "{{ tpl .Values.services.kafka.cluster.address . }}"
Tinoj Josephdd1fd9d2022-08-01 23:59:26 +053089 - name: KAFKA_ADAPTER_PORT
90 value: "9092"
91 - name: LOG_LEVEL
abhayk0d1cf562025-01-11 13:59:15 +053092 value: "{{ .Values.global.log_level }}"
abhay4a45cc82025-01-10 21:32:07 +053093 - name: KV_STORE_TIMEOUT
94 value: "3000000000"
95 - name: DEVICE_SYNC_DURATION
96 value: "10"
97 - name: MAX_FLOW_RETRY_DURATION
98 value: "60"
99 - name: LIVE_PROBE_INTERVAL
100 value: "60"
101 - name: NOT_LIVE_PROBE_INTERVAL
102 value: "5"
103 name: voltha-go-controller
Tinoj Josephdd1fd9d2022-08-01 23:59:26 +0530104 image: '{{ tpl .Values.images.voltha_go_controller.registry . }}{{ tpl .Values.images.voltha_go_controller.repository . }}:{{ tpl ( tpl .Values.images.voltha_go_controller.tag . ) . }}'
105 imagePullPolicy: {{ tpl .Values.images.voltha_go_controller.pullPolicy . }}
abhayk9f58b112025-01-11 00:08:02 +0530106 {{- if .Values.securityContext.enabled }}
abhay4a45cc82025-01-10 21:32:07 +0530107 securityContext:
abhayk9f58b112025-01-11 00:08:02 +0530108 allowPrivilegeEscalation: false
109 {{- end }}
Tinoj Josephdd1fd9d2022-08-01 23:59:26 +0530110 ports:
111 - containerPort: {{ .Values.voltha_go_controller.sshPort }}
112 name: ssh-port
113 - containerPort: {{ .Values.voltha_go_controller.uiPort }}
114 name: ui-port
115 protocol: "{{ .Values.voltha_go_controller.uiProtocol }}"
abhay4a45cc82025-01-10 21:32:07 +0530116 livenessProbe:
117 httpGet:
118 path: /healthz
119 port: 8090
120 initialDelaySeconds: {{ .Values.probe.liveness.initial_delay_seconds }}
121 periodSeconds: {{ .Values.probe.liveness.period_seconds }}
122 readinessProbe:
123 httpGet:
124 path: /readz
125 port: 8090
126 initialDelaySeconds: {{ .Values.probe.readiness.initial_delay_seconds }}
127 periodSeconds: {{ .Values.probe.readiness.period_seconds }}
128 resources:
129 requests:
130 {{- if .Values.resources.requests.memory }}
131 memory: {{ .Values.resources.requests.memory }}
132 {{- end }}
133 {{- if .Values.resources.requests.cpu }}
134 cpu: {{ .Values.resources.requests.cpu }}
135 {{- end }}
136 limits:
137 {{- if .Values.resources.limits.memory }}
138 memory: {{ .Values.resources.limits.memory }}
139 {{- end }}
140 {{- if .Values.resources.limits.cpu }}
141 cpu: {{ .Values.resources.limits.cpu }}
142 {{- end }}
Tinoj Josephdd1fd9d2022-08-01 23:59:26 +0530143 restartPolicy: "Always"