| # Copyright 2019-present Open Networking Foundation |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| {{- $root := . -}} |
| {{- if not (and (hasKey .Values "use_openonu_adapter_go") .Values.use_openonu_adapter_go) }} |
| {{- $tag := tpl ( tpl .Values.images.adapter_open_onu.tag . ) . }} |
| {{- $repository := tpl .Values.images.adapter_open_onu.repository . }} |
| {{- $registry := tpl .Values.images.adapter_open_onu.registry . }} |
| {{- $pullpolicy := tpl .Values.images.adapter_open_onu.pullPolicy . }} |
| {{- $log_level := tpl .Values.adapter_open_onu.log_level . | upper }} |
| {{- $replica_id := 0 }} |
| {{- range $i, $e := until (int .Values.replicas.adapter_open_onu) }} |
| {{- $replica_id := add1 $i }} |
| |
| --- |
| |
| apiVersion: apps/v1 |
| kind: Deployment |
| metadata: |
| name: adapter-open-onu-{{ $replica_id }} |
| namespace: {{ $root.Release.Namespace }} |
| {{- if or (hasKey $root.Values "extra_deployment_labels") (hasKey $root.Values "openonu_deployment_labels") }} |
| labels: |
| {{- if hasKey $root.Values "extra_deployment_labels" }} |
| {{- range $key, $val := $root.Values.extra_deployment_labels }} |
| {{ $key }}: {{ $val | quote }} |
| {{- end }} |
| {{- end }} |
| {{- if hasKey $root.Values "openonu_deployment_labels" }} |
| {{- range $key, $val := $root.Values.openonu_deployment_labels }} |
| {{ $key }}: {{ $val | quote }} |
| {{- end }} |
| {{- end }} |
| {{- end }} |
| spec: |
| replicas: 1 |
| selector: |
| matchLabels: |
| app: adapter-open-onu |
| template: |
| metadata: |
| labels: |
| app: adapter-open-onu |
| app.kubernetes.io/name: "adapter-open-onu" |
| app.kubernetes.io/version: {{ quote $root.Chart.AppVersion }} |
| app.kubernetes.io/component: "adapter" |
| app.kubernetes.io/part-of: "voltha" |
| app.kubernetes.io/managed-by: {{ quote $root.Release.Service }} |
| helm.sh/chart: "{{ $root.Chart.Name }}-{{ $root.Chart.Version }}" |
| {{- if hasKey $root.Values "extra_pod_labels" }} |
| {{- range $key, $val := $root.Values.extra_pod_labels }} |
| {{ $key }}: {{ $val | quote }} |
| {{- end }} |
| {{- end }} |
| {{- if hasKey $root.Values "openonu_pod_labels" }} |
| {{- range $key, $val := $root.Values.openonu_pod_labels }} |
| {{ $key }}: {{ $val | quote }} |
| {{- end }} |
| {{- end }} |
| annotations: |
| cni: "calico" |
| spec: |
| containers: |
| - name: adapter-open-onu |
| image: '{{ $registry }}{{ $repository }}:{{ $tag }}' |
| imagePullPolicy: {{ $pullpolicy }} |
| env: |
| - name: COMPONENT_NAME |
| valueFrom: |
| fieldRef: |
| fieldPath: metadata.labels['app.kubernetes.io/name'] |
| image: '{{ $registry }}{{ $repository }}:{{ $tag }}' |
| args: |
| - "/voltha/adapters/brcm_openomci_onu/main.py" |
| - "--kafka_adapter={{ $root.Values.services.kafka.adapter.service }}:{{ $root.Values.services.kafka.adapter.port }}" |
| - "--kafka_cluster={{ $root.Values.services.kafka.cluster.service }}:{{ $root.Values.services.kafka.cluster.port }}" |
| - "--core_topic=rwcore" |
| - "--name=brcm_openomci_onu" |
| - "--backend=etcd" |
| - "--etcd={{ $root.Values.services.etcd.service }}:{{ $root.Values.services.etcd.port }}" |
| - "--probe=:8080" |
| - "--log_level={{ $log_level }}" |
| - "--totalReplicas={{ $root.Values.replicas.adapter_open_onu }}" |
| - "--currentReplica={{ $replica_id }}" |
| readinessProbe: |
| httpGet: |
| path: /readz |
| port: 8080 |
| initialDelaySeconds: 10 |
| periodSeconds: 5 |
| livenessProbe: |
| httpGet: |
| path: /healthz |
| port: 8080 |
| initialDelaySeconds: 10 |
| periodSeconds: 5 |
| |
| {{- end }} |
| {{- end }} # end if use_openonu_adapter_go |