blob: 55feb6d25a7eb506d8bdf20e5100bad2eddd3ee9 [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"
49 app.kubernetes.io/managed-by: {{ quote .Release.Service }}
50 helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
David Bainbridge534a73d2019-08-30 18:57:23 +000051 {{- if hasKey .Values "extra_pod_labels" }}
52 {{- range $key, $val := .Values.extra_pod_labels }}
53 {{ $key }}: {{ $val | quote }}
54 {{- end }}
55 {{- end }}
56 {{- if hasKey .Values "openolt_pod_labels" }}
57 {{- range $key, $val := .Values.openolt_pod_labels }}
58 {{ $key }}: {{ $val | quote }}
59 {{- end }}
60 {{- end }}
David Bainbridgecd30e542019-05-31 20:52:56 +000061 spec:
David Bainbridge8595b3b2020-06-05 12:23:05 -070062 {{- if .Values.securityContext.enabled }}
63 securityContext:
64 runAsUser: {{ .Values.securityContext.runAsUser }}
65 runAsGroup: {{ .Values.securityContext.runAsGroup }}
66 fsGroup: {{ .Values.securityContext.fsGroup }}
67 {{- end }}
Girish Gowdra12231512020-06-29 13:00:48 -070068 {{- if .Values.nodeAffinityConfig.enabled }}
69 affinity:
70 nodeAffinity:
71 requiredDuringSchedulingIgnoredDuringExecution:
72 nodeSelectorTerms:
73 - matchExpressions:
74 - key: "{{ .Values.nodeAffinityConfig.node_label_key }}"
75 operator: In
76 values:
77 - "{{ .Values.nodeAffinityConfig.node_label_value }}"
78 {{- end }}
David Bainbridgecd30e542019-05-31 20:52:56 +000079 containers:
80 - name: adapter-open-olt
David Bainbridge03706e62019-10-18 17:59:24 +000081 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 +000082 imagePullPolicy: {{ tpl .Values.images.adapter_open_olt.pullPolicy . }}
David Bainbridge8595b3b2020-06-05 12:23:05 -070083 env:
divyadesai423be072020-02-20 12:05:01 +000084 - name: COMPONENT_NAME
85 valueFrom:
86 fieldRef:
87 fieldPath: metadata.labels['app.kubernetes.io/name']
serkant.uluderyaf1b8cc72020-05-13 23:26:51 -070088 - name: KV_STORE_DATAPATH_PREFIX
89 value: {{ .Values.defaults.kv_store_data_prefix }}
David Bainbridgecd30e542019-05-31 20:52:56 +000090 args:
David Bainbridge6a43d8d2019-06-18 19:09:09 +000091 - "/app/openolt"
Neha Sharma1a3da1c2020-06-24 13:12:48 +000092 - "--kafka_adapter_address={{ .Values.services.kafka.adapter.address }}"
93 - "--kafka_cluster_address={{ .Values.services.kafka.cluster.address }}"
serkant.uluderyaf1b8cc72020-05-13 23:26:51 -070094 - "--core_topic={{ .Values.defaults.topics.core_topic }}"
95 - "--adapter_topic={{ .Values.defaults.topics.adapter_open_olt_topic }}"
Neha Sharma1a3da1c2020-06-24 13:12:48 +000096 - "--kv_store_address={{ .Values.services.etcd.address }}"
Matteo Scandoloc250ddd2019-12-12 13:34:27 -080097 - "--log_level={{ $log_level }}"
serkant.uluderyaf1b8cc72020-05-13 23:26:51 -070098 - "--current_replica={{ .Values.replicas.current_replica }}"
99 - "--total_replica={{ .Values.replicas.total_replica }}"
Neha Sharma7d3d6be2020-05-14 20:02:17 +0000100 - "--probe_address=:8080"
Girish Kumar877af922020-07-31 06:05:32 +0000101 - "--trace_enabled={{ .Values.tracing.enabled }}"
102 - "--trace_agent_address={{ .Values.services.tracing_agent.address }}"
103 - "--log_correlation_enabled={{ .Values.log_correlation.enabled }}"
kesavand00d081e2020-08-31 11:47:44 +0530104 - "--omcc_encryption={{ .Values.defaults.omcc_encryption }}"
David Bainbridge2bdd4302020-06-09 17:13:18 -0700105 {{- if .Values.securityContext.enabled }}
106 securityContext:
107 allowPrivilegeEscalation: false
108 {{- end }}
Rohan Agrawal69303562019-10-22 12:24:58 +0000109 livenessProbe:
110 httpGet:
111 path: /healthz
112 port: 8080
113 initialDelaySeconds: 10
114 periodSeconds: 5
115 readinessProbe:
116 httpGet:
117 path: /readz
118 port: 8080
119 initialDelaySeconds: 10
120 periodSeconds: 5