blob: 33b0435c963dbda4ab4fe76074fecff9e938aa4e [file] [log] [blame]
# Copyright 2022-2024 Open Networking Foundation (ONF) and the ONF Contributors
#
# 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.
apiVersion: apps/v1
kind: Deployment
metadata:
name: "{{ template "fullname" . }}"
namespace: "{{ .Release.Namespace }}"
{{- if or (hasKey .Values "extra_deployment_labels") (hasKey .Values "vgc_deployment_labels") }}
labels:
{{- if hasKey .Values "extra_deployment_labels" }}
{{- range $key, $val := .Values.extra_deployment_labels }}
{{ $key }}: {{ $val | quote }}
{{- end }}
{{- end }}
{{- if hasKey .Values "vgc_deployment_labels" }}
{{- range $key, $val := .Values.vgc_deployment_labels }}
{{ $key }}: {{ $val | quote }}
{{- end }}
{{- end }}
{{- end }}
spec:
selector:
matchLabels:
app: voltha-go-controller
release: {{ .Release.Name }}
template:
metadata:
labels:
app: voltha-go-controller
release: {{ .Release.Name }}
app.kubernetes.io/name: "voltha-go-controller"
app.kubernetes.io/version: {{ quote .Chart.AppVersion }}
app.kubernetes.io/component: "controller"
app.kubernetes.io/part-of: "voltha"
app.kubernetes.io/stack: "{{ .Values.global.stack_name }}"
app.kubernetes.io/managed-by: {{ quote .Release.Service }}
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
{{- if hasKey .Values "extra_pod_labels" }}
{{- range $key, $val := .Values.extra_pod_labels }}
{{ $key }}: {{ $val | quote }}
{{- end }}
{{- end }}
{{- if hasKey .Values "vgc_pod_labels" }}
{{- range $key, $val := .Values.vgc_pod_labels }}
{{ $key }}: {{ $val | quote }}
{{- end }}
{{- end }}
spec:
{{- if .Values.securityContext.enabled }}
securityContext:
runAsUser: {{ .Values.securityContext.runAsUser }}
runAsGroup: {{ .Values.securityContext.runAsGroup }}
fsGroup: {{ .Values.securityContext.fsGroup }}
{{- end }}
containers:
- args:
- "/app/voltha-go-controller"
env:
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: NAMESPACE
value: {{ .Release.Namespace }}
- name: VOLTHA_HOST
value: "{{ .Release.Namespace }}-voltha-api.{{ .Release.Namespace }}.svc.cluster.local"
- name: VOLTHA_PORT
value: "55555"
- name: KV_STORE_TYPE
value: "{{ tpl .Values.services.kvstore.type . }}"
- name: KV_STORE_HOST
value: "{{ tpl .Values.services.kvstore.address . }}"
- name: KV_STORE_PORT
value: "{{ tpl .Values.services.kvstore.port . }}"
- name: KAFKA_ADAPTER_HOST
value: "{{ tpl .Values.services.kafka.cluster.address . }}"
- name: KAFKA_ADAPTER_PORT
value: "9092"
- name: LOG_LEVEL
value: "{{ .Values.global.log_level }}"
- name: KV_STORE_TIMEOUT
value: "3000000000"
- name: DEVICE_SYNC_DURATION
value: "10"
- name: MAX_FLOW_RETRY_DURATION
value: "60"
- name: LIVE_PROBE_INTERVAL
value: "60"
- name: NOT_LIVE_PROBE_INTERVAL
value: "5"
name: voltha-go-controller
image: '{{ tpl .Values.images.voltha_go_controller.registry . }}{{ tpl .Values.images.voltha_go_controller.repository . }}:{{ tpl ( tpl .Values.images.voltha_go_controller.tag . ) . }}'
imagePullPolicy: {{ tpl .Values.images.voltha_go_controller.pullPolicy . }}
{{- if .Values.securityContext.enabled }}
securityContext:
allowPrivilegeEscalation: false
{{- end }}
ports:
- containerPort: {{ .Values.voltha_go_controller.sshPort }}
name: ssh-port
- containerPort: {{ .Values.voltha_go_controller.uiPort }}
name: ui-port
protocol: "{{ .Values.voltha_go_controller.uiProtocol }}"
livenessProbe:
httpGet:
path: /healthz
port: 8090
initialDelaySeconds: {{ .Values.probe.liveness.initial_delay_seconds }}
periodSeconds: {{ .Values.probe.liveness.period_seconds }}
readinessProbe:
httpGet:
path: /readz
port: 8090
initialDelaySeconds: {{ .Values.probe.readiness.initial_delay_seconds }}
periodSeconds: {{ .Values.probe.readiness.period_seconds }}
resources:
requests:
{{- if .Values.resources.requests.memory }}
memory: {{ .Values.resources.requests.memory }}
{{- end }}
{{- if .Values.resources.requests.cpu }}
cpu: {{ .Values.resources.requests.cpu }}
{{- end }}
limits:
{{- if .Values.resources.limits.memory }}
memory: {{ .Values.resources.limits.memory }}
{{- end }}
{{- if .Values.resources.limits.cpu }}
cpu: {{ .Values.resources.limits.cpu }}
{{- end }}
restartPolicy: "Always"