Skip to content

Commit

Permalink
Merge pull request kubernetes-sigs#56 from ariksidney/helm-pathpatter…
Browse files Browse the repository at this point in the history
…n-support

Helm pathpattern support
  • Loading branch information
k8s-ci-robot authored Mar 3, 2021
2 parents a99f3da + 571aadd commit 487b909
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ To disable leader election, define an env variable named ENABLE_LEADER_ELECTION
| --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------: |
| onDelete | If it exists and has a delete value, delete the directory, if it exists and has a retain value, save the directory. | will be archived with name on the share: `archived-<volume.Name>` |
| archiveOnDelete | If it exists and has a false value, delete the directory. if `onDelete` exists, `archiveOnDelete` will be ignored. | will be archived with name on the share: `archived-<volume.Name>` |
| pathPattern | Specifies a template for creating a directory path via PVC metadata's such as labels, annotations, name or namespace. To specify metadata use `${.PVC.}`: `${PVC.namespace}` | n/a |
| pathPattern | Specifies a template for creating a directory path via PVC metadata's such as labels, annotations, name or namespace. To specify metadata use `${.PVC.<metadata>}`. Example: If folder should be named like `<pvc-namespace>-<pvc-name>`, use `${.PVC.namespace}-${.PVC.name}` as pathPattern. | n/a |

This is `deploy/class.yaml` which defines the NFS subdir external provisioner's Kubernetes Storage Class:

Expand Down
1 change: 1 addition & 0 deletions charts/nfs-subdir-external-provisioner/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ The following tables lists the configurable parameters of this chart and their d
| `storageClass.reclaimPolicy` | Method used to reclaim an obsoleted volume | `Delete` |
| `storageClass.provisionerName` | Name of the provisionerName | null |
| `storageClass.archiveOnDelete` | Archive pvc when deleting | `true` |
| `storageClass.pathPattern` | Specifies a template for the directory name | null |
| `storageClass.accessModes` | Set access mode for PV | `ReadWriteOnce` |
| `leaderElection.enabled` | Enables or disables leader election | `true` |
| `nfs.server` | Hostname of the NFS server (required) | null (ip or hostname) |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ allowVolumeExpansion: {{ .Values.storageClass.allowVolumeExpansion }}
reclaimPolicy: {{ .Values.storageClass.reclaimPolicy }}
parameters:
archiveOnDelete: "{{ .Values.storageClass.archiveOnDelete }}"
{{- if .Values.storageClass.pathPattern }}
pathPattern: "{{ .Values.storageClass.pathPattern }}"
{{- end }}
{{- if .Values.nfs.mountOptions }}
mountOptions:
{{- range .Values.nfs.mountOptions }}
Expand Down
4 changes: 4 additions & 0 deletions charts/nfs-subdir-external-provisioner/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ storageClass:
# When set to false your PVs will not be archived by the provisioner upon deletion of the PVC.
archiveOnDelete: true

# Specifies a template for creating a directory path via PVC metadata's such as labels, annotations, name or namespace.
# Ignored if value not set.
pathPattern:

# Set access mode - ReadWriteOnce, ReadOnlyMany or ReadWriteMany
accessModes: ReadWriteOnce

Expand Down

0 comments on commit 487b909

Please sign in to comment.