# 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_address={{ tpl .Values.services.etcd.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 }}"              
          {{- 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 }}
