blob: ee837d247b0472f6cf30c0ff42014d3396b2e775 [file] [log] [blame]
Joey Armstrong6a104e92024-02-10 15:27:58 -05001# Copyright 2019-2024 Open Networking Foundation (ONF) and the ONF Contributors
Holger Hildebrandtb67c3302020-02-25 13:48:59 +00002#
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{{- $log_level := tpl .Values.adapter_open_onu.log_level . | upper }}
David Bainbridge8595b3b2020-06-05 12:23:05 -070015---
Holger Hildebrandtb67c3302020-02-25 13:48:59 +000016apiVersion: apps/v1
17kind: Deployment
18metadata:
David Bainbridge2bdd4302020-06-09 17:13:18 -070019 name: "{{ template "fullname" . }}"
Holger Hildebrandtb67c3302020-02-25 13:48:59 +000020 namespace: {{ .Release.Namespace }}
21 {{- if or (hasKey .Values "extra_deployment_labels") (hasKey .Values "openonu_deployment_labels") }}
22 labels:
23 {{- if hasKey .Values "extra_deployment_labels" }}
24 {{- range $key, $val := .Values.extra_deployment_labels }}
25 {{ $key }}: {{ $val | quote }}
26 {{- end }}
27 {{- end }}
28 {{- if hasKey .Values "openonu_deployment_labels" }}
29 {{- range $key, $val := .Values.openonu_deployment_labels }}
30 {{ $key }}: {{ $val | quote }}
31 {{- end }}
32 {{- end }}
33 {{- end }}
34spec:
35 replicas: {{ .Values.replicas.adapter_open_onu }}
36 selector:
37 matchLabels:
38 app: adapter-open-onu
David Bainbridge8595b3b2020-06-05 12:23:05 -070039 release: {{ .Release.Name }}
Holger Hildebrandtb67c3302020-02-25 13:48:59 +000040 template:
41 metadata:
David Bainbridge8595b3b2020-06-05 12:23:05 -070042 namespace: {{ .Release.Namespace }}
Holger Hildebrandtb67c3302020-02-25 13:48:59 +000043 labels:
44 app: adapter-open-onu
David Bainbridge8595b3b2020-06-05 12:23:05 -070045 release: {{ .Release.Name }}
Holger Hildebrandtb67c3302020-02-25 13:48:59 +000046 app.kubernetes.io/name: "adapter-open-onu"
47 app.kubernetes.io/version: {{ quote .Chart.AppVersion }}
48 app.kubernetes.io/component: "adapter"
49 app.kubernetes.io/part-of: "voltha"
Matteo Scandolob4c5f4e2020-11-11 12:05:23 -080050 app.kubernetes.io/stack: "{{ .Values.global.stack_name }}"
Holger Hildebrandtb67c3302020-02-25 13:48:59 +000051 app.kubernetes.io/managed-by: {{ quote .Release.Service }}
52 helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
53 {{- if hasKey .Values "extra_pod_labels" }}
54 {{- range $key, $val := .Values.extra_pod_labels }}
55 {{ $key }}: {{ $val | quote }}
56 {{- end }}
57 {{- end }}
58 {{- if hasKey .Values "openonu_pod_labels" }}
59 {{- range $key, $val := .Values.openonu_pod_labels }}
60 {{ $key }}: {{ $val | quote }}
61 {{- end }}
62 {{- end }}
Holger Hildebrandtb67c3302020-02-25 13:48:59 +000063 spec:
David Bainbridge8595b3b2020-06-05 12:23:05 -070064 {{- if .Values.securityContext.enabled }}
65 securityContext:
66 runAsUser: {{ .Values.securityContext.runAsUser }}
67 runAsGroup: {{ .Values.securityContext.runAsGroup }}
68 fsGroup: {{ .Values.securityContext.fsGroup }}
69 {{- end }}
Holger Hildebrandtb67c3302020-02-25 13:48:59 +000070 containers:
71 - name: adapter-open-onu
Matteo Scandoloefcb4392020-11-17 10:21:02 -080072 image: '{{ tpl .Values.images.adapter_open_onu_go.registry . }}{{ tpl .Values.images.adapter_open_onu_go.repository . }}:{{ tpl ( tpl .Values.images.adapter_open_onu_go.tag . ) . }}'
Holger Hildebrandtb67c3302020-02-25 13:48:59 +000073 imagePullPolicy: {{ tpl .Values.images.adapter_open_onu_go.pullPolicy . }}
Matteo Scandolo846f19c2020-04-24 16:39:17 -070074 env:
75 - name: COMPONENT_NAME
76 valueFrom:
77 fieldRef:
78 fieldPath: metadata.labels['app.kubernetes.io/name']
Matteo Scandolofcbb9252020-11-19 12:19:02 -080079 - name: KV_STORE_DATAPATH_PREFIX
Matteo Scandolob4c5f4e2020-11-11 12:05:23 -080080 value: {{ tpl .Values.adapter_open_onu.kv_store_data_prefix . }}
Holger Hildebrandtb67c3302020-02-25 13:48:59 +000081 args:
Matteo Scandolo4f6d59a2020-03-25 10:37:18 -070082 - "/app/openonu"
Holger Hildebrandtb67c3302020-02-25 13:48:59 +000083 - "--banner=true"
84 - "--kafka_reconnect_retries=-1"
khenaidoo15c53fb2021-08-09 13:56:27 -040085 - "--core_endpoint={{ tpl .Values.global.core_endpoint . }}"
86 - "--adapter_endpoint={{ tpl .Values.adapter_open_onu.endpoints.address . }}.{{ .Release.Namespace }}.svc:{{ print .Values.adapter_open_onu.endpoints.port }}"
Matteo Scandolo1d80abd2021-01-28 11:30:12 -080087 - "--kafka_cluster_address={{ tpl .Values.services.kafka.cluster.address . }}"
Matteo Scandolo06ee58c2021-05-26 15:28:51 -070088 - "--event_topic={{ .Values.adapter_open_onu.topics.event_topic }}"
abhaycd295062024-12-12 11:05:07 +053089 - "--kv_store_type={{ tpl .Values.services.kvstore.type . }}"
90 - "--kv_store_address={{ tpl .Values.services.kvstore.address . }}"
Andrea Campanella6838a802020-11-19 15:50:23 +010091 - "--kv_store_request_timeout={{ tpl .Values.adapter_open_onu.kv_store_timeout . }}"
Holger Hildebrandtb67c3302020-02-25 13:48:59 +000092 - "--log_level={{ $log_level }}"
93 - "--probe_port=8080"
Girish Gowdra3152aca2020-11-19 15:57:58 -080094 - "--accept_incr_evto={{ tpl .Values.adapter_open_onu.incremental_evto_update . }}"
Himani Chawla5a33c502020-09-25 13:08:33 +053095 - "--max_timeout_interadapter_comm={{ tpl .Values.adapter_open_onu.max_timeout_interadapter_comm . }}"
Holger Hildebrandtade635b2021-02-18 16:28:39 +000096 - "--max_timeout_reconciling={{ tpl .Values.adapter_open_onu.max_timeout_reconciling . }}"
Girish Gowdraa4535062021-03-09 13:21:58 -080097 - "--omci_timeout={{ tpl .Values.adapter_open_onu.omci_timeout . }}"
khenaidoo15c53fb2021-08-09 13:56:27 -040098 - "--rpc_timeout={{ tpl .Values.adapter_open_onu.rpc_timeout . }}"
Matteo Scandolob4c5f4e2020-11-11 12:05:23 -080099 - "--trace_enabled={{ .Values.global.tracing.enabled }}"
100 - "--trace_agent_address={{ tpl .Values.services.tracing_agent.address . }}"
Matteo Scandolo0020f512021-02-12 15:04:38 -0800101 - "--log_correlation_enabled={{ .Values.global.log_correlation.enabled }}"
Andrea Campanellaaa46d3f2021-01-19 09:19:02 +0100102 - "--allowed_onu_vendors={{ template "allowed_onu_vendors" . }}"
Girish Gowdrae05c0182021-01-28 15:02:37 -0800103 - "--metrics_enabled={{ .Values.global.metrics.enabled }}"
Holger Hildebrandt80d1f0a2022-06-24 07:53:59 +0000104 - "--extended_omci_support_enabled={{ .Values.global.extended_omci_support.enabled }}"
Holger Hildebrandt29c63c92021-02-05 14:58:50 +0000105 - "--mib_audit_interval={{ .Values.global.mib_audit.interval }}"
Himani Chawlae3454912021-03-15 19:23:49 +0530106 - "--alarm_audit_interval={{ .Values.global.alarm_audit.interval }}"
Matteo Scandolo60b9c252021-06-10 17:21:08 +0200107 - "--uni_port_mask={{ .Values.adapter_open_onu.uni_port_mask }}"
Praneeth Kumar Nalmas5cd48d72024-04-17 10:37:40 +0530108 - "--skip_onu_config_enabled={{ .Values.global.skip_onu_config.enabled }}"
David Bainbridge2bdd4302020-06-09 17:13:18 -0700109 {{- if .Values.securityContext.enabled }}
110 securityContext:
111 allowPrivilegeEscalation: false
112 {{- end }}
khenaidoo15c53fb2021-08-09 13:56:27 -0400113 ports:
114 - containerPort: {{ .Values.adapter_open_onu.endpoints.port }}
115 name: grpc
Holger Hildebrandtb67c3302020-02-25 13:48:59 +0000116 livenessProbe:
117 httpGet:
118 path: /healthz
119 port: 8080
khenaidoo15c53fb2021-08-09 13:56:27 -0400120 initialDelaySeconds: {{ .Values.probe.liveness.initial_delay_seconds }}
121 periodSeconds: {{ .Values.probe.liveness.period_seconds }}
Holger Hildebrandtb67c3302020-02-25 13:48:59 +0000122 readinessProbe:
123 httpGet:
124 path: /readz
125 port: 8080
khenaidoo15c53fb2021-08-09 13:56:27 -0400126 initialDelaySeconds: {{ .Values.probe.readiness.initial_delay_seconds }}
127 periodSeconds: {{ .Values.probe.readiness.period_seconds }}
Andrey Pozolotin7e928a92021-08-13 12:37:24 +0200128 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 }}
Andrey Pozolotinda75c922021-08-24 17:41:08 +0200143 affinity:
144 podAffinity:
145 preferredDuringSchedulingIgnoredDuringExecution:
146 {{- if .Values.scheduleRules.preferStackPodsOnSameNode }}
147 - podAffinityTerm:
148 topologyKey: kubernetes.io/hostname
149 labelSelector:
150 matchExpressions:
151 - key: app.kubernetes.io/stack
152 operator: In
153 values:
154 - {{ .Values.global.stack_name }}
155 weight: 100
156 {{- end }}
157 podAntiAffinity:
158 preferredDuringSchedulingIgnoredDuringExecution:
159 {{- if .Values.scheduleRules.preferStacksOnDifferentNodes }}
160 - podAffinityTerm:
161 topologyKey: kubernetes.io/hostname
162 labelSelector:
163 matchExpressions:
164 - key: app.kubernetes.io/name
165 operator: In
166 values:
167 - adapter-open-onu
168 weight: 100
169 {{- end }}