blob: a3491c7d62b6f64286f34a4adbc566b53a822917 [file] [log] [blame]
Elia Battiston98458082022-02-28 19:07:43 +01001# Copyright 2022-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.
14{{- $log_level := tpl .Values.voltha_northbound_bbf_adapter.log_level . }}
15---
16apiVersion: apps/v1
17kind: Deployment
18metadata:
19 name: "{{ template "fullname" . }}"
20 namespace: {{ .Release.Namespace }}
21 {{- if or (hasKey .Values "extra_deployment_labels") (hasKey .Values "openolt_deployment_labels") }}
22 labels:
23 {{- if hasKey .Values "extra_deployment_labels" }}
24 {{- range $key, $val := .Values.extra_deployment_labels }}
25 {{ $key }}: {{ $val | quote }}
26 {{- end }}
27 {{- end }}
28 {{- if hasKey .Values "openolt_deployment_labels" }}
29 {{- range $key, $val := .Values.openolt_deployment_labels }}
30 {{ $key }}: {{ $val | quote }}
31 {{- end }}
32 {{- end }}
33 {{- end }}
34spec:
35 replicas: {{ .Values.replicas.bbf_adapter }}
36 selector:
37 matchLabels:
38 app: bbf-adapter
39 release: {{ .Release.Name }}
40 template:
41 metadata:
42 namespace: {{ .Release.Namespace }}
43 labels:
44 app: bbf-adapter
45 release: {{ .Release.Name }}
46 app.kubernetes.io/name: "bbf-adapter"
47 app.kubernetes.io/version: {{ quote .Chart.AppVersion }}
48 app.kubernetes.io/component: "adapter"
49 app.kubernetes.io/part-of: "voltha"
50 app.kubernetes.io/stack: "{{ .Values.global.stack_name }}"
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 "openolt_pod_labels" }}
59 {{- range $key, $val := .Values.openolt_pod_labels }}
60 {{ $key }}: {{ $val | quote }}
61 {{- end }}
62 {{- end }}
63 spec:
64 {{- if .Values.securityContext.enabled }}
65 securityContext:
66 runAsUser: {{ .Values.securityContext.runAsUser }}
67 runAsGroup: {{ .Values.securityContext.runAsGroup }}
68 fsGroup: {{ .Values.securityContext.fsGroup }}
69 {{- end }}
70 containers:
71 - name: bbf-adapter
72 image: '{{ tpl .Values.images.voltha_northbound_bbf_adapter.registry . }}{{ tpl .Values.images.voltha_northbound_bbf_adapter.repository . }}:{{ tpl ( tpl .Values.images.voltha_northbound_bbf_adapter.tag . ) . }}'
73 imagePullPolicy: {{ tpl .Values.images.voltha_northbound_bbf_adapter.pullPolicy . }}
74 env:
75 - name: COMPONENT_NAME
76 valueFrom:
77 fieldRef:
78 fieldPath: metadata.labels['app.kubernetes.io/name']
79 args:
80 - "/app/bbf-adapter"
81 - "--log_level={{ $log_level }}"
82 - "--probe_address=:8080"
83 - "--trace_enabled={{ .Values.global.tracing.enabled }}"
84 - "--trace_agent_address={{ tpl .Values.services.tracing_agent.address . }}"
85 - "--log_correlation_enabled={{ .Values.global.log_correlation.enabled }}"
86 {{- if .Values.securityContext.enabled }}
87 securityContext:
88 allowPrivilegeEscalation: false
89 {{- end }}
90 livenessProbe:
91 httpGet:
92 path: /healthz
93 port: 8080
94 initialDelaySeconds: {{ .Values.probe.liveness.initial_delay_seconds }}
95 periodSeconds: {{ .Values.probe.liveness.period_seconds }}
96 readinessProbe:
97 httpGet:
98 path: /readz
99 port: 8080
100 initialDelaySeconds: {{ .Values.probe.readiness.initial_delay_seconds }}
101 periodSeconds: {{ .Values.probe.readiness.period_seconds }}