Skip to content

Commit

Permalink
tidy up postgres helm values
Browse files Browse the repository at this point in the history
  • Loading branch information
TimCsaky committed Oct 22, 2024
1 parent 0fedc21 commit f87ac83
Show file tree
Hide file tree
Showing 7 changed files with 94 additions and 105 deletions.
27 changes: 24 additions & 3 deletions .github/environments/values.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,39 @@ postgres:
# --- resource allocation ----
instances:
- name: db # do not change this name after initial install, pvc (data) and stateful sets will be deleted
replicas: 2
replicas: 3
dataVolumeClaimSpec:
accessModes:
- "ReadWriteOnce"
storageClassName: "netapp-block-standard"
resources:
requests:
storage: 5Gi
storageClassName: "netapp-block-standard"
storage: 3Gi
resources:
requests:
cpu: 1m
memory: 256Mi
limits:
cpu: 100m
memory: 512Mi

# -------- backups ---------
pgBackRestConfig:
global:
# log-level-console: debug
# --- pvc
repo1-retention-full: "2"
repo1-retention-diff: "3"
repos:
- name: repo1
schedules:
full: "0 7 * * *" # full backup every day at 7am
differential: "0 */2 * * *" # differential every 2 hours
volume:
volumeClaimSpec:
accessModes:
- "ReadWriteOnce"
resources:
requests:
storage: 2Gi
storageClassName: "netapp-file-backup"
14 changes: 7 additions & 7 deletions .github/environments/values.pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@ postgres:
# --------crunchydb config: ------
# --------------------------------

# --- cluster resource allocation ----
# --- resource allocation ----
instances:
- name: db # do not change this name after initial install, pvc (data) and stateful sets will be deleted
replicas: 2
replicas: 1
dataVolumeClaimSpec:
accessModes:
- "ReadWriteOnce"
storageClassName: "netapp-block-standard"
resources:
requests:
storage: 2Gi
storageClassName: "netapp-block-standard"
storage: 1Gi
resources:
requests:
cpu: 1m
memory: 256Mi
memory: 128Mi
limits:
cpu: 100m
memory: 512Mi
cpu: 50m
memory: 256Mi
33 changes: 7 additions & 26 deletions .github/environments/values.prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,8 @@ postgres:
cpu: 100m
memory: 512Mi

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

# -------- backups ---------
pgBackRestConfig:
# allow one-off backups
manual:
repoName: repo1
options:
- --type=full
configuration:
# secret for saving backups to S3
- secret:
Expand Down Expand Up @@ -95,20 +86,10 @@ postgres:
bucket: csstops
endpoint: https://nrs.objectstore.gov.bc.ca
region: us-east-1
repoHost:
resources:
requests:
cpu: 1m
memory: 64Mi
limits:
cpu: 50m
memory: 128Mi
sidecars:
pgbackrest:
resources:
requests:
cpu: 1m
memory: 64Mi
limits:
cpu: 50m
memory: 128Mi

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

# -------- monitoring ---------
monitoring: true
71 changes: 7 additions & 64 deletions .github/environments/values.test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,82 +32,25 @@ postgres:
# --------crunchydb config: ------
# --------------------------------

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

# ----- pgBouncer (network pooling) ------
pgBouncerConfig:
replicas: 3
# -------- backups ---------
pgBackRestConfig:
# allow one-off backups
manual:
repoName: repo1
options:
- --type=full
configuration:
# secret for saving backups to S3
- secret:
name: pgbackrest-s3
global:
# log-level-console: debug
# --- pvc
repo1-retention-full: "3"
repo1-retention-diff: "12"
# --- s3
repo2-path: /backups/common-object-management-service/postgres/test
repo2-retention-full: "30"
repo2-s3-uri-style: path
repos:
- name: repo1
schedules:
full: "0 7 * * *" # full backup every day at 7am
differential: "0 */2 * * *" # differential every 2 hours
volume:
volumeClaimSpec:
accessModes:
- "ReadWriteOnce"
resources:
requests:
storage: 2Gi
storageClassName: "netapp-file-backup"
- name: repo2
schedules:
full: "0 2 * * *" # full backup every day at 2am
s3:
bucket: csstops
endpoint: https://nrs.objectstore.gov.bc.ca
region: us-east-1
repoHost:
resources:
requests:
cpu: 1m
memory: 64Mi
limits:
cpu: 50m
memory: 128Mi
sidecars:
pgbackrest:
resources:
requests:
cpu: 1m
memory: 64Mi
limits:
cpu: 50m
memory: 128Mi
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.1
version: 1.1.2
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.1
version: 1.1.2
repository: "file://../postgres"
condition: postgres.enabled
alias: postgres
Expand Down
48 changes: 46 additions & 2 deletions charts/coms/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,25 @@ postgres:

postgresVersion: 16

# --- 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: 2Gi
storageClassName: "netapp-block-standard"
resources:
requests:
cpu: 1m
memory: 256Mi
limits:
cpu: 100m
memory: 512Mi

# ------- postgres user/db configuration ----------
users:
- name: app
Expand All @@ -229,15 +248,40 @@ postgres:
CREATE SCHEMA queue;
ALTER SCHEMA queue OWNER TO app;
# -------- backups ---------
pgBackRestConfig:
# allow one-off backups
manual:
repoName: repo1
options:
- --type=full
repoHost:
resources:
requests:
cpu: 1m
memory: 64Mi
limits:
cpu: 50m
memory: 128Mi
sidecars:
pgbackrest:
resources:
requests:
cpu: 1m
memory: 64Mi
limits:
cpu: 50m
memory: 128Mi

# ----- pgBouncer (network pooling) ------
pgBouncerConfig:
replicas: 2
replicas: 1
config:
global:
client_tls_sslmode: disable

# -------- monitoring ----------
monitoring: true
monitoring: false
monitoringConfig:
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.1
version: 1.1.2
appVersion: 5.6.0

0 comments on commit f87ac83

Please sign in to comment.