apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  labels:
{{ include "reloader-labels.stakater" . | indent 4 }}
{{ include "reloader-labels.chart" . | indent 4 }}
  name: {{ template "reloader-name" . }}
spec:
  replicas: 1
  revisionHistoryLimit: 2
  selector:
    matchLabels:
{{ include "reloader-labels.selector" . | indent 6 }}
  template:
    metadata:
      labels:
{{ include "reloader-labels.selector" . | indent 8 }}
    spec:
      containers:
      - env:
      {{- if eq .Values.reloader.watchGlobally false }}
        - name: KUBERNETES_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
      {{- end }}
        image: "{{ .Values.reloader.image.name }}:{{ .Values.reloader.image.tag }}"
        imagePullPolicy: {{ .Values.reloader.image.pullPolicy }}
        name: {{ template "reloader-name" . }}
      serviceAccountName: {{ template "reloader-name" . }}
              