Commit 74123487 by Yonatan Kahana

Helm chart labels and annotations support

parent f08caa22
...@@ -15,4 +15,4 @@ jobs: ...@@ -15,4 +15,4 @@ jobs:
uses: helm/chart-testing-action@v2.0.1 uses: helm/chart-testing-action@v2.0.1
- name: Run chart-testing (lint) - name: Run chart-testing (lint)
run: ct lint run: ct lint --validate-maintainers=false
...@@ -3,7 +3,7 @@ appVersion: 4.0.0 ...@@ -3,7 +3,7 @@ appVersion: 4.0.0
description: nfs-subdir-external-provisioner is an automatic provisioner that used your *already configured* NFS server, automatically creating Persistent Volumes. 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 name: nfs-subdir-external-provisioner
home: https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner home: https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner
version: 4.0.3 version: 4.0.5
kubeVersion: ">=1.9.0-0" kubeVersion: ">=1.9.0-0"
sources: sources:
- https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner - https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner
......
...@@ -49,7 +49,7 @@ The command removes all the Kubernetes components associated with the chart and ...@@ -49,7 +49,7 @@ 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. The following tables lists the configurable parameters of this chart and their default values.
| Parameter | Description | Default | | Parameter | Description | Default |
| ----------------------------------- | ----------------------------------------------------------- | ------------------------------------------------- | | ----------------------------------- | ----------------------------------------------------------- | ---------------------------------------------------------------- |
| `replicaCount` | Number of provisioner instances to deployed | `1` | | `replicaCount` | Number of provisioner instances to deployed | `1` |
| `strategyType` | Specifies the strategy used to replace old Pods by new ones | `Recreate` | | `strategyType` | Specifies the strategy used to replace old Pods by new ones | `Recreate` |
| `image.repository` | Provisioner image | `gcr.io/k8s-staging-sig-storage/nfs-subdir-external-provisioner` | | `image.repository` | Provisioner image | `gcr.io/k8s-staging-sig-storage/nfs-subdir-external-provisioner` |
...@@ -63,6 +63,7 @@ The following tables lists the configurable parameters of this chart and their d ...@@ -63,6 +63,7 @@ The following tables lists the configurable parameters of this chart and their d
| `storageClass.archiveOnDelete` | Archive pvc when deleting | `true` | | `storageClass.archiveOnDelete` | Archive pvc when deleting | `true` |
| `storageClass.pathPattern` | Specifies a template for the directory name | null | | `storageClass.pathPattern` | Specifies a template for the directory name | null |
| `storageClass.accessModes` | Set access mode for PV | `ReadWriteOnce` | | `storageClass.accessModes` | Set access mode for PV | `ReadWriteOnce` |
| `storageClass.annotations` | Set additional annotations for the StorageClass | `{}` |
| `leaderElection.enabled` | Enables or disables leader election | `true` | | `leaderElection.enabled` | Enables or disables leader election | `true` |
| `nfs.server` | Hostname of the NFS server (required) | null (ip or hostname) | | `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.path` | Basepath of the mount point to be used | `/nfs-storage` |
...@@ -70,9 +71,12 @@ The following tables lists the configurable parameters of this chart and their d ...@@ -70,9 +71,12 @@ The following tables lists the configurable parameters of this chart and their d
| `resources` | Resources required (e.g. CPU, memory) | `{}` | | `resources` | Resources required (e.g. CPU, memory) | `{}` |
| `rbac.create` | Use Role-based Access Control | `true` | | `rbac.create` | Use Role-based Access Control | `true` |
| `podSecurityPolicy.enabled` | Create & use Pod Security Policy resources | `false` | | `podSecurityPolicy.enabled` | Create & use Pod Security Policy resources | `false` |
| `podAnnotations` | Additional annotations for the Pods | `{}` |
| `priorityClassName` | Set pod priorityClassName | null | | `priorityClassName` | Set pod priorityClassName | null |
| `serviceAccount.create` | Should we create a ServiceAccount | `true` | | `serviceAccount.create` | Should we create a ServiceAccount | `true` |
| `serviceAccount.name` | Name of the ServiceAccount to use | null | | `serviceAccount.name` | Name of the ServiceAccount to use | null |
| `serviceAccount.annotations` | Additional annotations for the ServiceAccount | `{}` |
| `nodeSelector` | Node labels for pod assignment | `{}` | | `nodeSelector` | Node labels for pod assignment | `{}` |
| `affinity` | Affinity settings | `{}` | | `affinity` | Affinity settings | `{}` |
| `tolerations` | List of node taints to tolerate | `[]` | | `tolerations` | List of node taints to tolerate | `[]` |
| `labels` | Additional labels for any resource created | `{}` |
...@@ -60,3 +60,22 @@ Return the appropriate apiVersion for podSecurityPolicy. ...@@ -60,3 +60,22 @@ Return the appropriate apiVersion for podSecurityPolicy.
{{- print "extensions/v1beta1" -}} {{- print "extensions/v1beta1" -}}
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
{{/*
Common labels
*/}}
{{- define "nfs-subdir-external-provisioner.labels" -}}
chart: {{ template "nfs-subdir-external-provisioner.chart" . }}
heritage: {{ .Release.Service }}
{{- 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 }}
...@@ -3,10 +3,7 @@ kind: ClusterRole ...@@ -3,10 +3,7 @@ kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1 apiVersion: rbac.authorization.k8s.io/v1
metadata: metadata:
labels: labels:
app: {{ template "nfs-subdir-external-provisioner.name" . }} {{- include "nfs-subdir-external-provisioner.labels" . | nindent 4 }}
chart: {{ template "nfs-subdir-external-provisioner.chart" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
name: {{ template "nfs-subdir-external-provisioner.fullname" . }}-runner name: {{ template "nfs-subdir-external-provisioner.fullname" . }}-runner
rules: rules:
- apiGroups: [""] - apiGroups: [""]
......
...@@ -3,10 +3,7 @@ kind: ClusterRoleBinding ...@@ -3,10 +3,7 @@ kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1 apiVersion: rbac.authorization.k8s.io/v1
metadata: metadata:
labels: labels:
app: {{ template "nfs-subdir-external-provisioner.name" . }} {{- include "nfs-subdir-external-provisioner.labels" . | nindent 4 }}
chart: {{ template "nfs-subdir-external-provisioner.chart" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
name: run-{{ template "nfs-subdir-external-provisioner.fullname" . }} name: run-{{ template "nfs-subdir-external-provisioner.fullname" . }}
subjects: subjects:
- kind: ServiceAccount - kind: ServiceAccount
......
...@@ -3,27 +3,25 @@ kind: Deployment ...@@ -3,27 +3,25 @@ kind: Deployment
metadata: metadata:
name: {{ template "nfs-subdir-external-provisioner.fullname" . }} name: {{ template "nfs-subdir-external-provisioner.fullname" . }}
labels: labels:
app: {{ template "nfs-subdir-external-provisioner.name" . }} {{- include "nfs-subdir-external-provisioner.labels" . | nindent 4 }}
chart: {{ template "nfs-subdir-external-provisioner.chart" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
spec: spec:
replicas: {{ .Values.replicaCount }} replicas: {{ .Values.replicaCount }}
strategy: strategy:
type: {{ .Values.strategyType }} type: {{ .Values.strategyType }}
selector: selector:
matchLabels: matchLabels:
app: {{ template "nfs-subdir-external-provisioner.name" . }} {{- include "nfs-subdir-external-provisioner.selectorLabels" . | nindent 6 }}
release: {{ .Release.Name }}
template: template:
metadata: metadata:
annotations: annotations:
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if and (.Values.tolerations) (semverCompare "<1.6-0" .Capabilities.KubeVersion.GitVersion) }} {{- if and (.Values.tolerations) (semverCompare "<1.6-0" .Capabilities.KubeVersion.GitVersion) }}
scheduler.alpha.kubernetes.io/tolerations: '{{ toJson .Values.tolerations }}' scheduler.alpha.kubernetes.io/tolerations: '{{ toJson .Values.tolerations }}'
{{- end }} {{- end }}
labels: labels:
app: {{ template "nfs-subdir-external-provisioner.name" . }} {{- include "nfs-subdir-external-provisioner.labels" . | nindent 8 }}
release: {{ .Release.Name }}
spec: spec:
serviceAccountName: {{ template "nfs-subdir-external-provisioner.serviceAccountName" . }} serviceAccountName: {{ template "nfs-subdir-external-provisioner.serviceAccountName" . }}
{{- if .Values.nodeSelector }} {{- if .Values.nodeSelector }}
...@@ -37,9 +35,9 @@ spec: ...@@ -37,9 +35,9 @@ spec:
{{- if .Values.priorityClassName }} {{- if .Values.priorityClassName }}
priorityClassName: {{ .Values.priorityClassName | quote }} priorityClassName: {{ .Values.priorityClassName | quote }}
{{- end }} {{- end }}
{{- if .Values.imagePullSecrets }} {{- with .Values.imagePullSecrets }}
imagePullSecrets: imagePullSecrets:
{{ toYaml .Values.imagePullSecrets | indent 8 }} {{- toYaml . | nindent 8 }}
{{- end }} {{- end }}
containers: containers:
- name: {{ .Chart.Name }} - name: {{ .Chart.Name }}
......
...@@ -4,6 +4,7 @@ kind: PersistentVolume ...@@ -4,6 +4,7 @@ kind: PersistentVolume
metadata: metadata:
name: pv-{{ template "nfs-subdir-external-provisioner.fullname" . }} name: pv-{{ template "nfs-subdir-external-provisioner.fullname" . }}
labels: labels:
{{- include "nfs-subdir-external-provisioner.labels" . | nindent 4 }}
nfs-subdir-external-provisioner: {{ template "nfs-subdir-external-provisioner.fullname" . }} nfs-subdir-external-provisioner: {{ template "nfs-subdir-external-provisioner.fullname" . }}
spec: spec:
capacity: capacity:
......
...@@ -3,6 +3,8 @@ kind: PersistentVolumeClaim ...@@ -3,6 +3,8 @@ kind: PersistentVolumeClaim
apiVersion: v1 apiVersion: v1
metadata: metadata:
name: pvc-{{ template "nfs-subdir-external-provisioner.fullname" . }} name: pvc-{{ template "nfs-subdir-external-provisioner.fullname" . }}
labels:
{{- include "nfs-subdir-external-provisioner.labels" . | nindent 4 }}
spec: spec:
accessModes: accessModes:
- {{ .Values.storageClass.accessModes }} - {{ .Values.storageClass.accessModes }}
......
...@@ -4,10 +4,7 @@ kind: PodSecurityPolicy ...@@ -4,10 +4,7 @@ kind: PodSecurityPolicy
metadata: metadata:
name: {{ template "nfs-subdir-external-provisioner.fullname" . }} name: {{ template "nfs-subdir-external-provisioner.fullname" . }}
labels: labels:
app: {{ template "nfs-subdir-external-provisioner.name" . }} {{- include "nfs-subdir-external-provisioner.labels" . | nindent 4 }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
spec: spec:
privileged: false privileged: false
allowPrivilegeEscalation: false allowPrivilegeEscalation: false
......
...@@ -3,10 +3,7 @@ kind: Role ...@@ -3,10 +3,7 @@ kind: Role
apiVersion: rbac.authorization.k8s.io/v1 apiVersion: rbac.authorization.k8s.io/v1
metadata: metadata:
labels: labels:
app: {{ template "nfs-subdir-external-provisioner.name" . }} {{- include "nfs-subdir-external-provisioner.labels" . | nindent 4 }}
chart: {{ template "nfs-subdir-external-provisioner.chart" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
name: leader-locking-{{ template "nfs-subdir-external-provisioner.fullname" . }} name: leader-locking-{{ template "nfs-subdir-external-provisioner.fullname" . }}
rules: rules:
- apiGroups: [""] - apiGroups: [""]
......
...@@ -3,10 +3,7 @@ kind: RoleBinding ...@@ -3,10 +3,7 @@ kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1 apiVersion: rbac.authorization.k8s.io/v1
metadata: metadata:
labels: labels:
app: {{ template "nfs-subdir-external-provisioner.name" . }} {{- include "nfs-subdir-external-provisioner.labels" . | nindent 4 }}
chart: {{ template "nfs-subdir-external-provisioner.chart" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
name: leader-locking-{{ template "nfs-subdir-external-provisioner.fullname" . }} name: leader-locking-{{ template "nfs-subdir-external-provisioner.fullname" . }}
subjects: subjects:
- kind: ServiceAccount - kind: ServiceAccount
......
...@@ -3,9 +3,10 @@ apiVersion: v1 ...@@ -3,9 +3,10 @@ apiVersion: v1
kind: ServiceAccount kind: ServiceAccount
metadata: metadata:
labels: labels:
app: {{ template "nfs-subdir-external-provisioner.name" . }} {{- include "nfs-subdir-external-provisioner.labels" . | nindent 4 }}
chart: {{ template "nfs-subdir-external-provisioner.chart" . }} {{- with .Values.serviceAccount.annotations }}
heritage: {{ .Release.Service }} annotations:
release: {{ .Release.Name }} {{- toYaml . | nindent 4 }}
{{- end }}
name: {{ template "nfs-subdir-external-provisioner.serviceAccountName" . }} name: {{ template "nfs-subdir-external-provisioner.serviceAccountName" . }}
{{- end -}} {{- end -}}
...@@ -3,14 +3,14 @@ apiVersion: storage.k8s.io/v1 ...@@ -3,14 +3,14 @@ apiVersion: storage.k8s.io/v1
kind: StorageClass kind: StorageClass
metadata: metadata:
labels: labels:
app: {{ template "nfs-subdir-external-provisioner.name" . }} {{- include "nfs-subdir-external-provisioner.labels" . | nindent 4 }}
chart: {{ template "nfs-subdir-external-provisioner.chart" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
name: {{ .Values.storageClass.name }} name: {{ .Values.storageClass.name }}
{{- if .Values.storageClass.defaultClass }} {{- if .Values.storageClass.defaultClass }}
annotations: annotations:
storageclass.kubernetes.io/is-default-class: "true" storageclass.kubernetes.io/is-default-class: "true"
{{- with .Values.storageClass.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }} {{- end }}
provisioner: {{ template "nfs-subdir-external-provisioner.provisionerName" . }} provisioner: {{ template "nfs-subdir-external-provisioner.provisionerName" . }}
allowVolumeExpansion: {{ .Values.storageClass.allowVolumeExpansion }} allowVolumeExpansion: {{ .Values.storageClass.allowVolumeExpansion }}
......
...@@ -5,6 +5,7 @@ image: ...@@ -5,6 +5,7 @@ image:
repository: gcr.io/k8s-staging-sig-storage/nfs-subdir-external-provisioner repository: gcr.io/k8s-staging-sig-storage/nfs-subdir-external-provisioner
tag: v4.0.0 tag: v4.0.0
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
imagePullSecrets: []
nfs: nfs:
server: server:
...@@ -42,6 +43,9 @@ storageClass: ...@@ -42,6 +43,9 @@ storageClass:
# Set access mode - ReadWriteOnce, ReadOnlyMany or ReadWriteMany # Set access mode - ReadWriteOnce, ReadOnlyMany or ReadWriteMany
accessModes: ReadWriteOnce accessModes: ReadWriteOnce
# Storage class annotations
annotations: {}
leaderElection: leaderElection:
# When set to false leader election will be disabled # When set to false leader election will be disabled
enabled: true enabled: true
...@@ -56,6 +60,9 @@ rbac: ...@@ -56,6 +60,9 @@ rbac:
podSecurityPolicy: podSecurityPolicy:
enabled: false enabled: false
# Deployment pod annotations
podAnnotations: {}
## Set pod priorityClassName ## Set pod priorityClassName
# priorityClassName: "" # priorityClassName: ""
...@@ -63,6 +70,9 @@ serviceAccount: ...@@ -63,6 +70,9 @@ serviceAccount:
# Specifies whether a ServiceAccount should be created # Specifies whether a ServiceAccount should be created
create: true create: true
# Annotations to add to the service account
annotations: {}
# The name of the ServiceAccount to use. # The name of the ServiceAccount to use.
# If not set and create is true, a name is generated using the fullname template # If not set and create is true, a name is generated using the fullname template
name: name:
...@@ -80,3 +90,6 @@ nodeSelector: {} ...@@ -80,3 +90,6 @@ nodeSelector: {}
tolerations: [] tolerations: []
affinity: {} affinity: {}
# Additional labels for any resource created
labels: {}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment