blob: ab37ca3020a9d5f84ce0e10d20c0a7e3d88fd1bc [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 }}
David Bainbridgecd30e542019-05-31 20:52:56 +000068 containers:
69 - name: adapter-open-olt
David Bainbridge03706e62019-10-18 17:59:24 +000070 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 +000071 imagePullPolicy: {{ tpl .Values.images.adapter_open_olt.pullPolicy . }}
David Bainbridge8595b3b2020-06-05 12:23:05 -070072 env:
divyadesai423be072020-02-20 12:05:01 +000073 - name: COMPONENT_NAME
74 valueFrom:
75 fieldRef:
76 fieldPath: metadata.labels['app.kubernetes.io/name']
serkant.uluderyaf1b8cc72020-05-13 23:26:51 -070077 - name: KV_STORE_DATAPATH_PREFIX
78 value: {{ .Values.defaults.kv_store_data_prefix }}
David Bainbridgecd30e542019-05-31 20:52:56 +000079 args:
David Bainbridge6a43d8d2019-06-18 19:09:09 +000080 - "/app/openolt"
81 - "--kafka_adapter_host={{ .Values.services.kafka.adapter.service }}"
82 - "--kafka_adapter_port={{ .Values.services.kafka.adapter.port }}"
83 - "--kafka_cluster_host={{ .Values.services.kafka.cluster.service }}"
84 - "--kafka_cluster_port={{ .Values.services.kafka.cluster.port }}"
serkant.uluderyaf1b8cc72020-05-13 23:26:51 -070085 - "--core_topic={{ .Values.defaults.topics.core_topic }}"
86 - "--adapter_topic={{ .Values.defaults.topics.adapter_open_olt_topic }}"
David Bainbridge6a43d8d2019-06-18 19:09:09 +000087 - "--kv_store_host={{ .Values.services.etcd.service }}"
88 - "--kv_store_port={{ .Values.services.etcd.port }}"
Matteo Scandoloc250ddd2019-12-12 13:34:27 -080089 - "--log_level={{ $log_level }}"
serkant.uluderyaf1b8cc72020-05-13 23:26:51 -070090 - "--current_replica={{ .Values.replicas.current_replica }}"
91 - "--total_replica={{ .Values.replicas.total_replica }}"
Rohan Agrawal69303562019-10-22 12:24:58 +000092 - "--probe_port=8080"
David Bainbridge2bdd4302020-06-09 17:13:18 -070093 {{- if .Values.securityContext.enabled }}
94 securityContext:
95 allowPrivilegeEscalation: false
96 {{- end }}
Rohan Agrawal69303562019-10-22 12:24:58 +000097 livenessProbe:
98 httpGet:
99 path: /healthz
100 port: 8080
101 initialDelaySeconds: 10
102 periodSeconds: 5
103 readinessProbe:
104 httpGet:
105 path: /readz
106 port: 8080
107 initialDelaySeconds: 10
108 periodSeconds: 5