Skip to content

Commit

Permalink
Minimize crunchydb resource requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
TimCsaky committed Oct 23, 2024
1 parent 6674e99 commit f342e40
Show file tree
Hide file tree
Showing 7 changed files with 125 additions and 40 deletions.
48 changes: 29 additions & 19 deletions .github/environments/values.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,6 @@ postgres:
# --------crunchydb config: ------
# --------------------------------

# # --- resource allocation ----
# instances:
# - name: db # do not change this name after initial install, pvc (data) and stateful sets will be deleted
# replicas: 2
# dataVolumeClaimSpec:
# accessModes:
# - "ReadWriteOnce"
# resources:
# requests:
# storage: 0.5Gi
# storageClassName: "netapp-block-standard"
# resources:
# requests:
# cpu: 50m
# memory: 128Mi
# limits:
# cpu: 100m
# memory: 256Mi

# -------- backups ---------
pgBackRestConfig:
global:
Expand All @@ -71,3 +52,32 @@ postgres:
requests:
storage: 2Gi
storageClassName: "netapp-file-backup"
manual:
repoName: repo1
options:
- --type=full
repoHost:
resources:
requests:
cpu: 20m
memory: 128Mi
limits:
cpu: 50m
memory: 256Mi
sidecars:
pgbackrest:
resources:
requests:
cpu: 5m
memory: 16Mi
limits:
cpu: 20m
memory: 64Mi
jobs:
resources:
requests:
cpu: 10m
memory: 64Mi
limits:
cpu: 50m
memory: 128Mi
14 changes: 11 additions & 3 deletions .github/environments/values.pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,15 @@ postgres:
# --------crunchydb config: ------
# --------------------------------

# --- resource allocation ----
instances:
- name: db # do not change this name after initial install, pvc (data) and stateful sets will be deleted
replicas: 1
replicas: 3
dataVolumeClaimSpec:
accessModes:
- "ReadWriteOnce"
resources:
requests:
storage: 0.5Gi
storage: .5Gi
storageClassName: "netapp-block-standard"
resources:
requests:
Expand All @@ -29,6 +28,15 @@ postgres:
limits:
cpu: 100m
memory: 256Mi
sidecars:
replicaCertCopy:
resources:
requests:
cpu: 1m
memory: 32Mi
limits:
cpu: 50m
memory: 64Mi

# -------- backups ---------
pgBackRestConfig: {}
51 changes: 42 additions & 9 deletions .github/environments/values.prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ postgres:
# --------crunchydb config: ------
# --------------------------------

# --- cluster resource allocation ----
instances:
- name: db # do not change this name after initial install, pvc (data) and stateful sets will be deleted
replicas: 3
Expand All @@ -41,18 +40,56 @@ postgres:
- "ReadWriteOnce"
resources:
requests:
storage: 5Gi
storage: 2Gi
storageClassName: "netapp-block-standard"
resources:
requests:
cpu: 1m
memory: 256Mi
cpu: 50m
memory: 128Mi
limits:
cpu: 100m
memory: 512Mi
memory: 256Mi
sidecars:
replicaCertCopy:
resources:
requests:
cpu: 1m
memory: 32Mi
limits:
cpu: 50m
memory: 64Mi

# -------- backups ---------
pgBackRestConfig:
manual:
repoName: repo1
options:
- --type=full
repoHost:
resources:
requests:
cpu: 20m
memory: 128Mi
limits:
cpu: 50m
memory: 256Mi
sidecars:
pgbackrest:
resources:
requests:
cpu: 5m
memory: 16Mi
limits:
cpu: 20m
memory: 64Mi
jobs:
resources:
requests:
cpu: 10m
memory: 64Mi
limits:
cpu: 50m
memory: 128Mi
configuration:
# secret for saving backups to S3
- secret:
Expand Down Expand Up @@ -87,10 +124,6 @@ postgres:
endpoint: https://nrs.objectstore.gov.bc.ca
region: us-east-1

# # ----- pgBouncer (network pooling) ------
# pgBouncerConfig:
# replicas: 2

# -------- monitoring ---------
monitoring: true
monitoringConfig:
Expand Down
44 changes: 39 additions & 5 deletions .github/environments/values.test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ postgres:
- "ReadWriteOnce"
resources:
requests:
storage: 0.5Gi
storage: 1Gi
storageClassName: "netapp-block-standard"
resources:
requests:
Expand All @@ -50,9 +50,47 @@ postgres:
limits:
cpu: 100m
memory: 256Mi
sidecars:
replicaCertCopy:
resources:
requests:
cpu: 1m
memory: 32Mi
limits:
cpu: 50m
memory: 64Mi

# -------- backups ---------
pgBackRestConfig:
manual:
repoName: repo1
options:
- --type=full
repoHost:
resources:
requests:
cpu: 20m
memory: 128Mi
limits:
cpu: 50m
memory: 256Mi
sidecars:
pgbackrest:
resources:
requests:
cpu: 5m
memory: 16Mi
limits:
cpu: 20m
memory: 64Mi
jobs:
resources:
requests:
cpu: 10m
memory: 64Mi
limits:
cpu: 50m
memory: 128Mi
global:
# log-level-console: debug
# --- pvc
Expand All @@ -71,7 +109,3 @@ postgres:
requests:
storage: 2Gi
storageClassName: "netapp-file-backup"

# # ----- pgBouncer (network pooling) ------
# pgBouncerConfig:
# replicas: 2
4 changes: 2 additions & 2 deletions charts/coms/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: common-object-management-service
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.1.3
version: 1.1.4
kubeVersion: ">= 1.13.0"
description: A microservice for managing access control to S3 Objects
# A chart can be either an 'application' or a 'library' chart.
Expand All @@ -28,7 +28,7 @@ sources:
- https://github.com/bcgov/common-object-management-service
dependencies:
- name: postgrescluster
version: 1.1.3
version: 1.1.4
repository: "file://../postgres"
condition: postgres.enabled
alias: postgres
Expand Down
2 changes: 1 addition & 1 deletion charts/coms/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ postgres:
- "ReadWriteOnce"
resources:
requests:
storage: 0.5Gi
storage: 1Gi
storageClassName: "netapp-block-standard"
resources:
requests:
Expand Down
2 changes: 1 addition & 1 deletion charts/postgres/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ name: postgrescluster
description: A Helm chart for Kubernetes
type: application
# The version below should match the version on the PostgresCluster CRD
version: 1.1.3
version: 1.1.4
appVersion: 5.6.0

0 comments on commit f342e40

Please sign in to comment.