{{- if .Values.manager.enabled -}}
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: neuvector-manager-pod
  namespace: {{ .Release.Namespace }}
  labels:
    chart: {{ template "neuvector.chart" . }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: neuvector-manager-pod
        release: {{ .Release.Name }}
    spec:
    {{- if .Values.imagePullSecrets }}
      imagePullSecrets:
        - name: {{ .Values.imagePullSecrets }}
    {{- end }}
      containers:
        - name: neuvector-manager-pod
          image: "{{ .Values.registry }}/{{ .Values.manager.image.repository }}:{{ .Values.tag }}"
          env:
            - name: CTRL_SERVER_IP
              value: neuvector-svc-controller.{{ .Release.Namespace }}
            - name: MANAGER_SSL
            {{- if .Values.manager.ingress.enabled }}
              value: "off"
            {{- else }}
              value: "{{ .Values.manager.env.ssl }}"
            {{- end }}
      restartPolicy: Always
{{- end }}