blob: 623c2808774ac9066a78a1533a2b3f66703ca20b [file] [log] [blame]
David Bainbridgecd30e542019-05-31 20:52:56 +00001# Copyright 2019-present Open Networking Foundation
2#
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 Agrawale2f4a1e2020-02-04 06:28:36 +000014{{- $log_level := tpl .Values.adapter_open_olt.log_level . | upper }}
Matteo Scandoloe9a01f72020-05-05 09:33:59 -070015---
David Bainbridgecd30e542019-05-31 20:52:56 +000016apiVersion: apps/v1
17kind: Deployment
18metadata:
David Bainbridge2bdd4302020-06-09 17:13:18 -070019 name: "{{ template "fullname" . }}"
David Bainbridgecd30e542019-05-31 20:52:56 +000020 namespace: {{ .Release.Namespace }}
David Bainbridge534a73d2019-08-30 18:57:23 +000021 {{- if or (hasKey .Values "extra_deployment_labels") (hasKey .Values "openolt_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 "openolt_deployment_labels" }}
29 {{- range $key, $val := .Values.openolt_deployment_labels }}
30 {{ $key }}: {{ $val | quote }}
31 {{- end }}
32 {{- end }}
33 {{- end }}
David Bainbridgecd30e542019-05-31 20:52:56 +000034spec:
David Bainbridgecd30e542019-05-31 20:52:56 +000035 selector:
36 matchLabels:
37 app: adapter-open-olt
David Bainbridge8595b3b2020-06-05 12:23:05 -070038 release: {{ .Release.Name }}
David Bainbridgecd30e542019-05-31 20:52:56 +000039 template:
40 metadata:
David Bainbridge8595b3b2020-06-05 12:23:05 -070041 namespace: {{ .Release.Namespace }}
David Bainbridgecd30e542019-05-31 20:52:56 +000042 labels:
43 app: adapter-open-olt
David Bainbridge8595b3b2020-06-05 12:23:05 -070044 release: {{ .Release.Name }}
David Bainbridge1f888042019-06-24 18:02:01 +000045 app.kubernetes.io/name: "adapter-open-olt"
46 app.kubernetes.io/version: {{ quote .Chart.AppVersion }}
47 app.kubernetes.io/component: "adapter"
48 app.kubernetes.io/part-of: "voltha"
Matteo Scandolob4c5f4e2020-11-11 12:05:23 -080049 app.kubernetes.io/stack: "{{ .Values.global.stack_name }}"
David Bainbridge1f888042019-06-24 18:02:01 +000050 app.kubernetes.io/managed-by: {{ quote .Release.Service }}
51 helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
David Bainbridge534a73d2019-08-30 18:57:23 +000052 {{- if hasKey .Values "extra_pod_labels" }}
53 {{- range $key, $val := .Values.extra_pod_labels }}
54 {{ $key }}: {{ $val | quote }}
55 {{- end }}
56 {{- end }}
57 {{- if hasKey .Values "openolt_pod_labels" }}
58 {{- range $key, $val := .Values.openolt_pod_labels }}
59 {{ $key }}: {{ $val | quote }}
60 {{- end }}
61 {{- end }}
David Bainbridgecd30e542019-05-31 20:52:56 +000062 spec:
David Bainbridge8595b3b2020-06-05 12:23:05 -070063 {{- if .Values.securityContext.enabled }}
64 securityContext:
65 runAsUser: {{ .Values.securityContext.runAsUser }}
66 runAsGroup: {{ .Values.securityContext.runAsGroup }}
67 fsGroup: {{ .Values.securityContext.fsGroup }}
68 {{- end }}
Girish Gowdra12231512020-06-29 13:00:48 -070069 {{- if .Values.nodeAffinityConfig.enabled }}
70 affinity:
71 nodeAffinity:
72 requiredDuringSchedulingIgnoredDuringExecution:
73 nodeSelectorTerms:
74 - matchExpressions:
75 - key: "{{ .Values.nodeAffinityConfig.node_label_key }}"
76 operator: In
77 values:
78 - "{{ .Values.nodeAffinityConfig.node_label_value }}"
79 {{- end }}
David Bainbridgecd30e542019-05-31 20:52:56 +000080 containers:
81 - name: adapter-open-olt
David Bainbridge03706e62019-10-18 17:59:24 +000082 image: '{{ tpl .Values.images.adapter_open_olt.registry . }}{{ tpl .Values.images.adapter_open_olt.repository . }}:{{ tpl ( tpl .Values.images.adapter_open_olt.tag . ) . }}'
David Bainbridgecd30e542019-05-31 20:52:56 +000083 imagePullPolicy: {{ tpl .Values.images.adapter_open_olt.pullPolicy . }}
David Bainbridge8595b3b2020-06-05 12:23:05 -070084 env:
divyadesai423be072020-02-20 12:05:01 +000085 - name: COMPONENT_NAME
86 valueFrom:
87 fieldRef:
88 fieldPath: metadata.labels['app.kubernetes.io/name']
serkant.uluderyaf1b8cc72020-05-13 23:26:51 -070089 - name: KV_STORE_DATAPATH_PREFIX
Matteo Scandolob4c5f4e2020-11-11 12:05:23 -080090 value: {{ tpl .Values.adapter_open_olt.kv_store_data_prefix . }}
David Bainbridgecd30e542019-05-31 20:52:56 +000091 args:
David Bainbridge6a43d8d2019-06-18 19:09:09 +000092 - "/app/openolt"
Matteo Scandolob4c5f4e2020-11-11 12:05:23 -080093 - "--kafka_adapter_address={{ tpl .Values.services.kafka.adapter.address . }}"
94 - "--kafka_cluster_address={{ tpl .Values.services.kafka.cluster.address . }}"
95 - "--core_topic={{ tpl .Values.adapter_open_olt.topics.core_topic . }}"
96 - "--adapter_topic={{ tpl .Values.adapter_open_olt.topics.adapter_open_olt_topic . }}"
Matteo Scandolo06ee58c2021-05-26 15:28:51 -070097 - "--event_topic={{ .Values.adapter_open_olt.topics.event_topic }}"
Matteo Scandolob4c5f4e2020-11-11 12:05:23 -080098 - "--kv_store_address={{ tpl .Values.services.etcd.address . }}"
Andrea Campanella6838a802020-11-19 15:50:23 +010099 - "--kv_store_request_timeout={{ tpl .Values.adapter_open_olt.kv_store_timeout . }}"
Girish Gowdrae8c44bd2021-03-17 10:30:44 -0700100 - "--heartbeat_check_interval={{ tpl .Values.adapter_open_olt.heartbeat_check_interval . }}"
101 - "--heartbeat_fail_interval={{ tpl .Values.adapter_open_olt.heartbeat_fail_interval . }}"
Matteo Scandoloc250ddd2019-12-12 13:34:27 -0800102 - "--log_level={{ $log_level }}"
serkant.uluderyaf1b8cc72020-05-13 23:26:51 -0700103 - "--current_replica={{ .Values.replicas.current_replica }}"
104 - "--total_replica={{ .Values.replicas.total_replica }}"
Neha Sharma7d3d6be2020-05-14 20:02:17 +0000105 - "--probe_address=:8080"
Matteo Scandolob4c5f4e2020-11-11 12:05:23 -0800106 - "--trace_enabled={{ .Values.global.tracing.enabled }}"
107 - "--trace_agent_address={{ tpl .Values.services.tracing_agent.address . }}"
108 - "--log_correlation_enabled={{ .Values.global.log_correlation.enabled }}"
109 - "--omcc_encryption={{ .Values.global.omcc_encryption }}"
Gamze Abakaba10c7b2020-12-17 14:37:25 +0000110 - "--enable_onu_stats={{ .Values.global.enable_onu_stats }}"
111 - "--enable_gem_stats={{ .Values.global.enable_gem_stats }}"
David Bainbridge2bdd4302020-06-09 17:13:18 -0700112 {{- if .Values.securityContext.enabled }}
113 securityContext:
114 allowPrivilegeEscalation: false
115 {{- end }}
Rohan Agrawal69303562019-10-22 12:24:58 +0000116 livenessProbe:
117 httpGet:
118 path: /healthz
119 port: 8080
120 initialDelaySeconds: 10
121 periodSeconds: 5
122 readinessProbe:
123 httpGet:
124 path: /readz
125 port: 8080
126 initialDelaySeconds: 10
127 periodSeconds: 5
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 }}