blob: feb566640192feb73bbd32de41a9c9483b3c6f6e [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 Scandolo50b37982020-04-23 14:04:26 -070014
serkant.uluderyacb549df2020-03-29 16:19:13 -070015{{- if not (and (hasKey .Values "use_openonu_adapter_go") .Values.use_openonu_adapter_go) }}
serkant.uluderyacb549df2020-03-29 16:19:13 -070016---
David Bainbridgecd30e542019-05-31 20:52:56 +000017apiVersion: apps/v1
Matteo Scandolo50b37982020-04-23 14:04:26 -070018kind: StatefulSet
David Bainbridgecd30e542019-05-31 20:52:56 +000019metadata:
Matteo Scandolo50b37982020-04-23 14:04:26 -070020 name: adapter-open-onu
21 namespace: {{ .Release.Namespace }}
22 {{- if or (hasKey .Values "extra_deployment_labels") (hasKey .Values "openonu_deployment_labels") }}
David Bainbridge534a73d2019-08-30 18:57:23 +000023 labels:
Matteo Scandolo50b37982020-04-23 14:04:26 -070024 {{- if hasKey .Values "extra_deployment_labels" }}
25 {{- range $key, $val := .Values.extra_deployment_labels }}
David Bainbridge534a73d2019-08-30 18:57:23 +000026 {{ $key }}: {{ $val | quote }}
27 {{- end }}
28 {{- end }}
Matteo Scandolo50b37982020-04-23 14:04:26 -070029 {{- if hasKey .Values "openonu_deployment_labels" }}
30 {{- range $key, $val := .Values.openonu_deployment_labels }}
David Bainbridge534a73d2019-08-30 18:57:23 +000031 {{ $key }}: {{ $val | quote }}
32 {{- end }}
33 {{- end }}
34 {{- end }}
David Bainbridgecd30e542019-05-31 20:52:56 +000035spec:
Matteo Scandolo50b37982020-04-23 14:04:26 -070036 replicas: {{ .Values.replicas.adapter_open_onu }}
37 podManagementPolicy: Parallel
38 serviceName: "openonu"
David Bainbridgecd30e542019-05-31 20:52:56 +000039 selector:
40 matchLabels:
41 app: adapter-open-onu
42 template:
43 metadata:
44 labels:
45 app: adapter-open-onu
David Bainbridge1f888042019-06-24 18:02:01 +000046 app.kubernetes.io/name: "adapter-open-onu"
Matteo Scandolo50b37982020-04-23 14:04:26 -070047 app.kubernetes.io/version: {{ quote .Chart.AppVersion }}
David Bainbridge1f888042019-06-24 18:02:01 +000048 app.kubernetes.io/component: "adapter"
49 app.kubernetes.io/part-of: "voltha"
Matteo Scandolo50b37982020-04-23 14:04:26 -070050 app.kubernetes.io/managed-by: {{ quote .Release.Service }}
51 helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
52 {{- if hasKey .Values "extra_pod_labels" }}
53 {{- range $key, $val := .Values.extra_pod_labels }}
David Bainbridge534a73d2019-08-30 18:57:23 +000054 {{ $key }}: {{ $val | quote }}
55 {{- end }}
56 {{- end }}
Matteo Scandolo50b37982020-04-23 14:04:26 -070057 {{- if hasKey .Values "openonu_pod_labels" }}
58 {{- range $key, $val := .Values.openonu_pod_labels }}
David Bainbridge534a73d2019-08-30 18:57:23 +000059 {{ $key }}: {{ $val | quote }}
60 {{- end }}
61 {{- end }}
David Bainbridgecd30e542019-05-31 20:52:56 +000062 annotations:
63 cni: "calico"
64 spec:
65 containers:
Matteo Scandolo50b37982020-04-23 14:04:26 -070066 - name: adapter-open-onu
67 image: '{{ tpl .Values.images.adapter_open_onu.registry . }}{{ tpl .Values.images.adapter_open_onu.repository . }}:{{ tpl ( tpl .Values.images.adapter_open_onu.tag . ) . }}'
68 imagePullPolicy: {{ tpl .Values.images.adapter_open_onu.pullPolicy . }}
69 command: [ "sh", "-c"]
70 args:
71 - "REPLICA_ID=$(echo $VOLTHA_POD_NAME | grep -o '.$') && REPLICA_ID=$((REPLICA_ID + 1)) && echo $REPLICA_ID && python /voltha/adapters/brcm_openomci_onu/main.py
72 --kafka_adapter={{ .Values.services.kafka.adapter.service }}:{{ .Values.services.kafka.adapter.port }}
73 --kafka_cluster={{ .Values.services.kafka.cluster.service }}:{{ .Values.services.kafka.cluster.port }}
74 --core_topic=rwcore
75 --name=brcm_openomci_onu
76 --backend=etcd
77 --etcd={{ .Values.services.etcd.service }}:{{ .Values.services.etcd.port }}
78 --probe=:8080
79 --log_level={{ tpl .Values.adapter_open_onu.log_level . | upper }}
80 --totalReplicas={{ .Values.replicas.adapter_open_onu }}
81 --currentReplica=$REPLICA_ID"
82 readinessProbe:
83 httpGet:
84 path: /readz
85 port: 8080
86 initialDelaySeconds: 10
87 periodSeconds: 5
88 livenessProbe:
89 httpGet:
90 path: /healthz
91 port: 8080
92 initialDelaySeconds: 10
93 periodSeconds: 5
94 env:
95 - name: VOLTHA_POD_NAME
96 valueFrom:
97 fieldRef:
98 fieldPath: metadata.name
99 - name: COMPONENT_NAME
100 valueFrom:
101 fieldRef:
102 fieldPath: metadata.labels['app.kubernetes.io/name']
Rohan Agrawal781b33f2020-03-09 12:50:06 +0000103{{- end }}