Skip to content

Commit

Permalink
feat(cnpg): add values.priorityClassName (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien Bouquillon authored Sep 25, 2023
1 parent 85c1a20 commit 2d31b01
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 1 deletion.
4 changes: 4 additions & 0 deletions charts/cnpg-cluster/templates/cluster.cnpg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ spec:
source: {{ .Values.replica.source }}
{{- end }}

{{- if .Values.priorityClassName }}
priorityClassName: {{ .Values.priorityClassName }}
{{- end }}

bootstrap:
{{- if .Values.recovery.enabled }}
recovery:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ cluster with custom instances:
requests:
cpu: 0.42
memory: 314Mb
2: |
some-priority-class-name
cluster with custom pg_hba:
1: |
parameters: null
Expand Down Expand Up @@ -174,7 +176,7 @@ cluster with monitoring:
app.kubernetes.io/name: cnpg-cluster
app.kubernetes.io/version: "15"
cnpg.io/poolerName: RELEASE-NAME-cnpg-cluster-rw
helm.sh/chart: cnpg-cluster-1.12.6
helm.sh/chart: cnpg-cluster-1.13.0
name: RELEASE-NAME-cnpg-cluster-rw
spec:
cluster:
Expand Down
3 changes: 3 additions & 0 deletions charts/cnpg-cluster/tests/cnpg-cluster_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ tests:
- template: cluster.cnpg.yaml
matchSnapshot:
path: spec.resources
- template: cluster.cnpg.yaml
matchSnapshot:
path: spec.priorityClassName
- it: cluster with custom image tag
values:
- ./values/tag.yaml
Expand Down
1 change: 1 addition & 0 deletions charts/cnpg-cluster/tests/values/instances.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
instances: 2
priorityClassName: some-priority-class-name
resources:
requests:
cpu: 0.42
Expand Down
4 changes: 4 additions & 0 deletions charts/cnpg-cluster/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@
"type": ["object"],
"title": "Postgres instances labels for pod assignment"
},
"priorityClassName": {
"type": ["string"],
"title": "Name of the priority class which will be used in every generated Pod, if the PriorityClass specified does not exist, the pod will not be able to schedule. Please refer to https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/#priorityclass for more information"
},
"tolerations": {
"type": ["array"],
"title": "Postgres instances labels for tolerations pod assignment"
Expand Down
4 changes: 4 additions & 0 deletions charts/cnpg-cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ resources:
# @param {object} [nodeSelector] Postgres instances labels for pod assignment
nodeSelector: {}

# Name of the priority class which will be used in every generated Pod, if the PriorityClass specified does not exist, the pod will not be able to schedule. Please refer to https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/#priorityclass for more information
# @param {string} [priorityClassName] Name of the priority class which will be used in every generated Pod
priorityClassName: ""

# @param {array} [tolerations] Postgres instances labels for tolerations pod assignment
tolerations: []

Expand Down

0 comments on commit 2d31b01

Please sign in to comment.