# Default values for local-path-provisioner.

replicaCount: 1

image:
  repository: rancher/local-path-provisioner
  # Overrides the image tag whose default is the chart appVersion.
  tag: v0.0.18
  pullPolicy: IfNotPresent

helperImage:
  repository: busybox
  tag: latest

defaultSettings:
  registrySecret: ~

privateRegistry:
  registryUrl: ~
  registryUser: ~
  registryPasswd: ~

imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""

## For creating the StorageClass automatically:
storageClass:
  create: true

  ## Set a provisioner name. If unset, a name will be generated.
  # provisionerName: rancher.io/local-path

  ## Set StorageClass as the default StorageClass
  ## Ignored if storageClass.create is false
  defaultClass: false

  ## Set a StorageClass name
  ## Ignored if storageClass.create is false
  name: local-path

  ## ReclaimPolicy field of the class, which can be either Delete or Retain
  reclaimPolicy: Delete

  ## Default host path for creating volumes. If you need custom paths for nodes, 
  ## please use customNodePathMap, in which case this setting is ignored.
  hostDir: /opt/local-path-provisioner

# customNodePathMap is the place user can customize where to store the data on each node.
# 1. If one node is not listed on the nodePathMap, and Kubernetes wants to create volume on it, the paths specified in
#    DEFAULT_PATH_FOR_NON_LISTED_NODES will be used for provisioning.
# 2. If one node is listed on the customNodePathMap, the specified paths will be used for provisioning.
#     1. If one node is listed but with paths set to [], the provisioner will refuse to provision on this node.
#     2. If more than one path was specified, the path would be chosen randomly when provisioning.
#
# The configuration must obey following rules:
# 1. A path must start with /, a.k.a an absolute path.
# 2. Root directory (/) is prohibited.
# 3. No duplicate paths allowed for one node.
# 4. No duplicate node allowed.
customNodePathMap: []
#  - node: DEFAULT_PATH_FOR_NON_LISTED_NODES
#    paths:
#      - /opt/local-path-provisioner
#  - node: node1
#    paths:
#      - /mnt/otherfolder

rbac:
  # Specifies whether RBAC resources should be created
  create: true

serviceAccount:
  # Specifies whether a service account should be created
  create: true
  # Annotations to add to the service account
  annotations: {}
  # The name of the service account to use.
  # If not set and create is true, a name is generated using the fullname template
  name: ""

podAnnotations: {}

podSecurityContext: {}
  # fsGroup: 2000

securityContext: {}
  # capabilities:
  #   drop:
  #   - ALL
  # readOnlyRootFilesystem: true
  # runAsNonRoot: true
  # runAsUser: 1000

resources: {}
  # We usually recommend not to specify default resources and to leave this as a conscious
  # choice for the user. This also increases chances charts run on environments with little
  # resources, such as Minikube. If you do want to specify resources, uncomment the following
  # lines, adjust them as necessary, and remove the curly braces after 'resources:'.
  # limits:
  #   cpu: 100m
  #   memory: 128Mi
  # requests:
  #   cpu: 100m
  #   memory: 128Mi


nodeSelector: {}

tolerations: []

affinity: {}

configmap:
  # specify the config map name
  name: local-path-config
  # specify the custom script for setup and teardown
  setup: |-
    #!/bin/sh
    while getopts "m:s:p:" opt
    do
        case $opt in
            p)
            absolutePath=$OPTARG
            ;;
            s)
            sizeInBytes=$OPTARG
            ;;
            m)
            volMode=$OPTARG
            ;;
        esac
    done

    mkdir -m 0777 -p ${absolutePath}
  teardown: |-
    #!/bin/sh
    while getopts "m:s:p:" opt
    do
        case $opt in
            p)
            absolutePath=$OPTARG
            ;;
            s)
            sizeInBytes=$OPTARG
            ;;
            m)
            volMode=$OPTARG
            ;;
        esac
    done

    rm -rf ${absolutePath}
  # specify the custom helper pod yaml
  helperPod: |-
    apiVersion: v1
    kind: Pod
    metadata:
      name: helper-pod
    spec:
      containers:
      - name: helper-pod
        image: busybox