# 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 }}
---
apiVersion: apps/v1beta1
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 }}
  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/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']
        args:
        - "/app/ofagent"
        {{- range .Values.services.controller }}
        - "--controller={{ .service }}:{{ .port }}"
        {{- end }}
        - "--voltha={{ template "fullname" . }}-api.{{ .Release.Namespace }}.svc:55555"
        - "--kv_store_address=etcd.{{ .Release.Namespace }}.svc:{{ .Values.services.etcd.port }}"
        - "--kv_store_type=etcd"
        - "--kv_store_request_timeout=60s"
        - "--log_level={{ $log_level }}"
        - "--probe=:8080"
        {{- 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
