Skip to content

Commit

Permalink
feat(cnpg): Adding topologySpreadConstraints support to the deployment
Browse files Browse the repository at this point in the history
This adds support for specifying
[`topologySpreadConstraints`](https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/)
for the cloudnative-pg operator deployment.

Resolves cloudnative-pg#371
  • Loading branch information
elliotcourant committed Aug 31, 2024
1 parent 9024f04 commit bf95318
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions charts/cloudnative-pg/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,6 @@ CloudNativePG Operator Helm Chart
| serviceAccount.create | bool | `true` | Specifies whether the service account should be created. |
| serviceAccount.name | string | `""` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template. |
| tolerations | list | `[]` | Tolerations for the operator to be installed. |
| topologySpreadConstraints | list | `[]` | [Topology Spread Constraints](https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/) for the operator to be installed. |
| webhook | object | `{"livenessProbe":{"initialDelaySeconds":3},"mutating":{"create":true,"failurePolicy":"Fail"},"port":9443,"readinessProbe":{"initialDelaySeconds":3},"validating":{"create":true,"failurePolicy":"Fail"}}` | The webhook configuration. |

4 changes: 4 additions & 0 deletions charts/cloudnative-pg/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ spec:
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.topologySpreadConstraints }}
topologySpreadConstraints:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
Expand Down
3 changes: 3 additions & 0 deletions charts/cloudnative-pg/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
"affinity": {
"type": "object"
},
"topologySpreadConstraints": {
"type": "array"
},
"commonAnnotations": {
"type": "object"
},
Expand Down
3 changes: 3 additions & 0 deletions charts/cloudnative-pg/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ resources: {}
# -- Nodeselector for the operator to be installed.
nodeSelector: {}

# -- Topology Spread Constraints for the operator to be installed.
topologySpreadConstraints: []

# -- Tolerations for the operator to be installed.
tolerations: []

Expand Down

0 comments on commit bf95318

Please sign in to comment.