Skip to content

Commit c2a2d5d

Browse files
authored
Merge pull request #267 from justdan96/master
Use a PDB if the Enabled in the values.yaml
2 parents cf9332a + 63586f9 commit c2a2d5d

File tree

5 files changed

+68
-38
lines changed

5 files changed

+68
-38
lines changed

charts/nfs-subdir-external-provisioner/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ appVersion: 4.0.2
33
description: nfs-subdir-external-provisioner is an automatic provisioner that used your *already configured* NFS server, automatically creating Persistent Volumes.
44
name: nfs-subdir-external-provisioner
55
home: https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner
6-
version: 4.0.17
6+
version: 4.0.18
77
kubeVersion: ">=1.9.0-0"
88
sources:
99
- https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner

charts/nfs-subdir-external-provisioner/README.md

+39-37
Original file line numberDiff line numberDiff line change
@@ -48,43 +48,45 @@ The command removes all the Kubernetes components associated with the chart and
4848

4949
The following tables lists the configurable parameters of this chart and their default values.
5050

51-
| Parameter | Description | Default |
52-
| ----------------------------------- | ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
53-
| `replicaCount` | Number of provisioner instances to deployed | `1` |
54-
| `strategyType` | Specifies the strategy used to replace old Pods by new ones | `Recreate` |
55-
| `image.repository` | Provisioner image | `registry.k8s.io/sig-storage/nfs-subdir-external-provisioner` |
56-
| `image.tag` | Version of provisioner image | `v4.0.2` |
57-
| `image.pullPolicy` | Image pull policy | `IfNotPresent` |
58-
| `imagePullSecrets` | Image pull secrets | `[]` |
59-
| `storageClass.name` | Name of the storageClass | `nfs-client` |
60-
| `storageClass.defaultClass` | Set as the default StorageClass | `false` |
61-
| `storageClass.allowVolumeExpansion` | Allow expanding the volume | `true` |
62-
| `storageClass.reclaimPolicy` | Method used to reclaim an obsoleted volume | `Delete` |
63-
| `storageClass.provisionerName` | Name of the provisionerName | null |
64-
| `storageClass.archiveOnDelete` | Archive PVC when deleting | `true` |
65-
| `storageClass.onDelete` | Strategy on PVC deletion. Overrides archiveOnDelete when set to lowercase values 'delete' or 'retain' | null |
66-
| `storageClass.pathPattern` | Specifies a template for the directory name | null |
67-
| `storageClass.accessModes` | Set access mode for PV | `ReadWriteOnce` |
68-
| `storageClass.volumeBindingMode` | Set volume binding mode for Storage Class | `Immediate` |
69-
| `storageClass.annotations` | Set additional annotations for the StorageClass | `{}` |
70-
| `leaderElection.enabled` | Enables or disables leader election | `true` |
71-
| `nfs.server` | Hostname of the NFS server (required) | null (ip or hostname) |
72-
| `nfs.path` | Basepath of the mount point to be used | `/nfs-storage` |
73-
| `nfs.mountOptions` | Mount options (e.g. 'nfsvers=3') | null |
74-
| `nfs.volumeName` | Volume name used inside the pods | `nfs-subdir-external-provisioner-root` |
75-
| `nfs.reclaimPolicy` | Reclaim policy for the main nfs volume used for subdir provisioning | `Retain` |
76-
| `resources` | Resources required (e.g. CPU, memory) | `{}` |
77-
| `rbac.create` | Use Role-based Access Control | `true` |
78-
| `podSecurityPolicy.enabled` | Create & use Pod Security Policy resources | `false` |
79-
| `podAnnotations` | Additional annotations for the Pods | `{}` |
80-
| `priorityClassName` | Set pod priorityClassName | null |
81-
| `serviceAccount.create` | Should we create a ServiceAccount | `true` |
82-
| `serviceAccount.name` | Name of the ServiceAccount to use | null |
83-
| `serviceAccount.annotations` | Additional annotations for the ServiceAccount | `{}` |
84-
| `nodeSelector` | Node labels for pod assignment | `{}` |
85-
| `affinity` | Affinity settings | `{}` |
86-
| `tolerations` | List of node taints to tolerate | `[]` |
87-
| `labels` | Additional labels for any resource created | `{}` |
51+
| Parameter | Description | Default |
52+
| ------------------------------------ | ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
53+
| `replicaCount` | Number of provisioner instances to deployed | `1` |
54+
| `strategyType` | Specifies the strategy used to replace old Pods by new ones | `Recreate` |
55+
| `image.repository` | Provisioner image | `registry.k8s.io/sig-storage/nfs-subdir-external-provisioner` |
56+
| `image.tag` | Version of provisioner image | `v4.0.2` |
57+
| `image.pullPolicy` | Image pull policy | `IfNotPresent` |
58+
| `imagePullSecrets` | Image pull secrets | `[]` |
59+
| `storageClass.name` | Name of the storageClass | `nfs-client` |
60+
| `storageClass.defaultClass` | Set as the default StorageClass | `false` |
61+
| `storageClass.allowVolumeExpansion` | Allow expanding the volume | `true` |
62+
| `storageClass.reclaimPolicy` | Method used to reclaim an obsoleted volume | `Delete` |
63+
| `storageClass.provisionerName` | Name of the provisionerName | null |
64+
| `storageClass.archiveOnDelete` | Archive PVC when deleting | `true` |
65+
| `storageClass.onDelete` | Strategy on PVC deletion. Overrides archiveOnDelete when set to lowercase values 'delete' or 'retain' | null |
66+
| `storageClass.pathPattern` | Specifies a template for the directory name | null |
67+
| `storageClass.accessModes` | Set access mode for PV | `ReadWriteOnce` |
68+
| `storageClass.volumeBindingMode` | Set volume binding mode for Storage Class | `Immediate` |
69+
| `storageClass.annotations` | Set additional annotations for the StorageClass | `{}` |
70+
| `leaderElection.enabled` | Enables or disables leader election | `true` |
71+
| `nfs.server` | Hostname of the NFS server (required) | null (ip or hostname) |
72+
| `nfs.path` | Basepath of the mount point to be used | `/nfs-storage` |
73+
| `nfs.mountOptions` | Mount options (e.g. 'nfsvers=3') | null |
74+
| `nfs.volumeName` | Volume name used inside the pods | `nfs-subdir-external-provisioner-root` |
75+
| `nfs.reclaimPolicy` | Reclaim policy for the main nfs volume used for subdir provisioning | `Retain` |
76+
| `resources` | Resources required (e.g. CPU, memory) | `{}` |
77+
| `rbac.create` | Use Role-based Access Control | `true` |
78+
| `podSecurityPolicy.enabled` | Create & use Pod Security Policy resources | `false` |
79+
| `podAnnotations` | Additional annotations for the Pods | `{}` |
80+
| `priorityClassName` | Set pod priorityClassName | null |
81+
| `serviceAccount.create` | Should we create a ServiceAccount | `true` |
82+
| `serviceAccount.name` | Name of the ServiceAccount to use | null |
83+
| `serviceAccount.annotations` | Additional annotations for the ServiceAccount | `{}` |
84+
| `nodeSelector` | Node labels for pod assignment | `{}` |
85+
| `affinity` | Affinity settings | `{}` |
86+
| `tolerations` | List of node taints to tolerate | `[]` |
87+
| `labels` | Additional labels for any resource created | `{}` |
88+
| `podDisruptionBudget.enabled` | Create and use Pod Disruption Budget | `false` |
89+
| `podDisruptionBudget.maxUnavailable` | Set maximum unavailable pods in the Pod Disruption Budget | `1` |
8890

