# Copyright 2020-present Open Networking Foundation
#
# 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) -}}
  {{- $port := add $onosOfPort $i -}}
  {{- $current := printf "%s-onos-classic-%d.%s-onos-classic-hs.%s.svc:%d" $infraName $i $infraName $infraNamespaces $port -}}
  {{- $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: {{ .Values.global.kv_store_data_prefix }}
        args:
        - "/app/ofagent"
        {{- range $controllers.controllers }}
        - "--controller={{ . }}"
        {{- end }}
        {{- range .Values.services.controller }}
        - "--controller={{ tpl .address $ }}"
        {{- end }}
        - "--voltha={{ template "fullname" . }}-api.{{ .Release.Namespace }}.svc:55555"
        - "--kv_store_address={{ .Values.services.etcd.address }}"
        - "--kv_store_type=etcd"
        - "--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
