Skip to content

Commit

Permalink
feat: Add ability to define priorityClassName globally
Browse files Browse the repository at this point in the history
Signed-off-by: Marco Maurer <[email protected]>
  • Loading branch information
mkilchhofer committed May 21, 2024
1 parent 0fe831e commit 0af5f4f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
1 change: 1 addition & 0 deletions charts/redis-ha/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ The following table lists the configurable parameters of the Redis chart and the

| Parameter | Description | Default |
|:--------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------------|
| `global.priorityClassName`| Default priority class for all components (HAProxy Deployment and Redis StatefulSet) | `""` |
| `image.repository` | Redis image repository | `redis` |
| `image.tag` | Redis image tag | `6.2.5-alpine` |
| `image.pullPolicy` | Redis image pull policy | `IfNotPresent` |
Expand Down
4 changes: 2 additions & 2 deletions charts/redis-ha/templates/redis-ha-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -520,9 +520,9 @@ spec:
{{- if .Values.extraContainers }}
{{- toYaml .Values.extraContainers | nindent 6 }}
{{- end -}}
{{- if .Values.priorityClassName }}
{{- with .Values.priorityClassName | default .Values.global.priorityClassName }}
priorityClassName: {{ .Values.priorityClassName }}
{{- end }}
{{- end }}
volumes:
- name: config
configMap:
Expand Down
6 changes: 3 additions & 3 deletions charts/redis-ha/templates/redis-haproxy-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ spec:
{{- end }}
lifecycle:
{{ toYaml .Values.haproxy.lifecycle | indent 10 }}
{{- if .Values.haproxy.priorityClassName }}
priorityClassName: {{ .Values.haproxy.priorityClassName }}
{{- end }}
{{- with .Values.haproxy.priorityClassName | default .Values.global.priorityClassName }}
priorityClassName: {{ . }}
{{- end }}
volumes:
{{- if .Values.haproxy.tls.enabled }}
- name: pemfile
Expand Down
5 changes: 5 additions & 0 deletions charts/redis-ha/values.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## Globally shared configuration
global:
# -- Default priority class for all components
priorityClassName: ""

## Configure resource requests and limits
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
##
Expand Down

0 comments on commit 0af5f4f

Please sign in to comment.