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 | {{- $root := . -}} |
| 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 | {{- $tag := tpl ( tpl .Values.images.adapter_open_onu.tag . ) . }} |
| 17 | {{- $repository := tpl .Values.images.adapter_open_onu.repository . }} |
| 18 | {{- $registry := tpl .Values.images.adapter_open_onu.registry . }} |
| 19 | {{- $pullpolicy := tpl .Values.images.adapter_open_onu.pullPolicy . }} |
Rohan Agrawal | 781b33f | 2020-03-09 12:50:06 +0000 | [diff] [blame] | 20 | {{- $log_level := tpl .Values.adapter_open_onu.log_level . | upper }} |
serkant.uluderya | cb549df | 2020-03-29 16:19:13 -0700 | [diff] [blame] | 21 | {{- $replica_id := 0 }} |
| 22 | {{- range $i, $e := until (int .Values.replicas.adapter_open_onu) }} |
| 23 | {{- $replica_id := add1 $i }} |
| 24 | |
| 25 | --- |
Rohan Agrawal | 781b33f | 2020-03-09 12:50:06 +0000 | [diff] [blame] | 26 | |
David Bainbridge | cd30e54 | 2019-05-31 20:52:56 +0000 | [diff] [blame] | 27 | apiVersion: apps/v1 |
| 28 | kind: Deployment |
| 29 | metadata: |
serkant.uluderya | cb549df | 2020-03-29 16:19:13 -0700 | [diff] [blame] | 30 | name: adapter-open-onu-{{ $replica_id }} |
| 31 | namespace: {{ $root.Release.Namespace }} |
| 32 | {{- if or (hasKey $root.Values "extra_deployment_labels") (hasKey $root.Values "openonu_deployment_labels") }} |
David Bainbridge | 534a73d | 2019-08-30 18:57:23 +0000 | [diff] [blame] | 33 | labels: |
serkant.uluderya | cb549df | 2020-03-29 16:19:13 -0700 | [diff] [blame] | 34 | {{- if hasKey $root.Values "extra_deployment_labels" }} |
| 35 | {{- range $key, $val := $root.Values.extra_deployment_labels }} |
David Bainbridge | 534a73d | 2019-08-30 18:57:23 +0000 | [diff] [blame] | 36 | {{ $key }}: {{ $val | quote }} |
| 37 | {{- end }} |
| 38 | {{- end }} |
serkant.uluderya | cb549df | 2020-03-29 16:19:13 -0700 | [diff] [blame] | 39 | {{- if hasKey $root.Values "openonu_deployment_labels" }} |
| 40 | {{- range $key, $val := $root.Values.openonu_deployment_labels }} |
David Bainbridge | 534a73d | 2019-08-30 18:57:23 +0000 | [diff] [blame] | 41 | {{ $key }}: {{ $val | quote }} |
| 42 | {{- end }} |
| 43 | {{- end }} |
| 44 | {{- end }} |
David Bainbridge | cd30e54 | 2019-05-31 20:52:56 +0000 | [diff] [blame] | 45 | spec: |
serkant.uluderya | cb549df | 2020-03-29 16:19:13 -0700 | [diff] [blame] | 46 | replicas: 1 |
David Bainbridge | cd30e54 | 2019-05-31 20:52:56 +0000 | [diff] [blame] | 47 | selector: |
| 48 | matchLabels: |
| 49 | app: adapter-open-onu |
| 50 | template: |
| 51 | metadata: |
| 52 | labels: |
| 53 | app: adapter-open-onu |
David Bainbridge | 1f88804 | 2019-06-24 18:02:01 +0000 | [diff] [blame] | 54 | app.kubernetes.io/name: "adapter-open-onu" |
serkant.uluderya | cb549df | 2020-03-29 16:19:13 -0700 | [diff] [blame] | 55 | app.kubernetes.io/version: {{ quote $root.Chart.AppVersion }} |
David Bainbridge | 1f88804 | 2019-06-24 18:02:01 +0000 | [diff] [blame] | 56 | app.kubernetes.io/component: "adapter" |
| 57 | app.kubernetes.io/part-of: "voltha" |
serkant.uluderya | cb549df | 2020-03-29 16:19:13 -0700 | [diff] [blame] | 58 | app.kubernetes.io/managed-by: {{ quote $root.Release.Service }} |
| 59 | helm.sh/chart: "{{ $root.Chart.Name }}-{{ $root.Chart.Version }}" |
| 60 | {{- if hasKey $root.Values "extra_pod_labels" }} |
| 61 | {{- range $key, $val := $root.Values.extra_pod_labels }} |
David Bainbridge | 534a73d | 2019-08-30 18:57:23 +0000 | [diff] [blame] | 62 | {{ $key }}: {{ $val | quote }} |
| 63 | {{- end }} |
| 64 | {{- end }} |
serkant.uluderya | cb549df | 2020-03-29 16:19:13 -0700 | [diff] [blame] | 65 | {{- if hasKey $root.Values "openonu_pod_labels" }} |
| 66 | {{- range $key, $val := $root.Values.openonu_pod_labels }} |
David Bainbridge | 534a73d | 2019-08-30 18:57:23 +0000 | [diff] [blame] | 67 | {{ $key }}: {{ $val | quote }} |
| 68 | {{- end }} |
| 69 | {{- end }} |
David Bainbridge | cd30e54 | 2019-05-31 20:52:56 +0000 | [diff] [blame] | 70 | annotations: |
| 71 | cni: "calico" |
| 72 | spec: |
| 73 | containers: |
| 74 | - name: adapter-open-onu |
serkant.uluderya | cb549df | 2020-03-29 16:19:13 -0700 | [diff] [blame] | 75 | image: '{{ $registry }}{{ $repository }}:{{ $tag }}' |
| 76 | imagePullPolicy: {{ $pullpolicy }} |
Rohan Agrawal | 6b94c35 | 2020-03-25 20:42:27 +0000 | [diff] [blame] | 77 | env: |
| 78 | - name: COMPONENT_NAME |
| 79 | valueFrom: |
| 80 | fieldRef: |
| 81 | fieldPath: metadata.labels['app.kubernetes.io/name'] |
serkant.uluderya | cb549df | 2020-03-29 16:19:13 -0700 | [diff] [blame] | 82 | image: '{{ $registry }}{{ $repository }}:{{ $tag }}' |
David Bainbridge | cd30e54 | 2019-05-31 20:52:56 +0000 | [diff] [blame] | 83 | args: |
| 84 | - "/voltha/adapters/brcm_openomci_onu/main.py" |
serkant.uluderya | cb549df | 2020-03-29 16:19:13 -0700 | [diff] [blame] | 85 | - "--kafka_adapter={{ $root.Values.services.kafka.adapter.service }}:{{ $root.Values.services.kafka.adapter.port }}" |
| 86 | - "--kafka_cluster={{ $root.Values.services.kafka.cluster.service }}:{{ $root.Values.services.kafka.cluster.port }}" |
David Bainbridge | cd30e54 | 2019-05-31 20:52:56 +0000 | [diff] [blame] | 87 | - "--core_topic=rwcore" |
serkant.uluderya | 6ec764e | 2019-07-12 00:03:28 +0300 | [diff] [blame] | 88 | - "--name=brcm_openomci_onu" |
David Bainbridge | cd30e54 | 2019-05-31 20:52:56 +0000 | [diff] [blame] | 89 | - "--backend=etcd" |
serkant.uluderya | cb549df | 2020-03-29 16:19:13 -0700 | [diff] [blame] | 90 | - "--etcd={{ $root.Values.services.etcd.service }}:{{ $root.Values.services.etcd.port }}" |
Rohan Agrawal | 626f185 | 2019-11-21 04:41:10 +0000 | [diff] [blame] | 91 | - "--probe=:8080" |
Rohan Agrawal | 781b33f | 2020-03-09 12:50:06 +0000 | [diff] [blame] | 92 | - "--log_level={{ $log_level }}" |
serkant.uluderya | cb549df | 2020-03-29 16:19:13 -0700 | [diff] [blame] | 93 | - "--totalReplicas={{ $root.Values.replicas.adapter_open_onu }}" |
| 94 | - "--currentReplica={{ $replica_id }}" |
Rohan Agrawal | 626f185 | 2019-11-21 04:41:10 +0000 | [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 |
serkant.uluderya | cb549df | 2020-03-29 16:19:13 -0700 | [diff] [blame] | 107 | |
Rohan Agrawal | 781b33f | 2020-03-09 12:50:06 +0000 | [diff] [blame] | 108 | {{- end }} |
Matteo Scandolo | 1fc6ce1 | 2020-04-15 10:27:40 -0700 | [diff] [blame] | 109 | {{- end }} # end if use_openonu_adapter_go |