---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: local-path-provisioner
  namespace: {{ local_path_provisioner_namespace }}
spec:
  replicas: 1
  selector:
    matchLabels:
      app: local-path-provisioner
  template:
    metadata:
      labels:
        app: local-path-provisioner
    spec:
      serviceAccountName: local-path-provisioner-service-account
      containers:
      - name: local-path-provisioner
        image: {{ local_path_provisioner_image_repo }}:{{ local_path_provisioner_image_tag }}
        imagePullPolicy: {{ k8s_image_pull_policy }}
        command:
        - local-path-provisioner
        - start
        - --config
        - /etc/config/config.json
{% if local_path_provisioner_debug | default(false) %}
        - --debug
{% endif %}
        volumeMounts:
        - name: config-volume
          mountPath: /etc/config/
        env:
        - name: POD_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
      volumes:
        - name: config-volume
          configMap:
            name: local-path-config
