blob: bba823b07a5961969a47255f9bd70f13146ebbeb [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{{- if not (and (hasKey .Values "use_openonu_adapter_go") .Values.use_openonu_adapter_go) }}
serkant.uluderyacb549df2020-03-29 16:19:13 -070015---
David Bainbridgecd30e542019-05-31 20:52:56 +000016apiVersion: apps/v1
Matteo Scandolo50b37982020-04-23 14:04:26 -070017kind: StatefulSet
David Bainbridgecd30e542019-05-31 20:52:56 +000018metadata:
Matteo Scandolo50b37982020-04-23 14:04:26 -070019 name: adapter-open-onu
20 namespace: {{ .Release.Namespace }}
21 {{- if or (hasKey .Values "extra_deployment_labels") (hasKey .Values "openonu_deployment_labels") }}
David Bainbridge534a73d2019-08-30 18:57:23 +000022 labels:
Matteo Scandolo50b37982020-04-23 14:04:26 -070023 {{- if hasKey .Values "extra_deployment_labels" }}
24 {{- range $key, $val := .Values.extra_deployment_labels }}
David Bainbridge534a73d2019-08-30 18:57:23 +000025 {{ $key }}: {{ $val | quote }}
26 {{- end }}
27 {{- end }}
Matteo Scandolo50b37982020-04-23 14:04:26 -070028 {{- if hasKey .Values "openonu_deployment_labels" }}
29 {{- range $key, $val := .Values.openonu_deployment_labels }}
David Bainbridge534a73d2019-08-30 18:57:23 +000030 {{ $key }}: {{ $val | quote }}
31 {{- end }}
32 {{- end }}
33 {{- end }}
David Bainbridgecd30e542019-05-31 20:52:56 +000034spec:
Matteo Scandolo50b37982020-04-23 14:04:26 -070035 replicas: {{ .Values.replicas.adapter_open_onu }}
36 podManagementPolicy: Parallel
37 serviceName: "openonu"
David Bainbridgecd30e542019-05-31 20:52:56 +000038 selector:
39 matchLabels:
40 app: adapter-open-onu
David Bainbridge8595b3b2020-06-05 12:23:05 -070041 release: {{ .Release.Name }}
David Bainbridgecd30e542019-05-31 20:52:56 +000042 template:
43 metadata:
David Bainbridge8595b3b2020-06-05 12:23:05 -070044 namespace: {{ .Release.Namespace }}
David Bainbridgecd30e542019-05-31 20:52:56 +000045 labels:
46 app: adapter-open-onu
David Bainbridge8595b3b2020-06-05 12:23:05 -070047 release: {{ .Release.Name }}
David Bainbridge1f888042019-06-24 18:02:01 +000048 app.kubernetes.io/name: "adapter-open-onu"
Matteo Scandolo50b37982020-04-23 14:04:26 -070049 app.kubernetes.io/version: {{ quote .Chart.AppVersion }}
David Bainbridge1f888042019-06-24 18:02:01 +000050 app.kubernetes.io/component: "adapter"
51 app.kubernetes.io/part-of: "voltha"
Matteo Scandolo50b37982020-04-23 14:04:26 -070052 app.kubernetes.io/managed-by: {{ quote .Release.Service }}
53 helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
54 {{- if hasKey .Values "extra_pod_labels" }}
55 {{- range $key, $val := .Values.extra_pod_labels }}
David Bainbridge534a73d2019-08-30 18:57:23 +000056 {{ $key }}: {{ $val | quote }}
57 {{- end }}
58 {{- end }}
Matteo Scandolo50b37982020-04-23 14:04:26 -070059 {{- if hasKey .Values "openonu_pod_labels" }}
60 {{- range $key, $val := .Values.openonu_pod_labels }}
David Bainbridge534a73d2019-08-30 18:57:23 +000061 {{ $key }}: {{ $val | quote }}
62 {{- end }}
63 {{- end }}
David Bainbridgecd30e542019-05-31 20:52:56 +000064 spec:
David Bainbridge8595b3b2020-06-05 12:23:05 -070065 {{- if .Values.securityContext.enabled }}
66 securityContext:
67 runAsUser: {{ .Values.securityContext.runAsUser }}
68 runAsGroup: {{ .Values.securityContext.runAsGroup }}
69 fsGroup: {{ .Values.securityContext.fsGroup }}
70 {{- end }}
David Bainbridgecd30e542019-05-31 20:52:56 +000071 containers:
Matteo Scandolo50b37982020-04-23 14:04:26 -070072 - name: adapter-open-onu
73 image: '{{ tpl .Values.images.adapter_open_onu.registry . }}{{ tpl .Values.images.adapter_open_onu.repository . }}:{{ tpl ( tpl .Values.images.adapter_open_onu.tag . ) . }}'
74 imagePullPolicy: {{ tpl .Values.images.adapter_open_onu.pullPolicy . }}
75 command: [ "sh", "-c"]
76 args:
77 - "REPLICA_ID=$(echo $VOLTHA_POD_NAME | grep -o '.$') && REPLICA_ID=$((REPLICA_ID + 1)) && echo $REPLICA_ID && python /voltha/adapters/brcm_openomci_onu/main.py
78 --kafka_adapter={{ .Values.services.kafka.adapter.service }}:{{ .Values.services.kafka.adapter.port }}
79 --kafka_cluster={{ .Values.services.kafka.cluster.service }}:{{ .Values.services.kafka.cluster.port }}
serkant.uluderyaf1b8cc72020-05-13 23:26:51 -070080 --core_topic={{ .Values.defaults.topics.core_topic }}
81 --adapter_topic={{ .Values.defaults.topics.adapter_open_olt_topic }}
82 --name={{ .Values.defaults.topics.adapter_open_onu_topic }}
Matteo Scandolo50b37982020-04-23 14:04:26 -070083 --backend=etcd
84 --etcd={{ .Values.services.etcd.service }}:{{ .Values.services.etcd.port }}
85 --probe=:8080
86 --log_level={{ tpl .Values.adapter_open_onu.log_level . | upper }}
87 --totalReplicas={{ .Values.replicas.adapter_open_onu }}
88 --currentReplica=$REPLICA_ID"
89 readinessProbe:
90 httpGet:
91 path: /readz
92 port: 8080
93 initialDelaySeconds: 10
94 periodSeconds: 5
95 livenessProbe:
96 httpGet:
97 path: /healthz
98 port: 8080
99 initialDelaySeconds: 10
100 periodSeconds: 5
101 env:
102 - name: VOLTHA_POD_NAME
103 valueFrom:
104 fieldRef:
105 fieldPath: metadata.name
106 - name: COMPONENT_NAME
107 valueFrom:
108 fieldRef:
109 fieldPath: metadata.labels['app.kubernetes.io/name']
Rohan Agrawal781b33f2020-03-09 12:50:06 +0000110{{- end }}