blob: 672f2b670dde3200af5a4851458c7153fbb003af [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.
Matteo Scandolo1d7ab922019-12-10 13:41:23 -080014{{- $log_level := 3 }}
15{{- $set_log_level := tpl .Values.adapter_open_olt.log_level . | upper }}
16{{- if eq $set_log_level "DEBUG" }}
17{{- $log_level = 0 }}
18{{- else if eq $set_log_level "INFO" }}
19{{- $log_level = 1 }}
20{{- else if eq $set_log_level "WARN" }}
21{{- $log_level = 2 }}
22{{- else if eq $set_log_level "ERROR" }}
23{{- $log_level = 3 }}
24{{- else if eq $set_log_level "PANIC" }}
25{{- $log_level = 4 }}
26{{- else if eq $set_log_level "FATAL" }}
27{{- $log_level = 5 }}
28{{- else }}
29{{- $log_level = 3 }}
30{{- end }}
David Bainbridgecd30e542019-05-31 20:52:56 +000031
32apiVersion: apps/v1
33kind: Deployment
34metadata:
35 name: adapter-open-olt
36 namespace: {{ .Release.Namespace }}
David Bainbridge534a73d2019-08-30 18:57:23 +000037 {{- if or (hasKey .Values "extra_deployment_labels") (hasKey .Values "openolt_deployment_labels") }}
38 labels:
39 {{- if hasKey .Values "extra_deployment_labels" }}
40 {{- range $key, $val := .Values.extra_deployment_labels }}
41 {{ $key }}: {{ $val | quote }}
42 {{- end }}
43 {{- end }}
44 {{- if hasKey .Values "openolt_deployment_labels" }}
45 {{- range $key, $val := .Values.openolt_deployment_labels }}
46 {{ $key }}: {{ $val | quote }}
47 {{- end }}
48 {{- end }}
49 {{- end }}
David Bainbridgecd30e542019-05-31 20:52:56 +000050spec:
51 replicas: {{ .Values.replicas.adapter_open_olt }}
52 selector:
53 matchLabels:
54 app: adapter-open-olt
55 template:
56 metadata:
57 labels:
58 app: adapter-open-olt
David Bainbridge1f888042019-06-24 18:02:01 +000059 app.kubernetes.io/name: "adapter-open-olt"
60 app.kubernetes.io/version: {{ quote .Chart.AppVersion }}
61 app.kubernetes.io/component: "adapter"
62 app.kubernetes.io/part-of: "voltha"
63 app.kubernetes.io/managed-by: {{ quote .Release.Service }}
64 helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
David Bainbridge534a73d2019-08-30 18:57:23 +000065 {{- if hasKey .Values "extra_pod_labels" }}
66 {{- range $key, $val := .Values.extra_pod_labels }}
67 {{ $key }}: {{ $val | quote }}
68 {{- end }}
69 {{- end }}
70 {{- if hasKey .Values "openolt_pod_labels" }}
71 {{- range $key, $val := .Values.openolt_pod_labels }}
72 {{ $key }}: {{ $val | quote }}
73 {{- end }}
74 {{- end }}
David Bainbridgecd30e542019-05-31 20:52:56 +000075 annotations:
76 cni: "calico"
77 spec:
78 containers:
79 - name: adapter-open-olt
David Bainbridge03706e62019-10-18 17:59:24 +000080 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 +000081 imagePullPolicy: {{ tpl .Values.images.adapter_open_olt.pullPolicy . }}
82 args:
David Bainbridge6a43d8d2019-06-18 19:09:09 +000083 - "/app/openolt"
84 - "--kafka_adapter_host={{ .Values.services.kafka.adapter.service }}"
85 - "--kafka_adapter_port={{ .Values.services.kafka.adapter.port }}"
86 - "--kafka_cluster_host={{ .Values.services.kafka.cluster.service }}"
87 - "--kafka_cluster_port={{ .Values.services.kafka.cluster.port }}"
88 - "--core_topic=rwcore"
89 - "--kv_store_host={{ .Values.services.etcd.service }}"
90 - "--kv_store_port={{ .Values.services.etcd.port }}"
Matteo Scandoloc250ddd2019-12-12 13:34:27 -080091 - "--log_level={{ $log_level }}"
Rohan Agrawal69303562019-10-22 12:24:58 +000092 - "--probe_port=8080"
93 livenessProbe:
94 httpGet:
95 path: /healthz
96 port: 8080
97 initialDelaySeconds: 10
98 periodSeconds: 5
99 readinessProbe:
100 httpGet:
101 path: /readz
102 port: 8080
103 initialDelaySeconds: 10
104 periodSeconds: 5