blob: c213e6724808ed1726609e34d21ec1de0396d517 [file] [log] [blame]
Holger Hildebrandtb67c3302020-02-25 13:48:59 +00001# 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.
David Bainbridge8595b3b2020-06-05 12:23:05 -070014{{- if and (hasKey .Values "use_openonu_adapter_go") .Values.use_openonu_adapter_go }}
Holger Hildebrandtb67c3302020-02-25 13:48:59 +000015{{- $log_level := tpl .Values.adapter_open_onu.log_level . | upper }}
David Bainbridge8595b3b2020-06-05 12:23:05 -070016---
Holger Hildebrandtb67c3302020-02-25 13:48:59 +000017apiVersion: apps/v1
18kind: Deployment
19metadata:
David Bainbridge2bdd4302020-06-09 17:13:18 -070020 name: "{{ template "fullname" . }}"
Holger Hildebrandtb67c3302020-02-25 13:48:59 +000021 namespace: {{ .Release.Namespace }}
22 {{- if or (hasKey .Values "extra_deployment_labels") (hasKey .Values "openonu_deployment_labels") }}
23 labels:
24 {{- if hasKey .Values "extra_deployment_labels" }}
25 {{- range $key, $val := .Values.extra_deployment_labels }}
26 {{ $key }}: {{ $val | quote }}
27 {{- end }}
28 {{- end }}
29 {{- if hasKey .Values "openonu_deployment_labels" }}
30 {{- range $key, $val := .Values.openonu_deployment_labels }}
31 {{ $key }}: {{ $val | quote }}
32 {{- end }}
33 {{- end }}
34 {{- end }}
35spec:
36 replicas: {{ .Values.replicas.adapter_open_onu }}
37 selector:
38 matchLabels:
39 app: adapter-open-onu
David Bainbridge8595b3b2020-06-05 12:23:05 -070040 release: {{ .Release.Name }}
Holger Hildebrandtb67c3302020-02-25 13:48:59 +000041 template:
42 metadata:
David Bainbridge8595b3b2020-06-05 12:23:05 -070043 namespace: {{ .Release.Namespace }}
Holger Hildebrandtb67c3302020-02-25 13:48:59 +000044 labels:
45 app: adapter-open-onu
David Bainbridge8595b3b2020-06-05 12:23:05 -070046 release: {{ .Release.Name }}
Holger Hildebrandtb67c3302020-02-25 13:48:59 +000047 app.kubernetes.io/name: "adapter-open-onu"
48 app.kubernetes.io/version: {{ quote .Chart.AppVersion }}
49 app.kubernetes.io/component: "adapter"
50 app.kubernetes.io/part-of: "voltha"
51 app.kubernetes.io/managed-by: {{ quote .Release.Service }}
52 helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
53 {{- if hasKey .Values "extra_pod_labels" }}
54 {{- range $key, $val := .Values.extra_pod_labels }}
55 {{ $key }}: {{ $val | quote }}
56 {{- end }}
57 {{- end }}
58 {{- if hasKey .Values "openonu_pod_labels" }}
59 {{- range $key, $val := .Values.openonu_pod_labels }}
60 {{ $key }}: {{ $val | quote }}
61 {{- end }}
62 {{- end }}
Holger Hildebrandtb67c3302020-02-25 13:48:59 +000063 spec:
David Bainbridge8595b3b2020-06-05 12:23:05 -070064 {{- if .Values.securityContext.enabled }}
65 securityContext:
66 runAsUser: {{ .Values.securityContext.runAsUser }}
67 runAsGroup: {{ .Values.securityContext.runAsGroup }}
68 fsGroup: {{ .Values.securityContext.fsGroup }}
69 {{- end }}
Holger Hildebrandtb67c3302020-02-25 13:48:59 +000070 containers:
71 - name: adapter-open-onu
72 image: '{{ tpl .Values.images.adapter_open_onu.registry . }}{{ tpl .Values.images.adapter_open_onu_go.repository . }}:{{ tpl ( tpl .Values.images.adapter_open_onu_go.tag . ) . }}'
73 imagePullPolicy: {{ tpl .Values.images.adapter_open_onu_go.pullPolicy . }}
Matteo Scandolo846f19c2020-04-24 16:39:17 -070074 env:
75 - name: COMPONENT_NAME
76 valueFrom:
77 fieldRef:
78 fieldPath: metadata.labels['app.kubernetes.io/name']
Holger Hildebrandtb67c3302020-02-25 13:48:59 +000079 args:
Matteo Scandolo4f6d59a2020-03-25 10:37:18 -070080 - "/app/openonu"
Holger Hildebrandtb67c3302020-02-25 13:48:59 +000081 - "--banner=true"
82 - "--kafka_reconnect_retries=-1"
83 - "--kafka_adapter_host={{ .Values.services.kafka.adapter.service }}"
84 - "--kafka_adapter_port={{ .Values.services.kafka.adapter.port }}"
85 - "--kafka_cluster_host={{ .Values.services.kafka.cluster.service }}"
86 - "--kafka_cluster_port={{ .Values.services.kafka.cluster.port }}"
87 - "--core_topic=rwcore"
88 - "--adapter_topic=brcm_openomci_onu"
89 - "--kv_store_host={{ .Values.services.etcd.service }}"
90 - "--kv_store_port={{ .Values.services.etcd.port }}"
91 - "--log_level={{ $log_level }}"
92 - "--probe_port=8080"
David Bainbridge2bdd4302020-06-09 17:13:18 -070093 {{- if .Values.securityContext.enabled }}
94 securityContext:
95 allowPrivilegeEscalation: false
96 {{- end }}
Holger Hildebrandtb67c3302020-02-25 13:48:59 +000097 livenessProbe:
98 httpGet:
99 path: /healthz
100 port: 8080
101 initialDelaySeconds: 10
102 periodSeconds: 5
103 readinessProbe:
104 httpGet:
105 path: /readz
106 port: 8080
107 initialDelaySeconds: 10
108 periodSeconds: 5
Matteo Scandolo4f6d59a2020-03-25 10:37:18 -0700109{{- end }}