blob: 3a96220f657c7cca8f1dca286f7a2c3c162a85b5 [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:
David Bainbridge2bdd4302020-06-09 17:13:18 -070019 name: "{{ template "fullname" . }}"
Matteo Scandolo50b37982020-04-23 14:04:26 -070020 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 Scandolob4c5f4e2020-11-11 12:05:23 -080052 app.kubernetes.io/stack: "{{ .Values.global.stack_name }}"
Matteo Scandolo50b37982020-04-23 14:04:26 -070053 app.kubernetes.io/managed-by: {{ quote .Release.Service }}
54 helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
55 {{- if hasKey .Values "extra_pod_labels" }}
56 {{- range $key, $val := .Values.extra_pod_labels }}
David Bainbridge534a73d2019-08-30 18:57:23 +000057 {{ $key }}: {{ $val | quote }}
58 {{- end }}
59 {{- end }}
Matteo Scandolo50b37982020-04-23 14:04:26 -070060 {{- if hasKey .Values "openonu_pod_labels" }}
61 {{- range $key, $val := .Values.openonu_pod_labels }}
David Bainbridge534a73d2019-08-30 18:57:23 +000062 {{ $key }}: {{ $val | quote }}
63 {{- end }}
64 {{- end }}
David Bainbridgecd30e542019-05-31 20:52:56 +000065 spec:
David Bainbridge8595b3b2020-06-05 12:23:05 -070066 {{- if .Values.securityContext.enabled }}
67 securityContext:
68 runAsUser: {{ .Values.securityContext.runAsUser }}
69 runAsGroup: {{ .Values.securityContext.runAsGroup }}
70 fsGroup: {{ .Values.securityContext.fsGroup }}
71 {{- end }}
David Bainbridgecd30e542019-05-31 20:52:56 +000072 containers:
Matteo Scandolo50b37982020-04-23 14:04:26 -070073 - name: adapter-open-onu
74 image: '{{ tpl .Values.images.adapter_open_onu.registry . }}{{ tpl .Values.images.adapter_open_onu.repository . }}:{{ tpl ( tpl .Values.images.adapter_open_onu.tag . ) . }}'
75 imagePullPolicy: {{ tpl .Values.images.adapter_open_onu.pullPolicy . }}
76 command: [ "sh", "-c"]
77 args:
78 - "REPLICA_ID=$(echo $VOLTHA_POD_NAME | grep -o '.$') && REPLICA_ID=$((REPLICA_ID + 1)) && echo $REPLICA_ID && python /voltha/adapters/brcm_openomci_onu/main.py
Matteo Scandolob4c5f4e2020-11-11 12:05:23 -080079 --kafka_adapter={{ tpl .Values.services.kafka.adapter.service . }}:{{ .Values.services.kafka.adapter.port }}
80 --kafka_cluster={{ tpl .Values.services.kafka.cluster.service . }}:{{ .Values.services.kafka.cluster.port }}
81 --core_topic={{ tpl .Values.adapter_open_onu.topics.core_topic . }}
82 --adapter_topic={{ tpl .Values.adapter_open_onu.topics.adapter_open_olt_topic . }}
83 --name={{ tpl .Values.adapter_open_onu.topics.adapter_open_onu_topic . }}
Matteo Scandolo50b37982020-04-23 14:04:26 -070084 --backend=etcd
Matteo Scandolob4c5f4e2020-11-11 12:05:23 -080085 --etcd={{ tpl .Values.services.etcd.service . }}:{{ .Values.services.etcd.port }}
Matteo Scandolo50b37982020-04-23 14:04:26 -070086 --probe=:8080
87 --log_level={{ tpl .Values.adapter_open_onu.log_level . | upper }}
88 --totalReplicas={{ .Values.replicas.adapter_open_onu }}
Girish Gowdra30e3ab02020-06-24 12:59:34 -070089 --currentReplica=$REPLICA_ID
90 --accept_incremental_evto_update={{ tpl .Values.adapter_open_onu.incremental_evto_update . }}"
David Bainbridge2bdd4302020-06-09 17:13:18 -070091 {{- if .Values.securityContext.enabled }}
92 securityContext:
93 allowPrivilegeEscalation: false
94 {{- end }}
Matteo Scandolo50b37982020-04-23 14:04:26 -070095 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
107 env:
108 - name: VOLTHA_POD_NAME
109 valueFrom:
110 fieldRef:
111 fieldPath: metadata.name
112 - name: COMPONENT_NAME
113 valueFrom:
114 fieldRef:
115 fieldPath: metadata.labels['app.kubernetes.io/name']
Matteo Scandoloc4386312020-11-24 13:43:49 -0800116 - name: KV_STORE_DATAPATH_PREFIX
Matteo Scandolob4c5f4e2020-11-11 12:05:23 -0800117 value: {{ tpl .Values.adapter_open_onu.kv_store_data_prefix . }}
Rohan Agrawal781b33f2020-03-09 12:50:06 +0000118{{- end }}