Skip to content

Commit

Permalink
Merge pull request #32 from small-hack/feat/add-resource-limits
Browse files Browse the repository at this point in the history
add resource limits for clusters
  • Loading branch information
cloudymax authored Mar 30, 2024
2 parents 041b2a0 + d69fa24 commit 9d9b167
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion charts/cloudnative-pg-cluster/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: cnpg-cluster
description: Create postgres tenant clusters managed by the CNPG Operator
type: application
version: 0.3.12
version: 0.3.13

maintainers:
- name: "cloudymax"
Expand Down
6 changes: 4 additions & 2 deletions charts/cloudnative-pg-cluster/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# cnpg-cluster

![Version: 0.3.12](https://img.shields.io/badge/Version-0.3.12-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
![Version: 0.3.13](https://img.shields.io/badge/Version-0.3.13-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)

Create postgres tenant clusters managed by the CNPG Operator

Expand Down Expand Up @@ -43,6 +43,8 @@ Create postgres tenant clusters managed by the CNPG Operator
| name | string | `"cnpg"` | |
| postgresql.pg_hba | list | `["hostnossl all all 0.0.0.0/0 reject","hostssl all all 0.0.0.0/0 cert clientcert=verify-full"]` | records for the pg_hba.conf file. ref: https://www.postgresql.org/docs/current/auth-pg-hba-conf.html |
| primaryUpdateStrategy | string | `"unsupervised"` | |
| resources.limits | object | `{"cpu":1000,"memory":"1024Mi"}` | resource limit for pods |
| resources.requests | object | `{"cpu":500,"memory":"512Mi"}` | minimum resources guaranteed for pods |
| scheduledBackup.name | string | `"example-backup"` | name to use for your scheduled backup job |
| scheduledBackup.spec.backupOwnerReference | string | `"self"` | |
| scheduledBackup.spec.cluster.name | string | `"pg-backup"` | |
Expand All @@ -52,4 +54,4 @@ Create postgres tenant clusters managed by the CNPG Operator
| testApp.enabled | bool | `false` | |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.11.3](https://github.com/norwoodj/helm-docs/releases/v1.11.3)
Autogenerated from chart metadata using [helm-docs v1.12.0](https://github.com/norwoodj/helm-docs/releases/v1.12.0)
3 changes: 2 additions & 1 deletion charts/cloudnative-pg-cluster/templates/cnpg_cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ spec:
postgresql:
{{- toYaml . | nindent 4 }}
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 4 }}
storage:
size: {{ .Values.storage.size }}
bootstrap:
Expand Down Expand Up @@ -72,4 +74,3 @@ spec:
{{- toYaml . | nindent 6 }}
{{- end }}
{{- end }}

10 changes: 10 additions & 0 deletions charts/cloudnative-pg-cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,16 @@ storage:
# -- how much storage to allocate to the postgresql cluster
size: 1Gi

resources:
# -- minimum resources guaranteed for pods
requests:
cpu: 500
memory: "512Mi"
# -- resource limit for pods
limits:
cpu: 1000
memory: "1024Mi"

testApp:
## -- create a test deployment to verify db connectivity.
# Populates user and DB from the Initdb owner and database values
Expand Down

0 comments on commit 9d9b167

Please sign in to comment.