# Copyright 2020-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.ofagent.log_level . | upper -}}
{{- $onosReplicas := default 1 .Values.onos_classic.replicas -}}
{{- $onosOfPort := default 6653 .Values.onos_classic.onosOfPort -}}
{{- $infraName := default "voltha-infra" .Values.global.voltha_infra_name -}}
{{- $infraNamespaces := default "infra" .Values.global.voltha_infra_namespace -}}
{{- $controllers := dict "controllers" (list) -}}
{{- range $i, $e := until ($onosReplicas | int) -}}
  {{- $current := printf "%s-onos-classic-%d.%s-onos-classic-hs.%s.svc:%d" $infraName $i $infraName $infraNamespaces ($onosOfPort | int) -}}
  {{- $controllers := (mustAppend $controllers.controllers $current) | set $controllers "controllers" -}}
{{- end -}}
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: "{{ template "fullname" . }}-ofagent"
  namespace: {{ .Release.Namespace }}
  {{- if or (hasKey .Values "extra_deployment_labels") (hasKey .Values "ofagent_deployment_labels") }}
  labels:
    {{- if hasKey .Values "extra_deployment_labels" }}
    {{- range $key, $val := .Values.extra_deployment_labels }}
    {{ $key }}: {{ $val | quote }}
    {{- end }}
    {{- end }}
    {{- if hasKey .Values "ofagent_deployment_labels" }}
    {{- range $key, $val := .Values.ofagent_deployment_labels }}
    {{ $key }}: {{ $val | quote }}
    {{- end }}
    {{- end }}
  {{- end }}
spec:
  replicas: {{ .Values.replicas.ofagent }}
  selector:
    matchLabels:
      app: ofagent
      release: {{ .Release.Name }}
  template:
    metadata:
      namespace: {{ .Release.Namespace }}
      labels:
        app: ofagent
        release: {{ .Release.Name }}
        app.kubernetes.io/name: "open-flow-agent"
        app.kubernetes.io/version: {{ quote .Chart.AppVersion }}
        app.kubernetes.io/component: "integration"
        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 "ofagent_pod_labels" }}
        {{- range $key, $val := .Values.ofagent_pod_labels }}
        {{ $key }}: {{ $val | quote }}
        {{- end }}
        {{- end }}
    spec:
      terminationGracePeriodSeconds: 10
      {{- if .Values.securityContext.enabled }}
      securityContext:
        runAsUser: {{ .Values.securityContext.runAsUser }}
        runAsGroup: {{ .Values.securityContext.runAsGroup }}
        fsGroup: {{ .Values.securityContext.fsGroup }}
      {{- end }}
      containers:
      - name: ofagent
        image: '{{ tpl .Values.images.ofagent.registry . }}{{ tpl .Values.images.ofagent.repository . }}:{{ tpl .Values.images.ofagent.tag . }}'
        imagePullPolicy: {{ tpl .Values.images.ofagent.pullPolicy . }}
        env:
          - name: COMPONENT_NAME
            valueFrom:
              fieldRef:
                fieldPath: metadata.labels['app.kubernetes.io/name']
          - name: KV_STORE_DATAPATH_PREFIX
            value: {{ tpl .Values.ofagent.kv_store_data_prefix . }}
        args:
        - "/app/ofagent"
        {{- if eq (len .Values.services.controller) 0 }}
        {{- range $controllers.controllers }}
        - "--controller={{ . }}"
        {{- end }}
        {{- end }}
        {{- range .Values.services.controller }}
        - "--controller={{ tpl .address $ }}"
        {{- end }}
        - "--voltha={{ template "fullname" . }}-api.{{ .Release.Namespace }}.svc:55555"
        - "--kv_store_type={{ tpl .Values.services.kvstore.type . }}"
        - "--kv_store_address={{ tpl .Values.services.kvstore.address . }}"
        - "--kv_store_request_timeout=60s"
        - "--log_level={{ $log_level }}"
        - "--device-refresh-interval={{ .Values.ofagent.device_refresh_interval }}"
        - "--probe=:8080"
        - "--trace_enabled={{ .Values.global.tracing.enabled }}"
        - "--trace_agent_address={{ tpl .Values.services.tracing_agent.address . }}"
        - "--log_correlation_enabled={{ .Values.global.log_correlation.enabled }}"
        {{- if .Values.securityContext.enabled }}
        securityContext:
          allowPrivilegeEscalation: false
        {{- end }}
        livenessProbe:
          httpGet:
            path: /healthz
            port: 8080
          initialDelaySeconds: 10
          periodSeconds: 5
        readinessProbe:
          httpGet:
            path: /readz
            port: 8080
          initialDelaySeconds: 10
          periodSeconds: 5
        resources:
            requests:
              {{- if .Values.resources.ofagent.requests.memory }}
              memory: {{ .Values.resources.ofagent.requests.memory }}
              {{- end }}
              {{- if .Values.resources.ofagent.requests.cpu }}
              cpu: {{ .Values.resources.ofagent.requests.cpu }}
              {{- end }}
            limits:
              {{- if .Values.resources.ofagent.limits.memory }}
              memory: {{ .Values.resources.ofagent.limits.memory }}
              {{- end }}
              {{- if .Values.resources.ofagent.limits.cpu }}
              cpu: {{ .Values.resources.ofagent.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:
                        - open-flow-agent
              weight: 100
            {{- end }}
