David Bainbridge | cd30e54 | 2019-05-31 20:52:56 +0000 | [diff] [blame] | 1 | # 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 Scandolo | 50b3798 | 2020-04-23 14:04:26 -0700 | [diff] [blame] | 14 | |
serkant.uluderya | cb549df | 2020-03-29 16:19:13 -0700 | [diff] [blame] | 15 | {{- if not (and (hasKey .Values "use_openonu_adapter_go") .Values.use_openonu_adapter_go) }} |
serkant.uluderya | cb549df | 2020-03-29 16:19:13 -0700 | [diff] [blame] | 16 | --- |
David Bainbridge | cd30e54 | 2019-05-31 20:52:56 +0000 | [diff] [blame] | 17 | apiVersion: apps/v1 |
Matteo Scandolo | 50b3798 | 2020-04-23 14:04:26 -0700 | [diff] [blame] | 18 | kind: StatefulSet |
David Bainbridge | cd30e54 | 2019-05-31 20:52:56 +0000 | [diff] [blame] | 19 | metadata: |
Matteo Scandolo | 50b3798 | 2020-04-23 14:04:26 -0700 | [diff] [blame] | 20 | name: adapter-open-onu |
| 21 | namespace: {{ .Release.Namespace }} |
| 22 | {{- if or (hasKey .Values "extra_deployment_labels") (hasKey .Values "openonu_deployment_labels") }} |
David Bainbridge | 534a73d | 2019-08-30 18:57:23 +0000 | [diff] [blame] | 23 | labels: |
Matteo Scandolo | 50b3798 | 2020-04-23 14:04:26 -0700 | [diff] [blame] | 24 | {{- if hasKey .Values "extra_deployment_labels" }} |
| 25 | {{- range $key, $val := .Values.extra_deployment_labels }} |
David Bainbridge | 534a73d | 2019-08-30 18:57:23 +0000 | [diff] [blame] | 26 | {{ $key }}: {{ $val | quote }} |
| 27 | {{- end }} |
| 28 | {{- end }} |
Matteo Scandolo | 50b3798 | 2020-04-23 14:04:26 -0700 | [diff] [blame] | 29 | {{- if hasKey .Values "openonu_deployment_labels" }} |
| 30 | {{- range $key, $val := .Values.openonu_deployment_labels }} |
David Bainbridge | 534a73d | 2019-08-30 18:57:23 +0000 | [diff] [blame] | 31 | {{ $key }}: {{ $val | quote }} |
| 32 | {{- end }} |
| 33 | {{- end }} |
| 34 | {{- end }} |
David Bainbridge | cd30e54 | 2019-05-31 20:52:56 +0000 | [diff] [blame] | 35 | spec: |
Matteo Scandolo | 50b3798 | 2020-04-23 14:04:26 -0700 | [diff] [blame] | 36 | replicas: {{ .Values.replicas.adapter_open_onu }} |
| 37 | podManagementPolicy: Parallel |
| 38 | serviceName: "openonu" |
David Bainbridge | cd30e54 | 2019-05-31 20:52:56 +0000 | [diff] [blame] | 39 | selector: |
| 40 | matchLabels: |
| 41 | app: adapter-open-onu |
| 42 | template: |
| 43 | metadata: |
| 44 | labels: |
| 45 | app: adapter-open-onu |
David Bainbridge | 1f88804 | 2019-06-24 18:02:01 +0000 | [diff] [blame] | 46 | app.kubernetes.io/name: "adapter-open-onu" |
Matteo Scandolo | 50b3798 | 2020-04-23 14:04:26 -0700 | [diff] [blame] | 47 | app.kubernetes.io/version: {{ quote .Chart.AppVersion }} |
David Bainbridge | 1f88804 | 2019-06-24 18:02:01 +0000 | [diff] [blame] | 48 | app.kubernetes.io/component: "adapter" |
| 49 | app.kubernetes.io/part-of: "voltha" |
Matteo Scandolo | 50b3798 | 2020-04-23 14:04:26 -0700 | [diff] [blame] | 50 | 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 Bainbridge | 534a73d | 2019-08-30 18:57:23 +0000 | [diff] [blame] | 54 | {{ $key }}: {{ $val | quote }} |
| 55 | {{- end }} |
| 56 | {{- end }} |
Matteo Scandolo | 50b3798 | 2020-04-23 14:04:26 -0700 | [diff] [blame] | 57 | {{- if hasKey .Values "openonu_pod_labels" }} |
| 58 | {{- range $key, $val := .Values.openonu_pod_labels }} |
David Bainbridge | 534a73d | 2019-08-30 18:57:23 +0000 | [diff] [blame] | 59 | {{ $key }}: {{ $val | quote }} |
| 60 | {{- end }} |
| 61 | {{- end }} |
David Bainbridge | cd30e54 | 2019-05-31 20:52:56 +0000 | [diff] [blame] | 62 | annotations: |
| 63 | cni: "calico" |
| 64 | spec: |
| 65 | containers: |
Matteo Scandolo | 50b3798 | 2020-04-23 14:04:26 -0700 | [diff] [blame] | 66 | - 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 Agrawal | 781b33f | 2020-03-09 12:50:06 +0000 | [diff] [blame] | 103 | {{- end }} |