blob: 8b28dc82710e3f2240abe937380f688251d9434d [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:
18 name: "{{ .Chart.Name }}"
19 labels:
20 release: {{ .Release.Name }}
21spec:
22 replicas: {{ .Values.replicaCount }}
23 selector:
24 matchLabels:
25 app: "{{ .Chart.Name }}"
26 template:
27 metadata:
28 labels:
29 app: "{{ .Chart.Name }}"
30 spec:
abhayk9f58b112025-01-11 00:08:02 +053031 {{- if .Values.securityContext.enabled }}
32 securityContext:
33 runAsUser: {{ .Values.securityContext.runAsUser }}
34 runAsGroup: {{ .Values.securityContext.runAsGroup }}
35 fsGroup: {{ .Values.securityContext.fsGroup }}
36 {{- end }}
Tinoj Josephdd1fd9d2022-08-01 23:59:26 +053037 containers:
abhay4a45cc82025-01-10 21:32:07 +053038 - args:
39 - "/app/voltha-go-controller"
40 env:
Tinoj Josephdd1fd9d2022-08-01 23:59:26 +053041 - name: POD_IP
42 valueFrom:
43 fieldRef:
44 fieldPath: status.podIP
45 - name: NAMESPACE
46 valueFrom:
47 fieldRef:
48 fieldPath: metadata.namespace
49 - name: VOLTHA_HOST
50 value: "$(NAMESPACE)-voltha-api.$(NAMESPACE).svc.cluster.local"
51 - name: VOLTHA_PORT
52 value: "55555"
53 - name: KV_STORE_TYPE
abhaycd295062024-12-12 11:05:07 +053054 value: "{{ .Values.services.kvstore.type }}"
Tinoj Josephdd1fd9d2022-08-01 23:59:26 +053055 - name: KV_STORE_HOST
abhaycd295062024-12-12 11:05:07 +053056 value: "{{ .Values.services.kvstore.address }}"
Tinoj Josephdd1fd9d2022-08-01 23:59:26 +053057 - name: KV_STORE_PORT
abhaycd295062024-12-12 11:05:07 +053058 value: "{{ .Values.services.kvstore.port }}"
Tinoj Josephdd1fd9d2022-08-01 23:59:26 +053059 - name: KAFKA_ADAPTER_HOST
Akash Sonia02e9982022-12-09 10:11:41 +053060 value: "{{ tpl .Values.services.kafka.cluster.address . }}"
Tinoj Josephdd1fd9d2022-08-01 23:59:26 +053061 - name: KAFKA_ADAPTER_PORT
62 value: "9092"
63 - name: LOG_LEVEL
64 value: .Values.global.log_level
abhay4a45cc82025-01-10 21:32:07 +053065 - name: KV_STORE_TIMEOUT
66 value: "3000000000"
67 - name: DEVICE_SYNC_DURATION
68 value: "10"
69 - name: MAX_FLOW_RETRY_DURATION
70 value: "60"
71 - name: LIVE_PROBE_INTERVAL
72 value: "60"
73 - name: NOT_LIVE_PROBE_INTERVAL
74 value: "5"
75 name: voltha-go-controller
Tinoj Josephdd1fd9d2022-08-01 23:59:26 +053076 image: '{{ tpl .Values.images.voltha_go_controller.registry . }}{{ tpl .Values.images.voltha_go_controller.repository . }}:{{ tpl ( tpl .Values.images.voltha_go_controller.tag . ) . }}'
77 imagePullPolicy: {{ tpl .Values.images.voltha_go_controller.pullPolicy . }}
abhayk9f58b112025-01-11 00:08:02 +053078 {{- if .Values.securityContext.enabled }}
abhay4a45cc82025-01-10 21:32:07 +053079 securityContext:
abhayk9f58b112025-01-11 00:08:02 +053080 allowPrivilegeEscalation: false
81 {{- end }}
Tinoj Josephdd1fd9d2022-08-01 23:59:26 +053082 ports:
83 - containerPort: {{ .Values.voltha_go_controller.sshPort }}
84 name: ssh-port
85 - containerPort: {{ .Values.voltha_go_controller.uiPort }}
86 name: ui-port
87 protocol: "{{ .Values.voltha_go_controller.uiProtocol }}"
abhay4a45cc82025-01-10 21:32:07 +053088 livenessProbe:
89 httpGet:
90 path: /healthz
91 port: 8090
92 initialDelaySeconds: {{ .Values.probe.liveness.initial_delay_seconds }}
93 periodSeconds: {{ .Values.probe.liveness.period_seconds }}
94 readinessProbe:
95 httpGet:
96 path: /readz
97 port: 8090
98 initialDelaySeconds: {{ .Values.probe.readiness.initial_delay_seconds }}
99 periodSeconds: {{ .Values.probe.readiness.period_seconds }}
100 resources:
101 requests:
102 {{- if .Values.resources.requests.memory }}
103 memory: {{ .Values.resources.requests.memory }}
104 {{- end }}
105 {{- if .Values.resources.requests.cpu }}
106 cpu: {{ .Values.resources.requests.cpu }}
107 {{- end }}
108 limits:
109 {{- if .Values.resources.limits.memory }}
110 memory: {{ .Values.resources.limits.memory }}
111 {{- end }}
112 {{- if .Values.resources.limits.cpu }}
113 cpu: {{ .Values.resources.limits.cpu }}
114 {{- end }}
Tinoj Josephdd1fd9d2022-08-01 23:59:26 +0530115 restartPolicy: "Always"