Skip to content

Commit

Permalink
Merge pull request #82 from joshuasimon-taulia/master
Browse files Browse the repository at this point in the history
feat(chart): allow configuration of k8s scheduling priority
  • Loading branch information
k8s-ci-robot committed Nov 24, 2021
2 parents a9cec78 + 42c3923 commit 4184001
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/nfs-server-provisioner/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
appVersion: 3.0.0
description: nfs-server-provisioner is an out-of-tree dynamic provisioner for Kubernetes. You can use it to quickly & easily deploy shared storage that works almost anywhere.
name: nfs-server-provisioner
version: 1.3.2
version: 1.4.0
maintainers:
- name: kiall
email: kiall@macinnes.ie
Expand Down
5 changes: 4 additions & 1 deletion charts/nfs-server-provisioner/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ their default values.
| `nodeSelector` | Map of node labels for pod assignment | `{}` |
| `tolerations` | List of node taints to tolerate | `[]` |
| `affinity` | Map of node/pod affinities | `{}` |
| `podSecurityContext` | Security context settings for nfs-server-provisioner pod (see https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) | `{}` |
| `podSecurityContext` | Security context settings for nfs-server-provisioner pod (see https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) | `{}` |
| `priorityClass.create` | Enable creation of a PriorityClass resource for this nfs-server-provisioner instance | `false` |
| `priorityClass.name` | Set a PriorityClass name to override the default name | `""` |
| `priorityClass.value` | PriorityClass value. The higher the value, the higher the scheduling priority | `5` |

```console
$ helm install nfs-server-provisioner nfs-ganesha-server-and-external-provisioner/nfs-server-provisioner \
Expand Down
14 changes: 14 additions & 0 deletions charts/nfs-server-provisioner/templates/priorityclass.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{{- if .Values.priorityClass.create -}}
kind: PriorityClass
apiVersion: scheduling.k8s.io/v1
metadata:
name: {{ .Values.priorityClass.name | default (include "nfs-provisioner.fullname" .) }}
labels:
app: {{ include "nfs-provisioner.name" . }}
chart: {{ include "nfs-provisioner.chart" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
value: {{ .Values.priorityClass.value }}
globalDefault: false
description: "This priority class should be used for nfs-provisioner pods only."
{{- end }}
3 changes: 3 additions & 0 deletions charts/nfs-server-provisioner/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if (or .Values.priorityClass.name .Values.priorityClass.create) }}
priorityClassName: {{ .Values.priorityClass.name | default (include "nfs-provisioner.fullname" .) | quote }}
{{- end }}

{{- if not .Values.persistence.enabled }}
volumes:
Expand Down
11 changes: 11 additions & 0 deletions charts/nfs-server-provisioner/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,17 @@ rbac:
##
serviceAccountName: default

## For creating the PriorityClass automatically:
priorityClass:
## Enable creation of a PriorityClass resource for this nfs-server-provisioner instance
create: false

## Set a PriorityClass name to override the default name
name: ""

## PriorityClass value. The higher the value, the higher the scheduling priority
value: 5

resources: {}
# limits:
# cpu: 100m
Expand Down

0 comments on commit 4184001

Please sign in to comment.