Skip to content

Commit

Permalink
Merge pull request #72 from yonatankahana/chart-labels-and-annotations
Browse files Browse the repository at this point in the history
Helm chart labels and annotations and add missing image pull secrets in documentation
  • Loading branch information
k8s-ci-robot authored Apr 23, 2021
2 parents 48e51b1 + 1cafa67 commit 7947697
Show file tree
Hide file tree
Showing 14 changed files with 96 additions and 71 deletions.
2 changes: 1 addition & 1 deletion charts/nfs-subdir-external-provisioner/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ appVersion: 4.0.2
description: nfs-subdir-external-provisioner is an automatic provisioner that used your *already configured* NFS server, automatically creating Persistent Volumes.
name: nfs-subdir-external-provisioner
home: https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner
version: 4.0.8
version: 4.0.9
kubeVersion: ">=1.9.0-0"
sources:
- https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner
Expand Down
63 changes: 34 additions & 29 deletions charts/nfs-subdir-external-provisioner/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,32 +48,37 @@ The command removes all the Kubernetes components associated with the chart and

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

| Parameter | Description | Default |
| ----------------------------------- | ----------------------------------------------------------- | ------------------------------------------------- |
| `replicaCount` | Number of provisioner instances to deployed | `1` |
| `strategyType` | Specifies the strategy used to replace old Pods by new ones | `Recreate` |
| `image.repository` | Provisioner image | `k8s.gcr.io/sig-storage/nfs-subdir-external-provisioner` |
| `image.tag` | Version of provisioner image | `v4.0.2` |
| `image.pullPolicy` | Image pull policy | `IfNotPresent` |
| `storageClass.name` | Name of the storageClass | `nfs-client` |
| `storageClass.defaultClass` | Set as the default StorageClass | `false` |
| `storageClass.allowVolumeExpansion` | Allow expanding the volume | `true` |
| `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.onDelete` | Strategy on PVC deletion. Overrides `archiveOnDelete` when set to lowercase values `delete` or `retain` | null |
| `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) |
| `nfs.path` | Basepath of the mount point to be used | `/nfs-storage` |
| `nfs.mountOptions` | Mount options (e.g. 'nfsvers=3') | null |
| `resources` | Resources required (e.g. CPU, memory) | `{}` |
| `rbac.create` | Use Role-based Access Control | `true` |
| `podSecurityPolicy.enabled` | Create & use Pod Security Policy resources | `false` |
| `priorityClassName` | Set pod priorityClassName | null |
| `serviceAccount.create` | Should we create a ServiceAccount | `true` |
| `serviceAccount.name` | Name of the ServiceAccount to use | null |
| `nodeSelector` | Node labels for pod assignment | `{}` |
| `affinity` | Affinity settings | `{}` |
| `tolerations` | List of node taints to tolerate | `[]` |
| Parameter | Description | Default |
| ----------------------------------- | ----------------------------------------------------------------------------------------------------- | -------------------------------------------------------- |
| `replicaCount` | Number of provisioner instances to deployed | `1` |
| `strategyType` | Specifies the strategy used to replace old Pods by new ones | `Recreate` |
| `image.repository` | Provisioner image | `k8s.gcr.io/sig-storage/nfs-subdir-external-provisioner` |
| `image.tag` | Version of provisioner image | `v4.0.2` |
| `image.pullPolicy` | Image pull policy | `IfNotPresent` |
| `imagePullSecrets` | Image pull secrets | `[]` |
| `storageClass.name` | Name of the storageClass | `nfs-client` |
| `storageClass.defaultClass` | Set as the default StorageClass | `false` |
| `storageClass.allowVolumeExpansion` | Allow expanding the volume | `true` |
| `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.onDelete` | Strategy on PVC deletion. Overrides archiveOnDelete when set to lowercase values 'delete' or 'retain' | null |
| `storageClass.pathPattern` | Specifies a template for the directory name | null |
| `storageClass.accessModes` | Set access mode for PV | `ReadWriteOnce` |
| `storageClass.annotations` | Set additional annotations for the StorageClass | `{}` |
| `leaderElection.enabled` | Enables or disables leader election | `true` |
| `nfs.server` | Hostname of the NFS server (required) | null (ip or hostname) |
| `nfs.path` | Basepath of the mount point to be used | `/nfs-storage` |
| `nfs.mountOptions` | Mount options (e.g. 'nfsvers=3') | null |
| `resources` | Resources required (e.g. CPU, memory) | `{}` |
| `rbac.create` | Use Role-based Access Control | `true` |
| `podSecurityPolicy.enabled` | Create & use Pod Security Policy resources | `false` |
| `podAnnotations` | Additional annotations for the Pods | `{}` |
| `priorityClassName` | Set pod priorityClassName | null |
| `serviceAccount.create` | Should we create a ServiceAccount | `true` |
| `serviceAccount.name` | Name of the ServiceAccount to use | null |
| `serviceAccount.annotations` | Additional annotations for the ServiceAccount | `{}` |
| `nodeSelector` | Node labels for pod assignment | `{}` |
| `affinity` | Affinity settings | `{}` |
| `tolerations` | List of node taints to tolerate | `[]` |
| `labels` | Additional labels for any resource created | `{}` |
22 changes: 21 additions & 1 deletion charts/nfs-subdir-external-provisioner/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,24 @@ Return the appropriate apiVersion for podSecurityPolicy.
{{- else -}}
{{- print "extensions/v1beta1" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Common labels
*/}}
{{- define "nfs-subdir-external-provisioner.labels" -}}
chart: {{ template "nfs-subdir-external-provisioner.chart" . }}
heritage: {{ .Release.Service }}
{{ include "nfs-subdir-external-provisioner.selectorLabels" . }}
{{- with .Values.labels }}
{{- toYaml . | nindent 0 }}
{{- end }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "nfs-subdir-external-provisioner.selectorLabels" -}}
app: {{ template "nfs-subdir-external-provisioner.name" . }}
release: {{ .Release.Name }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
labels:
app: {{ template "nfs-subdir-external-provisioner.name" . }}
chart: {{ template "nfs-subdir-external-provisioner.chart" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
{{- include "nfs-subdir-external-provisioner.labels" . | nindent 4 }}
name: {{ template "nfs-subdir-external-provisioner.fullname" . }}-runner
rules:
- apiGroups: [""]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
labels:
app: {{ template "nfs-subdir-external-provisioner.name" . }}
chart: {{ template "nfs-subdir-external-provisioner.chart" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
{{- include "nfs-subdir-external-provisioner.labels" . | nindent 4 }}
name: run-{{ template "nfs-subdir-external-provisioner.fullname" . }}
subjects:
- kind: ServiceAccount
Expand Down
18 changes: 8 additions & 10 deletions charts/nfs-subdir-external-provisioner/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,25 @@ kind: Deployment
metadata:
name: {{ template "nfs-subdir-external-provisioner.fullname" . }}
labels:
app: {{ template "nfs-subdir-external-provisioner.name" . }}
chart: {{ template "nfs-subdir-external-provisioner.chart" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
{{- include "nfs-subdir-external-provisioner.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
strategy:
type: {{ .Values.strategyType }}
selector:
matchLabels:
app: {{ template "nfs-subdir-external-provisioner.name" . }}
release: {{ .Release.Name }}
{{- include "nfs-subdir-external-provisioner.selectorLabels" . | nindent 6 }}
template:
metadata:
annotations:
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if and (.Values.tolerations) (semverCompare "<1.6-0" .Capabilities.KubeVersion.GitVersion) }}
scheduler.alpha.kubernetes.io/tolerations: '{{ toJson .Values.tolerations }}'
{{- end }}
labels:
app: {{ template "nfs-subdir-external-provisioner.name" . }}
release: {{ .Release.Name }}
{{- include "nfs-subdir-external-provisioner.selectorLabels" . | nindent 8 }}
spec:
serviceAccountName: {{ template "nfs-subdir-external-provisioner.serviceAccountName" . }}
{{- if .Values.nodeSelector }}
Expand All @@ -37,9 +35,9 @@ spec:
{{- if .Values.priorityClassName }}
priorityClassName: {{ .Values.priorityClassName | quote }}
{{- end }}
{{- if .Values.imagePullSecrets }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{ toYaml .Values.imagePullSecrets | indent 8 }}
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ kind: PersistentVolume
metadata:
name: pv-{{ template "nfs-subdir-external-provisioner.fullname" . }}
labels:
{{- include "nfs-subdir-external-provisioner.labels" . | nindent 4 }}
nfs-subdir-external-provisioner: {{ template "nfs-subdir-external-provisioner.fullname" . }}
spec:
capacity:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: pvc-{{ template "nfs-subdir-external-provisioner.fullname" . }}
labels:
{{- include "nfs-subdir-external-provisioner.labels" . | nindent 4 }}
spec:
accessModes:
- {{ .Values.storageClass.accessModes }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ kind: PodSecurityPolicy
metadata:
name: {{ template "nfs-subdir-external-provisioner.fullname" . }}
labels:
app: {{ template "nfs-subdir-external-provisioner.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
{{- include "nfs-subdir-external-provisioner.labels" . | nindent 4 }}
spec:
privileged: false
allowPrivilegeEscalation: false
Expand Down
5 changes: 1 addition & 4 deletions charts/nfs-subdir-external-provisioner/templates/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
labels:
app: {{ template "nfs-subdir-external-provisioner.name" . }}
chart: {{ template "nfs-subdir-external-provisioner.chart" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
{{- include "nfs-subdir-external-provisioner.labels" . | nindent 4 }}
name: leader-locking-{{ template "nfs-subdir-external-provisioner.fullname" . }}
rules:
- apiGroups: [""]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
labels:
app: {{ template "nfs-subdir-external-provisioner.name" . }}
chart: {{ template "nfs-subdir-external-provisioner.chart" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
{{- include "nfs-subdir-external-provisioner.labels" . | nindent 4 }}
name: leader-locking-{{ template "nfs-subdir-external-provisioner.fullname" . }}
subjects:
- kind: ServiceAccount
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ apiVersion: v1
kind: ServiceAccount
metadata:
labels:
app: {{ template "nfs-subdir-external-provisioner.name" . }}
chart: {{ template "nfs-subdir-external-provisioner.chart" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
{{- include "nfs-subdir-external-provisioner.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
name: {{ template "nfs-subdir-external-provisioner.serviceAccountName" . }}
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
labels:
app: {{ template "nfs-subdir-external-provisioner.name" . }}
chart: {{ template "nfs-subdir-external-provisioner.chart" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
{{- include "nfs-subdir-external-provisioner.labels" . | nindent 4 }}
name: {{ .Values.storageClass.name }}
{{- if .Values.storageClass.defaultClass }}
annotations:
{{- if .Values.storageClass.defaultClass }}
storageclass.kubernetes.io/is-default-class: "true"
{{- end }}
{{- end }}
{{- with .Values.storageClass.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
provisioner: {{ template "nfs-subdir-external-provisioner.provisionerName" . }}
allowVolumeExpansion: {{ .Values.storageClass.allowVolumeExpansion }}
reclaimPolicy: {{ .Values.storageClass.reclaimPolicy }}
Expand Down
13 changes: 13 additions & 0 deletions charts/nfs-subdir-external-provisioner/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ image:
repository: k8s.gcr.io/sig-storage/nfs-subdir-external-provisioner
tag: v4.0.2
pullPolicy: IfNotPresent
imagePullSecrets: []

nfs:
server:
Expand Down Expand Up @@ -47,6 +48,9 @@ storageClass:
# Set access mode - ReadWriteOnce, ReadOnlyMany or ReadWriteMany
accessModes: ReadWriteOnce

# Storage class annotations
annotations: {}

leaderElection:
# When set to false leader election will be disabled
enabled: true
Expand All @@ -61,13 +65,19 @@ rbac:
podSecurityPolicy:
enabled: false

# Deployment pod annotations
podAnnotations: {}

## Set pod priorityClassName
# priorityClassName: ""

serviceAccount:
# Specifies whether a ServiceAccount should be created
create: true

# Annotations to add to the service account
annotations: {}

# The name of the ServiceAccount to use.
# If not set and create is true, a name is generated using the fullname template
name:
Expand All @@ -85,3 +95,6 @@ nodeSelector: {}
tolerations: []

affinity: {}

# Additional labels for any resource created
labels: {}

0 comments on commit 7947697

Please sign in to comment.