# Copyright 2019-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.
{{- $log_level := tpl .Values.adapter_open_onu.log_level . | upper }}
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: "{{ template "fullname" . }}"
  namespace: {{ .Release.Namespace }}
  {{- if or (hasKey .Values "extra_deployment_labels") (hasKey .Values "openonu_deployment_labels") }}
  labels:
    {{- if hasKey .Values "extra_deployment_labels" }}
    {{- range $key, $val := .Values.extra_deployment_labels }}
    {{ $key }}: {{ $val | quote }}
    {{- end }}
    {{- end }}
    {{- if hasKey .Values "openonu_deployment_labels" }}
    {{- range $key, $val := .Values.openonu_deployment_labels }}
    {{ $key }}: {{ $val | quote }}
    {{- end }}
    {{- end }}
  {{- end }}
spec:
  replicas: {{ .Values.replicas.adapter_open_onu }}
  selector:
    matchLabels:
      app: adapter-open-onu
      release: {{ .Release.Name }}
  template:
    metadata:
      namespace: {{ .Release.Namespace }}
      labels:
        app: adapter-open-onu
        release: {{ .Release.Name }}
        app.kubernetes.io/name: "adapter-open-onu"
        app.kubernetes.io/version: {{ quote .Chart.AppVersion }}
        app.kubernetes.io/component: "adapter"
        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 "openonu_pod_labels" }}
        {{- range $key, $val := .Values.openonu_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:
        - name: adapter-open-onu
          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 . ) . }}'
          imagePullPolicy: {{ tpl .Values.images.adapter_open_onu_go.pullPolicy . }}
          env:
            - name: COMPONENT_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.labels['app.kubernetes.io/name']
            - name: KV_STORE_DATAPATH_PREFIX
              value: {{ tpl .Values.adapter_open_onu.kv_store_data_prefix . }}
          args:
            - "/app/openonu"
            - "--banner=true"
            - "--kafka_reconnect_retries=-1"
            - "--core_endpoint={{ tpl .Values.global.core_endpoint . }}"
            - "--adapter_endpoint={{ tpl .Values.adapter_open_onu.endpoints.address . }}.{{ .Release.Namespace }}.svc:{{ print .Values.adapter_open_onu.endpoints.port }}"
            - "--kafka_cluster_address={{ tpl .Values.services.kafka.cluster.address . }}"
            - "--event_topic={{ .Values.adapter_open_onu.topics.event_topic }}"
            - "--kv_store_type={{ tpl .Values.services.kvstore.type . }}"
            - "--kv_store_address={{ tpl .Values.services.kvstore.address . }}"
            - "--kv_store_request_timeout={{ tpl .Values.adapter_open_onu.kv_store_timeout . }}"
            - "--log_level={{ $log_level }}"
            - "--probe_port=8080"
            - "--accept_incr_evto={{ tpl .Values.adapter_open_onu.incremental_evto_update . }}"
            - "--max_timeout_interadapter_comm={{ tpl .Values.adapter_open_onu.max_timeout_interadapter_comm . }}"
            - "--max_timeout_reconciling={{ tpl .Values.adapter_open_onu.max_timeout_reconciling . }}"
            - "--omci_timeout={{ tpl .Values.adapter_open_onu.omci_timeout . }}"
            - "--rpc_timeout={{ tpl .Values.adapter_open_onu.rpc_timeout . }}"
            - "--trace_enabled={{ .Values.global.tracing.enabled }}"
            - "--trace_agent_address={{ tpl .Values.services.tracing_agent.address . }}"
            - "--log_correlation_enabled={{ .Values.global.log_correlation.enabled }}"
            - "--allowed_onu_vendors={{ template "allowed_onu_vendors" . }}"
            - "--metrics_enabled={{ .Values.global.metrics.enabled }}"
            - "--extended_omci_support_enabled={{ .Values.global.extended_omci_support.enabled }}"
            - "--mib_audit_interval={{ .Values.global.mib_audit.interval }}"
            - "--alarm_audit_interval={{ .Values.global.alarm_audit.interval }}"
            - "--uni_port_mask={{ .Values.adapter_open_onu.uni_port_mask }}"
            - "--skip_onu_config_enabled={{ .Values.global.skip_onu_config.enabled }}"
            - "--check_device_tech_prof_on_reboot_enabled={{ .Values.global.check_device_tech_prof_on_reboot.enabled }}"              
          {{- if .Values.securityContext.enabled }}
          securityContext:
            allowPrivilegeEscalation: false
          {{- end }}
          ports:
            - containerPort: {{ .Values.adapter_open_onu.endpoints.port }}
              name: grpc
          livenessProbe:
            httpGet:
              path: /healthz
              port: 8080
            initialDelaySeconds: {{ .Values.probe.liveness.initial_delay_seconds }}
            periodSeconds: {{ .Values.probe.liveness.period_seconds }}
          readinessProbe:
            httpGet:
              path: /readz
              port: 8080
            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 }}
      affinity:
        podAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
            {{- if .Values.scheduleRules.preferStackPodsOnSameNode }}
            - podAffinityTerm:
                topologyKey: kubernetes.io/hostname
                labelSelector:
                  matchExpressions:
                    - key: app.kubernetes.io/stack
                      operator: In
                      values:
                        - {{ .Values.global.stack_name }}
              weight: 100
            {{- end }}
        podAntiAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
            {{- if .Values.scheduleRules.preferStacksOnDifferentNodes }}
            - podAffinityTerm:
                topologyKey: kubernetes.io/hostname
                labelSelector:
                  matchExpressions:
                    - key: app.kubernetes.io/name
                      operator: In
                      values:
                        - adapter-open-onu
              weight: 100
            {{- end }}