8991
## Install Multiple Provisioners
9092

charts/nfs-subdir-external-provisioner/templates/_helpers.tpl

+11
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,17 @@ Return the appropriate apiVersion for podSecurityPolicy.
6161
{{- end -}}
6262
{{- end -}}
6363

64+
{{/*
65+
Return the appropriate apiVersion for podDisruptionBudget.
66+
*/}}
67+
{{- define "podDisruptionBudget.apiVersion" -}}
68+
{{- if semverCompare ">=1.21-0" .Capabilities.KubeVersion.GitVersion -}}
69+
{{- print "policy/v1" -}}
70+
{{- else -}}
71+
{{- print "policy/v1beta1" -}}
72+
{{- end -}}
73+
{{- end -}}
74+
6475
{{/*
6576
Common labels
6677
*/}}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{{- if .Values.podDisruptionBudget.enabled }}
2+
apiVersion: {{ template "podDisruptionBudget.apiVersion" . }}
3+
kind: PodDisruptionBudget
4+
metadata:
5+
labels:
6+
{{- include "nfs-subdir-external-provisioner.labels" . | nindent 4 }}
7+
name: {{ template "nfs-subdir-external-provisioner.fullname" . }}
8+
spec:
9+
maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable | default 1 }}
10+
selector:
11+
matchLabels:
12+
{{- include "nfs-subdir-external-provisioner.selectorLabels" . | nindent 6 }}
13+
{{- end }}

charts/nfs-subdir-external-provisioner/values.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,7 @@ affinity: {}
108108

109109
# Additional labels for any resource created
110110
labels: {}
111+
112+
podDisruptionBudget:
113+
enabled: false
114+
maxUnavailable: 1

0 commit comments

Comments
 (0)