Skip to content

Commit

Permalink
tidy postgres value inheritance
Browse files Browse the repository at this point in the history
  • Loading branch information
TimCsaky committed Oct 16, 2024
1 parent ecf2f3d commit adc9aa7
Show file tree
Hide file tree
Showing 7 changed files with 97 additions and 83 deletions.
23 changes: 15 additions & 8 deletions .github/environments/values.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ postgres:
- "ReadWriteOnce"
resources:
requests:
storage: 1Gi
storage: 5Gi
storageClassName: "netapp-block-standard"
resources:
requests:
Expand Down Expand Up @@ -92,13 +92,8 @@ postgres:
repos:
- name: repo1
schedules:
# Full backup weekly on Sunday at 1am or 2am (9am UTC) and
# Differential backups daily at 1am or 2am (9am UTC) on every day except Sunday,
# Incremental backups every hour except for 9am UTC
# be sure to configure these not to run at the same time
full: "0 9 * * 0"
differential: "0 9 * * 1-6"
incremental: "0 0-8,10-23 * * *"
full: "0 7 * * *"
differential: "0 */2 * * *"
volume:
volumeClaimSpec:
accessModes:
Expand All @@ -107,6 +102,18 @@ postgres:
requests:
storage: 2Gi
storageClassName: "netapp-file-backup"
# - name: repo2
# schedules:
# full: "0 5 * * *"
# s3:
# createS3Secret: true
# s3Secret: s3-pgbackrest
# s3Path: "/habackup"
# s3UriStyle: path
# bucket: a
# endpoint: b
# region: c

# this stuff is for the "pgbackrest" container (the only non-init container) in the "postgres-crunchy-repo-host" pod
repoHost:
resources:
Expand Down
47 changes: 22 additions & 25 deletions .github/environments/values.pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,26 @@ features:

postgres:
enabled: true
# crunchy config:
pgBackRest:
s3:
enabled: false
proxy:
pgBouncer:
image: # it's not necessary to specify an image as the images specified in the Crunchy Postgres Operator will be pulled by default
replicas: 1

# --------------------------------
# --------crunchydb config: ------
# --------------------------------

# --- cluster resource allocation ----
instances:
replicas: 1
dataVolumeClaimSpec:
storage: 480Mi
storageClassName: netapp-block-standard
requests:
cpu: 1m
memory: 256Mi
limits:
cpu: 100m
memory: 512Mi
replicaCertCopy:
requests:
cpu: 1m
memory: 32Mi
limits:
cpu: 50m
memory: 64Mi
- 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
93 changes: 49 additions & 44 deletions .github/environments/values.prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,49 +34,54 @@ postgres:

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

# -------- backups ---------
pgBackRest:
# 'backups to "volume" are hard-coded (enabled) in the PostgresCluster template (see: repo1)
retention: "2"
retentionFullType: count
repos:
schedules:
full: 0 8 * * *
incremental: 0 0,4,12,16,20 * * *
volume:
# enable backups to volume (pvc)
enabled: true
accessModes: "ReadWriteOnce"
storage: 64Mi
storageClassName: netapp-file-backup
# backups to S3 are also hard-coded in postgresCluster template (see repo2)
s3:
# enable backups to s3
enabled: true
createS3Secret: true
s3Secret: s3-pgbackrest
s3Path: "/habackup"
s3UriStyle: path
bucket: "bucketName"
endpoint: "endpointName"
region: "ca-central-1"
key: "s3keyValue"
keySecret: "s3SecretValue"
fullSchedule: "0 9 * * *"
incrementalSchedule: "0 1,5,13,17,21 * * *"
# # -------- backups ---------
# pgBackRest:
# # 'backups to "volume" are hard-coded (enabled) in the PostgresCluster template (see: repo1)
# retention: "2"
# retentionFullType: count
# repos:
# schedules:
# full: 0 8 * * *
# incremental: 0 0,4,12,16,20 * * *
# volume:
# # enable backups to volume (pvc)
# enabled: true
# accessModes: "ReadWriteOnce"
# storage: 64Mi
# storageClassName: netapp-file-backup
# # backups to S3 are also hard-coded in postgresCluster template (see repo2)
# s3:
# # enable backups to s3
# enabled: true
# createS3Secret: true
# s3Secret: s3-pgbackrest
# s3Path: "/habackup"
# s3UriStyle: path
# bucket: "bucketName"
# endpoint: "endpointName"
# region: "ca-central-1"
# key: "s3keyValue"
# keySecret: "s3SecretValue"
# fullSchedule: "0 9 * * *"
# incrementalSchedule: "0 1,5,13,17,21 * * *"

# ------ pgBouncer-------
proxy:
pgBouncer:
replicas: 3
# ----- pgBouncer (network pooling) ------
pgBouncerConfig:
replicas: 3
2 changes: 1 addition & 1 deletion .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: 1Gi
storage: 5Gi
storageClassName: "netapp-block-standard"
resources:
requests:
Expand Down
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: 0.7.5
version: 0.7.6
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: 5.7.5
version: 5.7.6
repository: "file://../postgres"
condition: postgres.enabled
alias: postgres
Expand Down
9 changes: 7 additions & 2 deletions charts/coms/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ postgres:
# eg: --set postgres.name=postgres-master
# name: postgres-master

postgresVersion: 15
postgresVersion: 16

# ------- postgres user/db configuration ----------
users:
Expand All @@ -230,7 +230,12 @@ postgres:
ALTER SCHEMA queue OWNER TO app;
# ----- pgBouncer (network pooling) ------
pgBouncerReplicas: 2
pgBouncerConfig:
image: # it's not necessary to specify an image as the images specified in the Crunchy Postgres Operator will be pulled by default
replicas: 2
config:
global:
client_tls_sslmode: disable

# -------- monitoring ----------
monitoring: true
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: 5.7.5
version: 5.7.6
appVersion: 5.6.0

0 comments on commit adc9aa7

Please sign in to comment.