blob: ef3b3a23fbc734a3f6b4f54f3043b6296372ce49 [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.
serkant.uluderyacb549df2020-03-29 16:19:13 -070014{{- $root := . -}}
15{{- if not (and (hasKey .Values "use_openonu_adapter_go") .Values.use_openonu_adapter_go) }}
serkant.uluderyacb549df2020-03-29 16:19:13 -070016{{- $tag := tpl ( tpl .Values.images.adapter_open_onu.tag . ) . }}
17{{- $repository := tpl .Values.images.adapter_open_onu.repository . }}
18{{- $registry := tpl .Values.images.adapter_open_onu.registry . }}
19{{- $pullpolicy := tpl .Values.images.adapter_open_onu.pullPolicy . }}
Rohan Agrawal781b33f2020-03-09 12:50:06 +000020{{- $log_level := tpl .Values.adapter_open_onu.log_level . | upper }}
serkant.uluderyacb549df2020-03-29 16:19:13 -070021{{- $replica_id := 0 }}
22{{- range $i, $e := until (int .Values.replicas.adapter_open_onu) }}
23{{- $replica_id := add1 $i }}
24
25---
Rohan Agrawal781b33f2020-03-09 12:50:06 +000026
David Bainbridgecd30e542019-05-31 20:52:56 +000027apiVersion: apps/v1
28kind: Deployment
29metadata:
serkant.uluderyacb549df2020-03-29 16:19:13 -070030 name: adapter-open-onu-{{ $replica_id }}
31 namespace: {{ $root.Release.Namespace }}
32 {{- if or (hasKey $root.Values "extra_deployment_labels") (hasKey $root.Values "openonu_deployment_labels") }}
David Bainbridge534a73d2019-08-30 18:57:23 +000033 labels:
serkant.uluderyacb549df2020-03-29 16:19:13 -070034 {{- if hasKey $root.Values "extra_deployment_labels" }}
35 {{- range $key, $val := $root.Values.extra_deployment_labels }}
David Bainbridge534a73d2019-08-30 18:57:23 +000036 {{ $key }}: {{ $val | quote }}
37 {{- end }}
38 {{- end }}
serkant.uluderyacb549df2020-03-29 16:19:13 -070039 {{- if hasKey $root.Values "openonu_deployment_labels" }}
40 {{- range $key, $val := $root.Values.openonu_deployment_labels }}
David Bainbridge534a73d2019-08-30 18:57:23 +000041 {{ $key }}: {{ $val | quote }}
42 {{- end }}
43 {{- end }}
44 {{- end }}
David Bainbridgecd30e542019-05-31 20:52:56 +000045spec:
serkant.uluderyacb549df2020-03-29 16:19:13 -070046 replicas: 1
David Bainbridgecd30e542019-05-31 20:52:56 +000047 selector:
48 matchLabels:
49 app: adapter-open-onu
50 template:
51 metadata:
52 labels:
53 app: adapter-open-onu
David Bainbridge1f888042019-06-24 18:02:01 +000054 app.kubernetes.io/name: "adapter-open-onu"
serkant.uluderyacb549df2020-03-29 16:19:13 -070055 app.kubernetes.io/version: {{ quote $root.Chart.AppVersion }}
David Bainbridge1f888042019-06-24 18:02:01 +000056 app.kubernetes.io/component: "adapter"
57 app.kubernetes.io/part-of: "voltha"
serkant.uluderyacb549df2020-03-29 16:19:13 -070058 app.kubernetes.io/managed-by: {{ quote $root.Release.Service }}
59 helm.sh/chart: "{{ $root.Chart.Name }}-{{ $root.Chart.Version }}"
60 {{- if hasKey $root.Values "extra_pod_labels" }}
61 {{- range $key, $val := $root.Values.extra_pod_labels }}
David Bainbridge534a73d2019-08-30 18:57:23 +000062 {{ $key }}: {{ $val | quote }}
63 {{- end }}
64 {{- end }}
serkant.uluderyacb549df2020-03-29 16:19:13 -070065 {{- if hasKey $root.Values "openonu_pod_labels" }}
66 {{- range $key, $val := $root.Values.openonu_pod_labels }}
David Bainbridge534a73d2019-08-30 18:57:23 +000067 {{ $key }}: {{ $val | quote }}
68 {{- end }}
69 {{- end }}
David Bainbridgecd30e542019-05-31 20:52:56 +000070 annotations:
71 cni: "calico"
72 spec:
73 containers:
74 - name: adapter-open-onu
serkant.uluderyacb549df2020-03-29 16:19:13 -070075 image: '{{ $registry }}{{ $repository }}:{{ $tag }}'
76 imagePullPolicy: {{ $pullpolicy }}
Rohan Agrawal6b94c352020-03-25 20:42:27 +000077 env:
78 - name: COMPONENT_NAME
79 valueFrom:
80 fieldRef:
81 fieldPath: metadata.labels['app.kubernetes.io/name']
serkant.uluderyacb549df2020-03-29 16:19:13 -070082 image: '{{ $registry }}{{ $repository }}:{{ $tag }}'
David Bainbridgecd30e542019-05-31 20:52:56 +000083 args:
84 - "/voltha/adapters/brcm_openomci_onu/main.py"
serkant.uluderyacb549df2020-03-29 16:19:13 -070085 - "--kafka_adapter={{ $root.Values.services.kafka.adapter.service }}:{{ $root.Values.services.kafka.adapter.port }}"
86 - "--kafka_cluster={{ $root.Values.services.kafka.cluster.service }}:{{ $root.Values.services.kafka.cluster.port }}"
David Bainbridgecd30e542019-05-31 20:52:56 +000087 - "--core_topic=rwcore"
serkant.uluderya6ec764e2019-07-12 00:03:28 +030088 - "--name=brcm_openomci_onu"
David Bainbridgecd30e542019-05-31 20:52:56 +000089 - "--backend=etcd"
serkant.uluderyacb549df2020-03-29 16:19:13 -070090 - "--etcd={{ $root.Values.services.etcd.service }}:{{ $root.Values.services.etcd.port }}"
Rohan Agrawal626f1852019-11-21 04:41:10 +000091 - "--probe=:8080"
Rohan Agrawal781b33f2020-03-09 12:50:06 +000092 - "--log_level={{ $log_level }}"
serkant.uluderyacb549df2020-03-29 16:19:13 -070093 - "--totalReplicas={{ $root.Values.replicas.adapter_open_onu }}"
94 - "--currentReplica={{ $replica_id }}"
Rohan Agrawal626f1852019-11-21 04:41:10 +000095 readinessProbe:
96 httpGet:
97 path: /readz
98 port: 8080
99 initialDelaySeconds: 10
100 periodSeconds: 5
101 livenessProbe:
102 httpGet:
103 path: /healthz
104 port: 8080
105 initialDelaySeconds: 10
106 periodSeconds: 5
serkant.uluderyacb549df2020-03-29 16:19:13 -0700107
Rohan Agrawal781b33f2020-03-09 12:50:06 +0000108{{- end }}
Matteo Scandolo1fc6ce12020-04-15 10:27:40 -0700109{{- end }} # end if use_openonu_adapter_go