blob: b00533c3ef831c5d059d7fc354c340e7ec695667 [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"
Matteo Scandolob4c5f4e2020-11-11 12:05:23 -080051 app.kubernetes.io/stack: "{{ .Values.global.stack_name }}"
Holger Hildebrandtb67c3302020-02-25 13:48:59 +000052 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 }}
56 {{ $key }}: {{ $val | quote }}
57 {{- end }}
58 {{- end }}
59 {{- if hasKey .Values "openonu_pod_labels" }}
60 {{- range $key, $val := .Values.openonu_pod_labels }}
61 {{ $key }}: {{ $val | quote }}
62 {{- end }}
63 {{- end }}
Holger Hildebrandtb67c3302020-02-25 13:48:59 +000064 spec:
David Bainbridge8595b3b2020-06-05 12:23:05 -070065 {{- if .Values.securityContext.enabled }}
66 securityContext:
67 runAsUser: {{ .Values.securityContext.runAsUser }}
68 runAsGroup: {{ .Values.securityContext.runAsGroup }}
69 fsGroup: {{ .Values.securityContext.fsGroup }}
70 {{- end }}
Holger Hildebrandtb67c3302020-02-25 13:48:59 +000071 containers:
72 - name: adapter-open-onu
Matteo Scandoloefcb4392020-11-17 10:21:02 -080073 image: '{{ tpl .Values.images.adapter_open_onu_go.registry . }}{{ tpl .Values.images.adapter_open_onu_go.repository . }}:{{ tpl ( tpl .Values.images.adapter_open_onu_go.tag . ) . }}'
Holger Hildebrandtb67c3302020-02-25 13:48:59 +000074 imagePullPolicy: {{ tpl .Values.images.adapter_open_onu_go.pullPolicy . }}
Matteo Scandolo846f19c2020-04-24 16:39:17 -070075 env:
76 - name: COMPONENT_NAME
77 valueFrom:
78 fieldRef:
79 fieldPath: metadata.labels['app.kubernetes.io/name']
Matteo Scandolofcbb9252020-11-19 12:19:02 -080080 - name: KV_STORE_DATAPATH_PREFIX
Matteo Scandolob4c5f4e2020-11-11 12:05:23 -080081 value: {{ tpl .Values.adapter_open_onu.kv_store_data_prefix . }}
Holger Hildebrandtb67c3302020-02-25 13:48:59 +000082 args:
Matteo Scandolo4f6d59a2020-03-25 10:37:18 -070083 - "/app/openonu"
Holger Hildebrandtb67c3302020-02-25 13:48:59 +000084 - "--banner=true"
85 - "--kafka_reconnect_retries=-1"
Matteo Scandolo1d80abd2021-01-28 11:30:12 -080086 - "--kafka_adapter_address={{ tpl .Values.services.kafka.adapter.address . }}"
87 - "--kafka_cluster_address={{ tpl .Values.services.kafka.cluster.address . }}"
Matteo Scandolob4c5f4e2020-11-11 12:05:23 -080088 - "--core_topic={{ tpl .Values.adapter_open_onu.topics.core_topic . }}"
89 - "--adapter_topic={{ tpl .Values.adapter_open_onu.topics.adapter_open_onu_topic . }}"
Matteo Scandolo1d80abd2021-01-28 11:30:12 -080090 - "--kv_store_address={{ tpl .Values.services.etcd.address . }}"
Andrea Campanella6838a802020-11-19 15:50:23 +010091 - "--kv_store_request_timeout={{ tpl .Values.adapter_open_onu.kv_store_timeout . }}"
Holger Hildebrandtb67c3302020-02-25 13:48:59 +000092 - "--log_level={{ $log_level }}"
93 - "--probe_port=8080"
Girish Gowdra3152aca2020-11-19 15:57:58 -080094 - "--accept_incr_evto={{ tpl .Values.adapter_open_onu.incremental_evto_update . }}"
Himani Chawla5a33c502020-09-25 13:08:33 +053095 - "--max_timeout_interadapter_comm={{ tpl .Values.adapter_open_onu.max_timeout_interadapter_comm . }}"
Matteo Scandolob4c5f4e2020-11-11 12:05:23 -080096 - "--trace_enabled={{ .Values.global.tracing.enabled }}"
97 - "--trace_agent_address={{ tpl .Values.services.tracing_agent.address . }}"
Andrea Campanellaaa46d3f2021-01-19 09:19:02 +010098 - "--allowed_onu_vendors={{ template "allowed_onu_vendors" . }}"
Girish Gowdrae05c0182021-01-28 15:02:37 -080099 - "--metrics_enabled={{ .Values.global.metrics.enabled }}"
Holger Hildebrandt29c63c92021-02-05 14:58:50 +0000100 - "--mib_audit_interval={{ .Values.global.mib_audit.interval }}"
David Bainbridge2bdd4302020-06-09 17:13:18 -0700101 {{- if .Values.securityContext.enabled }}
102 securityContext:
103 allowPrivilegeEscalation: false
104 {{- end }}
Holger Hildebrandtb67c3302020-02-25 13:48:59 +0000105 livenessProbe:
106 httpGet:
107 path: /healthz
108 port: 8080
109 initialDelaySeconds: 10
110 periodSeconds: 5
111 readinessProbe:
112 httpGet:
113 path: /readz
114 port: 8080
115 initialDelaySeconds: 10
116 periodSeconds: 5
Matteo Scandolo4f6d59a2020-03-25 10:37:18 -0700117{{- end }}