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