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: |
David Bainbridge | 2bdd430 | 2020-06-09 17:13:18 -0700 | [diff] [blame] | 19 | name: "{{ template "fullname" . }}" |
Matteo Scandolo | 50b3798 | 2020-04-23 14:04:26 -0700 | [diff] [blame] | 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 | b4c5f4e | 2020-11-11 12:05:23 -0800 | [diff] [blame] | 52 | app.kubernetes.io/stack: "{{ .Values.global.stack_name }}" |
Matteo Scandolo | 50b3798 | 2020-04-23 14:04:26 -0700 | [diff] [blame] | 53 | 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 Bainbridge | 534a73d | 2019-08-30 18:57:23 +0000 | [diff] [blame] | 57 | {{ $key }}: {{ $val | quote }} |
| 58 | {{- end }} |
| 59 | {{- end }} |
Matteo Scandolo | 50b3798 | 2020-04-23 14:04:26 -0700 | [diff] [blame] | 60 | {{- if hasKey .Values "openonu_pod_labels" }} |
| 61 | {{- range $key, $val := .Values.openonu_pod_labels }} |
David Bainbridge | 534a73d | 2019-08-30 18:57:23 +0000 | [diff] [blame] | 62 | {{ $key }}: {{ $val | quote }} |
| 63 | {{- end }} |
| 64 | {{- end }} |
David Bainbridge | cd30e54 | 2019-05-31 20:52:56 +0000 | [diff] [blame] | 65 | spec: |
David Bainbridge | 8595b3b | 2020-06-05 12:23:05 -0700 | [diff] [blame] | 66 | {{- if .Values.securityContext.enabled }} |
| 67 | securityContext: |
| 68 | runAsUser: {{ .Values.securityContext.runAsUser }} |
| 69 | runAsGroup: {{ .Values.securityContext.runAsGroup }} |
| 70 | fsGroup: {{ .Values.securityContext.fsGroup }} |
| 71 | {{- end }} |
David Bainbridge | cd30e54 | 2019-05-31 20:52:56 +0000 | [diff] [blame] | 72 | containers: |
Matteo Scandolo | 50b3798 | 2020-04-23 14:04:26 -0700 | [diff] [blame] | 73 | - 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 Scandolo | b4c5f4e | 2020-11-11 12:05:23 -0800 | [diff] [blame] | 79 | --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 Scandolo | 50b3798 | 2020-04-23 14:04:26 -0700 | [diff] [blame] | 84 | --backend=etcd |
Matteo Scandolo | b4c5f4e | 2020-11-11 12:05:23 -0800 | [diff] [blame] | 85 | --etcd={{ tpl .Values.services.etcd.service . }}:{{ .Values.services.etcd.port }} |
Matteo Scandolo | 50b3798 | 2020-04-23 14:04:26 -0700 | [diff] [blame] | 86 | --probe=:8080 |
| 87 | --log_level={{ tpl .Values.adapter_open_onu.log_level . | upper }} |
| 88 | --totalReplicas={{ .Values.replicas.adapter_open_onu }} |
Girish Gowdra | 30e3ab0 | 2020-06-24 12:59:34 -0700 | [diff] [blame] | 89 | --currentReplica=$REPLICA_ID |
| 90 | --accept_incremental_evto_update={{ tpl .Values.adapter_open_onu.incremental_evto_update . }}" |
David Bainbridge | 2bdd430 | 2020-06-09 17:13:18 -0700 | [diff] [blame] | 91 | {{- if .Values.securityContext.enabled }} |
| 92 | securityContext: |
| 93 | allowPrivilegeEscalation: false |
| 94 | {{- end }} |
Matteo Scandolo | 50b3798 | 2020-04-23 14:04:26 -0700 | [diff] [blame] | 95 | 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 Scandolo | c438631 | 2020-11-24 13:43:49 -0800 | [diff] [blame] | 116 | - name: KV_STORE_DATAPATH_PREFIX |
Matteo Scandolo | b4c5f4e | 2020-11-11 12:05:23 -0800 | [diff] [blame] | 117 | value: {{ tpl .Values.adapter_open_onu.kv_store_data_prefix . }} |
Rohan Agrawal | 781b33f | 2020-03-09 12:50:06 +0000 | [diff] [blame] | 118 | {{- end }} |