blob: eb337c9d06809910968d326a45307fc176927fb6 [file] [log] [blame]
Joey Armstrong34d4ad72023-01-03 09:47:15 -05001# Copyright 2022-2023 Open Networking Foundation (ONF) and the ONF Contributors
Elia Battiston98458082022-02-28 19:07:43 +01002#
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:
Elia Battiston150669d2022-03-14 18:44:41 +010080 - "/startup/startup.sh" #Defined in configmap-startup.yaml
81 ports:
82 - containerPort: 830
83 name: netopeer2-ssh
Elia Battiston98458082022-02-28 19:07:43 +010084 {{- if .Values.securityContext.enabled }}
85 securityContext:
86 allowPrivilegeEscalation: false
87 {{- end }}
88 livenessProbe:
89 httpGet:
90 path: /healthz
91 port: 8080
92 initialDelaySeconds: {{ .Values.probe.liveness.initial_delay_seconds }}
93 periodSeconds: {{ .Values.probe.liveness.period_seconds }}
94 readinessProbe:
95 httpGet:
96 path: /readz
97 port: 8080
98 initialDelaySeconds: {{ .Values.probe.readiness.initial_delay_seconds }}
99 periodSeconds: {{ .Values.probe.readiness.period_seconds }}
Elia Battiston150669d2022-03-14 18:44:41 +0100100 volumeMounts:
101 - name: startup-script-volume
102 mountPath: /startup/
103 volumes:
104 - name: startup-script-volume
105 configMap:
106 name: bbf-adapter-startup
107 defaultMode: 0550