blob: 1fb5e03ce6605180743b287f78cd8b9c60ddd8ba [file] [log] [blame]
Joey Armstrong8cd89ae2024-02-10 16:58:02 -05001# Copyright 2019-2024 Open Networking Foundation (ONF) and the ONF Contributors
David Bainbridge2f9b76f2019-05-15 13:48:11 -07002#
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.
Rohan Agrawal250ec822020-01-14 12:16:18 +000014{{- $log_level := tpl .Values.rw_core.log_level . | upper }}
Kent Hagerman1b333b92019-07-22 16:57:20 -040015---
David Bainbridgec437c3e2020-06-25 14:48:24 -070016apiVersion: apps/v1
David Bainbridge2f9b76f2019-05-15 13:48:11 -070017kind: Deployment
18metadata:
David Bainbridge2bdd4302020-06-09 17:13:18 -070019 name: "{{ template "fullname" . }}-rw-core"
David Bainbridge8595b3b2020-06-05 12:23:05 -070020 namespace: {{ .Release.Namespace }}
Scott Baker5b2eaa82019-12-17 11:24:00 -080021 {{- if or (hasKey .Values "extra_deployment_labels") (hasKey .Values "rw_core_deployment_labels") }}
David Bainbridge534a73d2019-08-30 18:57:23 +000022 labels:
Scott Baker5b2eaa82019-12-17 11:24:00 -080023 {{- if hasKey .Values "extra_deployment_labels" }}
24 {{- range $key, $val := .Values.extra_deployment_labels }}
David Bainbridge534a73d2019-08-30 18:57:23 +000025 {{ $key }}: {{ $val | quote }}
26 {{- end }}
27 {{- end }}
Scott Baker5b2eaa82019-12-17 11:24:00 -080028 {{- if hasKey .Values "rw_core_deployment_labels" }}
29 {{- range $key, $val := .Values.rw_core_deployment_labels }}
David Bainbridge534a73d2019-08-30 18:57:23 +000030 {{ $key }}: {{ $val | quote }}
31 {{- end }}
32 {{- end }}
33 {{- end }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070034spec:
35 replicas: 1
David Bainbridge8595b3b2020-06-05 12:23:05 -070036 selector:
37 matchLabels:
38 app: rw-core
39 release: {{ .Release.Name }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070040 template:
41 metadata:
David Bainbridge8595b3b2020-06-05 12:23:05 -070042 namespace: {{ .Release.Namespace }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070043 labels:
44 app: rw-core
David Bainbridge8595b3b2020-06-05 12:23:05 -070045 release: {{ .Release.Name }}
David Bainbridge1f888042019-06-24 18:02:01 +000046 app.kubernetes.io/name: "read-write-core"
Scott Baker5b2eaa82019-12-17 11:24:00 -080047 app.kubernetes.io/version: {{ quote .Chart.AppVersion }}
David Bainbridge1f888042019-06-24 18:02:01 +000048 app.kubernetes.io/component: "core"
49 app.kubernetes.io/part-of: "voltha"
Matteo Scandolob4c5f4e2020-11-11 12:05:23 -080050 app.kubernetes.io/stack: "{{ .Values.global.stack_name }}"
Scott Baker5b2eaa82019-12-17 11:24:00 -080051 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 }}
David Bainbridge534a73d2019-08-30 18:57:23 +000055 {{ $key }}: {{ $val | quote }}
56 {{- end }}
57 {{- end }}
Scott Baker5b2eaa82019-12-17 11:24:00 -080058 {{- if hasKey .Values "rw_core_pod_labels" }}
59 {{- range $key, $val := .Values.rw_core_pod_labels }}
David Bainbridge534a73d2019-08-30 18:57:23 +000060 {{ $key }}: {{ $val | quote }}
61 {{- end }}
62 {{- end }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070063 spec:
David Bainbridge16b19cc2020-05-29 11:50:44 -070064 {{- if .Values.securityContext.enabled }}
65 securityContext:
66 runAsUser: {{ .Values.securityContext.runAsUser }}
67 runAsGroup: {{ .Values.securityContext.runAsGroup }}
68 fsGroup: {{ .Values.securityContext.fsGroup }}
69 {{- end }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070070 containers:
71 - name: voltha
Scott Baker5b2eaa82019-12-17 11:24:00 -080072 image: '{{ tpl .Values.images.rw_core.registry . }}{{ tpl .Values.images.rw_core.repository . }}:{{ tpl .Values.images.rw_core.tag . }}'
73 imagePullPolicy: {{ tpl .Values.images.rw_core.pullPolicy . }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070074 env:
75 - name: NAMESPACE
Scott Baker5b2eaa82019-12-17 11:24:00 -080076 value: voltha
David Bainbridge2f9b76f2019-05-15 13:48:11 -070077 - name: POD_IP
78 valueFrom:
79 fieldRef:
80 fieldPath: status.podIP
divyadesai5085aba2020-03-02 07:03:53 +000081 - name: COMPONENT_NAME
82 valueFrom:
83 fieldRef:
84 fieldPath: metadata.labels['app.kubernetes.io/name']
serkant.uluderyaf1b8cc72020-05-13 23:26:51 -070085 - name: KV_STORE_DATAPATH_PREFIX
Matteo Scandolob4c5f4e2020-11-11 12:05:23 -080086 value: {{ tpl .Values.rw_core.kv_store_data_prefix . }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070087 args:
88 - "/app/rw_core"
abhaycd295062024-12-12 11:05:07 +053089 - "--kv_store_type={{ tpl .Values.services.kvstore.type . }}"
90 - "--kv_store_address={{ tpl .Values.services.kvstore.address . }}"
khenaidoo15c53fb2021-08-09 13:56:27 -040091 - "--grpc_nbi_address=0.0.0.0:50057"
92 - "--grpc_sbi_address=0.0.0.0:50058"
David K. Bainbridgef7d4e602020-07-09 18:28:55 +000093 - "--banner"
Matteo Scandolob4c5f4e2020-11-11 12:05:23 -080094 - "--kafka_cluster_address={{ tpl .Values.services.kafka.cluster.address . }}"
khenaidoo15c53fb2021-08-09 13:56:27 -040095 - "--rpc_timeout={{ tpl .Values.rw_core.rpc_timeout . }}"
Himani Chawla81472cd2021-11-08 17:14:11 +053096 - "--flow_timeout={{ tpl .Values.rw_core.flow_timeout . }}"
khenaidoo15c53fb2021-08-09 13:56:27 -040097 - "--internal_timeout={{ tpl .Values.rw_core.internal_timeout . }}"
Matteo Scandolo06ee58c2021-05-26 15:28:51 -070098 - "--event_topic={{ .Values.rw_core.topics.event_topic }}"
David K. Bainbridgef7d4e602020-07-09 18:28:55 +000099 - "--log_level={{ $log_level }}"
100 - "--probe_address=:8080"
Matteo Scandolob4c5f4e2020-11-11 12:05:23 -0800101 - "--trace_enabled={{ .Values.global.tracing.enabled }}"
102 - "--trace_agent_address={{ tpl .Values.services.tracing_agent.address . }}"
103 - "--log_correlation_enabled={{ .Values.global.log_correlation.enabled }}"
Himani Chawlaafd8e842021-03-25 01:32:59 +0530104 - "--stack_id={{ tpl .Values.rw_core.stack_id . }}"
khenaidoo15c53fb2021-08-09 13:56:27 -0400105 - "--backoff_retry_initial_interval={{ .Values.rw_core.backoff_initial_interval }}"
106 - "--backoff_retry_max_interval={{ .Values.rw_core.backoff_max_interval }}"
107 - "--backoff_retry_max_elapsed_time={{ .Values.rw_core.backoff_max_elapsed_time }}"
akashreddyk9a1c32e2025-09-23 09:27:06 +0530108 - "--producer_retry_max={{ tpl .Values.rw_core.producer_retry_max . }}"
109 - "--metadata_retry_max={{ tpl .Values.rw_core.metadata_retry_max . }}"
David Bainbridge2f9b76f2019-05-15 13:48:11 -0700110 ports:
111 - containerPort: 50057
khenaidoo15c53fb2021-08-09 13:56:27 -0400112 name: nbi-grpc
113 - containerPort: 50058
114 name: core-grpc
David Bainbridge16b19cc2020-05-29 11:50:44 -0700115 {{- if .Values.securityContext.enabled }}
116 securityContext:
117 allowPrivilegeEscalation: false
118 {{- end }}
David Bainbridgec349f642019-09-24 19:20:47 +0000119 livenessProbe:
120 httpGet:
121 path: /healthz
122 port: 8080
khenaidoo15c53fb2021-08-09 13:56:27 -0400123 initialDelaySeconds: {{ .Values.probe.liveness.initial_delay_seconds }}
124 periodSeconds: {{ .Values.probe.liveness.period_seconds }}
David Bainbridgec349f642019-09-24 19:20:47 +0000125 readinessProbe:
126 httpGet:
127 path: /readz
128 port: 8080
khenaidoo15c53fb2021-08-09 13:56:27 -0400129 initialDelaySeconds: {{ .Values.probe.readiness.initial_delay_seconds }}
130 periodSeconds: {{ .Values.probe.readiness.period_seconds }}
Andrey Pozolotin7e928a92021-08-13 12:37:24 +0200131 resources:
132 requests:
133 {{- if .Values.resources.rw_core.requests.memory }}
134 memory: {{ .Values.resources.rw_core.requests.memory }}
135 {{- end }}
136 {{- if .Values.resources.rw_core.requests.cpu }}
137 cpu: {{ .Values.resources.rw_core.requests.cpu }}
138 {{- end }}
139 limits:
140 {{- if .Values.resources.rw_core.limits.memory }}
141 memory: {{ .Values.resources.rw_core.limits.memory }}
142 {{- end }}
143 {{- if .Values.resources.rw_core.limits.cpu }}
144 cpu: {{ .Values.resources.rw_core.limits.cpu }}
145 {{- end }}
Andrey Pozolotinda75c922021-08-24 17:41:08 +0200146 affinity:
147 podAffinity:
148 preferredDuringSchedulingIgnoredDuringExecution:
149 {{- if .Values.scheduleRules.preferStackPodsOnSameNode }}
150 - podAffinityTerm:
151 topologyKey: kubernetes.io/hostname
152 labelSelector:
153 matchExpressions:
154 - key: app.kubernetes.io/stack
155 operator: In
156 values:
157 - {{ .Values.global.stack_name }}
158 weight: 100
159 {{- end }}
160 podAntiAffinity:
161 preferredDuringSchedulingIgnoredDuringExecution:
162 {{- if .Values.scheduleRules.preferStacksOnDifferentNodes }}
163 - podAffinityTerm:
164 topologyKey: kubernetes.io/hostname
165 labelSelector:
166 matchExpressions:
167 - key: app.kubernetes.io/name
168 operator: In
169 values:
170 - read-write-core
171 weight: 100
172 {{- end }}