blob: 90c7830fdf9e10cd0c0abe0990cb3400dbe7e28d [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) }}
16{{- end }}
17{{- $tag := tpl ( tpl .Values.images.adapter_open_onu.tag . ) . }}
18{{- $repository := tpl .Values.images.adapter_open_onu.repository . }}
19{{- $registry := tpl .Values.images.adapter_open_onu.registry . }}
20{{- $pullpolicy := tpl .Values.images.adapter_open_onu.pullPolicy . }}
Rohan Agrawal781b33f2020-03-09 12:50:06 +000021{{- $log_level := tpl .Values.adapter_open_onu.log_level . | upper }}
serkant.uluderyacb549df2020-03-29 16:19:13 -070022{{- $replica_id := 0 }}
23{{- range $i, $e := until (int .Values.replicas.adapter_open_onu) }}
24{{- $replica_id := add1 $i }}
25
26---
Rohan Agrawal781b33f2020-03-09 12:50:06 +000027
David Bainbridgecd30e542019-05-31 20:52:56 +000028apiVersion: apps/v1
29kind: Deployment
30metadata:
serkant.uluderyacb549df2020-03-29 16:19:13 -070031 name: adapter-open-onu-{{ $replica_id }}
32 namespace: {{ $root.Release.Namespace }}
33 {{- if or (hasKey $root.Values "extra_deployment_labels") (hasKey $root.Values "openonu_deployment_labels") }}
David Bainbridge534a73d2019-08-30 18:57:23 +000034 labels:
serkant.uluderyacb549df2020-03-29 16:19:13 -070035 {{- if hasKey $root.Values "extra_deployment_labels" }}
36 {{- range $key, $val := $root.Values.extra_deployment_labels }}
David Bainbridge534a73d2019-08-30 18:57:23 +000037 {{ $key }}: {{ $val | quote }}
38 {{- end }}
39 {{- end }}
serkant.uluderyacb549df2020-03-29 16:19:13 -070040 {{- if hasKey $root.Values "openonu_deployment_labels" }}
41 {{- range $key, $val := $root.Values.openonu_deployment_labels }}
David Bainbridge534a73d2019-08-30 18:57:23 +000042 {{ $key }}: {{ $val | quote }}
43 {{- end }}
44 {{- end }}
45 {{- end }}
David Bainbridgecd30e542019-05-31 20:52:56 +000046spec:
serkant.uluderyacb549df2020-03-29 16:19:13 -070047 replicas: 1
David Bainbridgecd30e542019-05-31 20:52:56 +000048 selector:
49 matchLabels:
50 app: adapter-open-onu
51 template:
52 metadata:
53 labels:
54 app: adapter-open-onu
David Bainbridge1f888042019-06-24 18:02:01 +000055 app.kubernetes.io/name: "adapter-open-onu"
serkant.uluderyacb549df2020-03-29 16:19:13 -070056 app.kubernetes.io/version: {{ quote $root.Chart.AppVersion }}
David Bainbridge1f888042019-06-24 18:02:01 +000057 app.kubernetes.io/component: "adapter"
58 app.kubernetes.io/part-of: "voltha"
serkant.uluderyacb549df2020-03-29 16:19:13 -070059 app.kubernetes.io/managed-by: {{ quote $root.Release.Service }}
60 helm.sh/chart: "{{ $root.Chart.Name }}-{{ $root.Chart.Version }}"
61 {{- if hasKey $root.Values "extra_pod_labels" }}
62 {{- range $key, $val := $root.Values.extra_pod_labels }}
David Bainbridge534a73d2019-08-30 18:57:23 +000063 {{ $key }}: {{ $val | quote }}
64 {{- end }}
65 {{- end }}
serkant.uluderyacb549df2020-03-29 16:19:13 -070066 {{- if hasKey $root.Values "openonu_pod_labels" }}
67 {{- range $key, $val := $root.Values.openonu_pod_labels }}
David Bainbridge534a73d2019-08-30 18:57:23 +000068 {{ $key }}: {{ $val | quote }}
69 {{- end }}
70 {{- end }}
David Bainbridgecd30e542019-05-31 20:52:56 +000071 annotations:
72 cni: "calico"
73 spec:
74 containers:
75 - name: adapter-open-onu
serkant.uluderyacb549df2020-03-29 16:19:13 -070076 image: '{{ $registry }}{{ $repository }}:{{ $tag }}'
77 imagePullPolicy: {{ $pullpolicy }}
Rohan Agrawal6b94c352020-03-25 20:42:27 +000078 env:
79 - name: COMPONENT_NAME
80 valueFrom:
81 fieldRef:
82 fieldPath: metadata.labels['app.kubernetes.io/name']
serkant.uluderyacb549df2020-03-29 16:19:13 -070083 image: '{{ $registry }}{{ $repository }}:{{ $tag }}'
David Bainbridgecd30e542019-05-31 20:52:56 +000084 args:
85 - "/voltha/adapters/brcm_openomci_onu/main.py"
serkant.uluderyacb549df2020-03-29 16:19:13 -070086 - "--kafka_adapter={{ $root.Values.services.kafka.adapter.service }}:{{ $root.Values.services.kafka.adapter.port }}"
87 - "--kafka_cluster={{ $root.Values.services.kafka.cluster.service }}:{{ $root.Values.services.kafka.cluster.port }}"
David Bainbridgecd30e542019-05-31 20:52:56 +000088 - "--core_topic=rwcore"
serkant.uluderya6ec764e2019-07-12 00:03:28 +030089 - "--name=brcm_openomci_onu"
David Bainbridgecd30e542019-05-31 20:52:56 +000090 - "--backend=etcd"
serkant.uluderyacb549df2020-03-29 16:19:13 -070091 - "--etcd={{ $root.Values.services.etcd.service }}:{{ $root.Values.services.etcd.port }}"
Rohan Agrawal626f1852019-11-21 04:41:10 +000092 - "--probe=:8080"
Rohan Agrawal781b33f2020-03-09 12:50:06 +000093 - "--log_level={{ $log_level }}"
serkant.uluderyacb549df2020-03-29 16:19:13 -070094 - "--totalReplicas={{ $root.Values.replicas.adapter_open_onu }}"
95 - "--currentReplica={{ $replica_id }}"
Rohan Agrawal626f1852019-11-21 04:41:10 +000096 readinessProbe:
97 httpGet:
98 path: /readz
99 port: 8080
100 initialDelaySeconds: 10
101 periodSeconds: 5
102 livenessProbe:
103 httpGet:
104 path: /healthz
105 port: 8080
106 initialDelaySeconds: 10
107 periodSeconds: 5
serkant.uluderyacb549df2020-03-29 16:19:13 -0700108
Rohan Agrawal781b33f2020-03-09 12:50:06 +0000109{{- end }}