Skip to content

Commit 7947697

Browse files
authored
Merge pull request #72 from yonatankahana/chart-labels-and-annotations
Helm chart labels and annotations and add missing image pull secrets in documentation
2 parents 48e51b1 + 1cafa67 commit 7947697

File tree

14 files changed

+96
-71
lines changed

14 files changed

+96
-71
lines changed

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

Lines changed: 1 addition & 1 deletion
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.8
6+
version: 4.0.9
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

Lines changed: 34 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -48,32 +48,37 @@ 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 | `k8s.gcr.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-
| `storageClass.name` | Name of the storageClass | `nfs-client` |
59-
| `storageClass.defaultClass` | Set as the default StorageClass | `false` |
60-
| `storageClass.allowVolumeExpansion` | Allow expanding the volume | `true` |
61-
| `storageClass.reclaimPolicy` | Method used to reclaim an obsoleted volume | `Delete` |
62-
| `storageClass.provisionerName` | Name of the provisionerName | null |
63-
| `storageClass.archiveOnDelete` | Archive PVC when deleting | `true` |
64-
| `storageClass.onDelete` | Strategy on PVC deletion. Overrides `archiveOnDelete` when set to lowercase values `delete` or `retain` | null |
65-
| `storageClass.pathPattern` | Specifies a template for the directory name | null |
66-
| `storageClass.accessModes` | Set access mode for PV | `ReadWriteOnce` |
67-
| `leaderElection.enabled` | Enables or disables leader election | `true` |
68-
| `nfs.server` | Hostname of the NFS server (required) | null (ip or hostname) |
69-
| `nfs.path` | Basepath of the mount point to be used | `/nfs-storage` |
70-
| `nfs.mountOptions` | Mount options (e.g. 'nfsvers=3') | null |
71-
| `resources` | Resources required (e.g. CPU, memory) | `{}` |
72-
| `rbac.create` | Use Role-based Access Control | `true` |
73-
| `podSecurityPolicy.enabled` | Create & use Pod Security Policy resources | `false` |
74-
| `priorityClassName` | Set pod priorityClassName | null |
75-
| `serviceAccount.create` | Should we create a ServiceAccount | `true` |
76-
| `serviceAccount.name` | Name of the ServiceAccount to use | null |
77-
| `nodeSelector` | Node labels for pod assignment | `{}` |
78-
| `affinity` | Affinity settings | `{}` |
79-
| `tolerations` | List of node taints to tolerate | `[]` |
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 | `k8s.gcr.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.annotations` | Set additional annotations for the StorageClass | `{}` |
69+
| `leaderElection.enabled` | Enables or disables leader election | `true` |
70+
| `nfs.server` | Hostname of the NFS server (required) | null (ip or hostname) |
71+
| `nfs.path` | Basepath of the mount point to be used | `/nfs-storage` |
72+
| `nfs.mountOptions` | Mount options (e.g. 'nfsvers=3') | null |
73+
| `resources` | Resources required (e.g. CPU, memory) | `{}` |
74+
| `rbac.create` | Use Role-based Access Control | `true` |
75+
| `podSecurityPolicy.enabled` | Create & use Pod Security Policy resources | `false` |
76+
| `podAnnotations` | Additional annotations for the Pods | `{}` |
77+
| `priorityClassName` | Set pod priorityClassName | null |
78+
| `serviceAccount.create` | Should we create a ServiceAccount | `true` |
79+
| `serviceAccount.name` | Name of the ServiceAccount to use | null |
80+
| `serviceAccount.annotations` | Additional annotations for the ServiceAccount | `{}` |
81+
| `nodeSelector` | Node labels for pod assignment | `{}` |
82+
| `affinity` | Affinity settings | `{}` |
83+
| `tolerations` | List of node taints to tolerate | `[]` |
84+
| `labels` | Additional labels for any resource created | `{}` |

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

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,24 @@ Return the appropriate apiVersion for podSecurityPolicy.
5959
{{- else -}}
6060
{{- print "extensions/v1beta1" -}}
6161
{{- end -}}
62-
{{- end -}}
62+
{{- end -}}
63+
64+
{{/*
65+
Common labels
66+
*/}}
67+
{{- define "nfs-subdir-external-provisioner.labels" -}}
68+
chart: {{ template "nfs-subdir-external-provisioner.chart" . }}
69+
heritage: {{ .Release.Service }}
70+
{{ include "nfs-subdir-external-provisioner.selectorLabels" . }}
71+
{{- with .Values.labels }}
72+
{{- toYaml . | nindent 0 }}
73+
{{- end }}
74+
{{- end }}
75+
76+
{{/*
77+
Selector labels
78+
*/}}
79+
{{- define "nfs-subdir-external-provisioner.selectorLabels" -}}
80+
app: {{ template "nfs-subdir-external-provisioner.name" . }}
81+
release: {{ .Release.Name }}
82+
{{- end }}

charts/nfs-subdir-external-provisioner/templates/clusterrole.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@ kind: ClusterRole
33
apiVersion: rbac.authorization.k8s.io/v1
44
metadata:
55
labels:
6-
app: {{ template "nfs-subdir-external-provisioner.name" . }}
7-
chart: {{ template "nfs-subdir-external-provisioner.chart" . }}
8-
heritage: {{ .Release.Service }}
9-
release: {{ .Release.Name }}
6+
{{- include "nfs-subdir-external-provisioner.labels" . | nindent 4 }}
107
name: {{ template "nfs-subdir-external-provisioner.fullname" . }}-runner
118
rules:
129
- apiGroups: [""]

charts/nfs-subdir-external-provisioner/templates/clusterrolebinding.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@ kind: ClusterRoleBinding
33
apiVersion: rbac.authorization.k8s.io/v1
44
metadata:
55
labels:
6-
app: {{ template "nfs-subdir-external-provisioner.name" . }}
7-
chart: {{ template "nfs-subdir-external-provisioner.chart" . }}
8-
heritage: {{ .Release.Service }}
9-
release: {{ .Release.Name }}
6+
{{- include "nfs-subdir-external-provisioner.labels" . | nindent 4 }}
107
name: run-{{ template "nfs-subdir-external-provisioner.fullname" . }}
118
subjects:
129
- kind: ServiceAccount

charts/nfs-subdir-external-provisioner/templates/deployment.yaml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,25 @@ kind: Deployment
33
metadata:
44
name: {{ template "nfs-subdir-external-provisioner.fullname" . }}
55
labels:
6-
app: {{ template "nfs-subdir-external-provisioner.name" . }}
7-
chart: {{ template "nfs-subdir-external-provisioner.chart" . }}
8-
heritage: {{ .Release.Service }}
9-
release: {{ .Release.Name }}
6+
{{- include "nfs-subdir-external-provisioner.labels" . | nindent 4 }}
107
spec:
118
replicas: {{ .Values.replicaCount }}
129
strategy:
1310
type: {{ .Values.strategyType }}
1411
selector:
1512
matchLabels:
16-
app: {{ template "nfs-subdir-external-provisioner.name" . }}
17-
release: {{ .Release.Name }}
13+
{{- include "nfs-subdir-external-provisioner.selectorLabels" . | nindent 6 }}
1814
template:
1915
metadata:
2016
annotations:
17+
{{- with .Values.podAnnotations }}
18+
{{- toYaml . | nindent 8 }}
19+
{{- end }}
2120
{{- if and (.Values.tolerations) (semverCompare "<1.6-0" .Capabilities.KubeVersion.GitVersion) }}
2221
scheduler.alpha.kubernetes.io/tolerations: '{{ toJson .Values.tolerations }}'
2322
{{- end }}
2423
labels:
25-
app: {{ template "nfs-subdir-external-provisioner.name" . }}
26-
release: {{ .Release.Name }}
24+
{{- include "nfs-subdir-external-provisioner.selectorLabels" . | nindent 8 }}
2725
spec:
2826
serviceAccountName: {{ template "nfs-subdir-external-provisioner.serviceAccountName" . }}
2927
{{- if .Values.nodeSelector }}
@@ -37,9 +35,9 @@ spec:
3735
{{- if .Values.priorityClassName }}
3836
priorityClassName: {{ .Values.priorityClassName | quote }}
3937
{{- end }}
40-
{{- if .Values.imagePullSecrets }}
38+
{{- with .Values.imagePullSecrets }}
4139
imagePullSecrets:
42-
{{ toYaml .Values.imagePullSecrets | indent 8 }}
40+
{{- toYaml . | nindent 8 }}
4341
{{- end }}
4442
containers:
4543
- name: {{ .Chart.Name }}

charts/nfs-subdir-external-provisioner/templates/persistentvolume.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ kind: PersistentVolume
44
metadata:
55
name: pv-{{ template "nfs-subdir-external-provisioner.fullname" . }}
66
labels:
7+
{{- include "nfs-subdir-external-provisioner.labels" . | nindent 4 }}
78
nfs-subdir-external-provisioner: {{ template "nfs-subdir-external-provisioner.fullname" . }}
89
spec:
910
capacity:

charts/nfs-subdir-external-provisioner/templates/persistentvolumeclaim.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ kind: PersistentVolumeClaim
33
apiVersion: v1
44
metadata:
55
name: pvc-{{ template "nfs-subdir-external-provisioner.fullname" . }}
6+
labels:
7+
{{- include "nfs-subdir-external-provisioner.labels" . | nindent 4 }}
68
spec:
79
accessModes:
810
- {{ .Values.storageClass.accessModes }}

charts/nfs-subdir-external-provisioner/templates/podsecuritypolicy.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@ kind: PodSecurityPolicy
44
metadata:
55
name: {{ template "nfs-subdir-external-provisioner.fullname" . }}
66
labels:
7-
app: {{ template "nfs-subdir-external-provisioner.name" . }}
8-
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
9-
heritage: {{ .Release.Service }}
10-
release: {{ .Release.Name }}
7+
{{- include "nfs-subdir-external-provisioner.labels" . | nindent 4 }}
118
spec:
129
privileged: false
1310
allowPrivilegeEscalation: false

charts/nfs-subdir-external-provisioner/templates/role.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@ kind: Role
33
apiVersion: rbac.authorization.k8s.io/v1
44
metadata:
55
labels:
6-
app: {{ template "nfs-subdir-external-provisioner.name" . }}
7-
chart: {{ template "nfs-subdir-external-provisioner.chart" . }}
8-
heritage: {{ .Release.Service }}
9-
release: {{ .Release.Name }}
6+
{{- include "nfs-subdir-external-provisioner.labels" . | nindent 4 }}
107
name: leader-locking-{{ template "nfs-subdir-external-provisioner.fullname" . }}
118
rules:
129
- apiGroups: [""]

0 commit comments

Comments
 (0)