Skip to content

Commit 2791e01

Browse files
Merge pull request #247 from bcgov/feature/VDYP-751
Feature/vdyp 751 Remove bitnami references
2 parents 6120e27 + 43b6e1c commit 2791e01

15 files changed

+162
-261
lines changed

.github/workflows/.deployer.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,7 @@ jobs:
141141
--set global.secrets.databasePassword=${{ secrets.POSTGRES_PASSWORD }} \
142142
--set bitnami-pg.auth.username=${{ vars.POSTGRES_USER }} \
143143
--set bitnami-pg.auth.database=${{ vars.POSTGRES_DATABASE }} \
144-
--set global.secrets.COMS_DB_PASSWORD=${{ secrets.COMS_DB_PASSWORD }} \
145144
--set global.secrets.VDYP_DB_PASSWORD=${{ secrets.VDYP_DB_PASSWORD }} \
146-
--set global.secrets.BATCH_DB_PASSWORD=${{ secrets.BATCH_DB_PASSWORD }} \
147145
--set backend.env.QUARKUS_OIDC_AUTH_SERVER_URL=${{ secrets.VITE_SSO_AUTH_SERVER_URL }}/realms/${{ secrets.VITE_SSO_REALM }} \
148146
--set backend.env.VDYP_DB_USER=${{ vars.VDYP_DB_USER }} \
149147
--set backend.env.VDYP_DB_DATABASE=${{ vars.VDYP_DB_DATABASE }} \
@@ -154,8 +152,6 @@ jobs:
154152
--set frontend.env.VITE_SSO_REALM=${{ secrets.VITE_SSO_REALM }} \
155153
--set frontend.env.VITE_SSO_REDIRECT_URI=${{ secrets.VITE_SSO_REDIRECT_URI }} \
156154
--set frontend.env.VITE_API_URL=${{ secrets.VITE_API_URL }} \
157-
--set coms.env.DB_USERNAME=${{ vars.COMS_DB_USER }} \
158-
--set coms.env.DB_DATABASE=${{ vars.COMS_DB_DATABASE }} \
159155
--set-string coms.image.tag=${{ vars.COMS_TAG }} \
160156
--set-string coms.env.OBJECTSTORAGE_ENABLED=true \
161157
--set-string coms.env.OBJECTSTORAGE_ACCESSKEYID=${{ vars.OBJECTSTORAGE_ACCESSKEYID }} \

.github/workflows/openshift-deploy-crunchy.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ jobs:
3535
LICENSE_PLATE: 'c50504'
3636
#Vault path is different for prod than all other environments
3737
#VAULT_RESOURCE: ${{ inputs.ENVIRONMENT_NAME == 'prod' && 'prod' || 'nonprod' }}
38+
NAMESPACE: ${{ secrets.oc_namespace }}
3839
ENV: ${{ inputs.ENVIRONMENT_NAME }}
3940
DB_STORAGE: ${{ vars.DB_STORAGE }}
4041
DB_MAX_CPU: ${{ vars.DB_MAX_CPU }}
@@ -43,6 +44,10 @@ jobs:
4344
DB_WAL_VOLUME_SIZE: ${{ vars.DB_WAL_VOLUME_SIZE }}
4445
DB_BACKUP_VOLUME_SIZE: ${{ vars.DB_BACKUP_VOLUME_SIZE }}
4546
BOUNCER_REPLICAS: ${{ vars.DB_LOADBALANCER_HA_REPLICAS}}
47+
COMS_DB_USER: ${{ vars.COMS_DB_ROLE}}
48+
COMS_DB_NAME: ${{ vars.COMS_DB_DATABASE}}
49+
BATCH_DB_USER: ${{ vars.BATCH_DB_ROLE}}
50+
BATCH_DB_NAME: ${{ vars.BATCH_DB_DATABASE}}
4651
#S3_ENVIRONMENT: ${{ inputs.ENVIRONMENT_NAME == 'dev' && 'dev' || (inputs.ENVIRONMENT_NAME == 'test' && 'tst' || (inputs.ENVIRONMENT_NAME == 'prod' && 'prd' || inputs.ENVIRONMENT_NAME)) }}
4752

4853
- name: install helm

charts/app/Chart.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,6 @@ version: 0.1.0
2424
# It is recommended to use it with quotes.
2525
appVersion: "1.16.0"
2626

27-
dependencies:
28-
- name: postgresql
29-
condition: bitnami-pg.enabled
30-
version: 15.5.21
31-
repository: https://charts.bitnami.com/bitnami
32-
alias: bitnami-pg
3327
maintainers:
3428
- name: Om Mishra
3529
email: omprakash.2.mishra@gov.bc.ca

charts/app/templates/coms/deployment.yaml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,30 @@ spec:
5151
- name: BASICAUTH_PASSWORD
5252
value: {{ .Values.coms.env.BASICAUTH_PASSWORD | quote }}
5353
- name: DB_PORT
54-
value: "5432"
54+
valueFrom:
55+
secretKeyRef:
56+
name: {{ .Values.coms.db_secret }}
57+
key: port
5558
- name: DB_HOST
56-
value: {{$host}}
59+
valueFrom:
60+
secretKeyRef:
61+
name: {{ .Values.coms.db_secret }}
62+
key: host
5763
- name: DB_NAME
58-
value: {{.Values.coms.env.DB_DATABASE }}
64+
valueFrom:
65+
secretKeyRef:
66+
name: {{ .Values.coms.db_secret }}
67+
key: dbname
5968
- name: DB_USERNAME
60-
value: {{.Values.coms.env.DB_USERNAME }}
69+
valueFrom:
70+
secretKeyRef:
71+
name: {{ .Values.coms.db_secret }}
72+
key: user
6173
- name: DB_PASSWORD
6274
valueFrom:
6375
secretKeyRef:
64-
name: {{ .Release.Name }}
65-
key: COMS_DB_PASSWORD
76+
name: {{ .Values.coms.db_secret }}
77+
key: password
6678
- name: KC_ENABLED
6779
value: {{ .Values.coms.env.KC_ENABLED | quote }}
6880
- name: KC_PUBLICKEY

charts/app/templates/knp.yaml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ spec:
6868
podSelector:
6969
matchLabels:
7070
app.kubernetes.io/name: {{ .Values.global.databaseAlias}}
71-
app.kubernetes.io/instance: {{ .Release.Name }}
7271
ingress:
7372
- ports:
7473
- protocol: TCP
@@ -81,6 +80,28 @@ spec:
8180
policyTypes:
8281
- Ingress
8382

83+
---
84+
apiVersion: networking.k8s.io/v1
85+
kind: NetworkPolicy
86+
metadata:
87+
name: {{ .Release.Name }}-allow-coms-to-db
88+
labels: {{- include "selectorLabels" . | nindent 4 }}
89+
spec:
90+
podSelector:
91+
matchLabels:
92+
app.kubernetes.io/name: {{ .Values.global.databaseAlias}}
93+
ingress:
94+
- ports:
95+
- protocol: TCP
96+
port: 5432
97+
from:
98+
- podSelector:
99+
matchLabels:
100+
app.kubernetes.io/name: coms
101+
app.kubernetes.io/instance: {{ .Release.Name }}
102+
policyTypes:
103+
- Ingress
104+
84105
---
85106
apiVersion: networking.k8s.io/v1
86107
kind: NetworkPolicy
@@ -103,3 +124,5 @@ spec:
103124
app.kubernetes.io/instance: {{ .Release.Name }}
104125
policyTypes:
105126
- Ingress
127+
128+

charts/app/templates/postgres-initdb-scripts-secret.yaml

Lines changed: 0 additions & 62 deletions
This file was deleted.

charts/app/templates/secret.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
{{- if and .Values.global.secrets .Values.global.secrets.enabled}}
22
{{- $databaseUser := .Values.global.secrets.databaseUser| default "quickstart" }}
33
{{- $databasePassword := .Values.global.secrets.databasePassword | default (randAlphaNum 10) }}
4-
{{- $COMS_DB_PASSWORD := .Values.global.secrets.COMS_DB_PASSWORD }}
54
{{- $VDYP_DB_PASSWORD := .Values.global.secrets.VDYP_DB_PASSWORD }}
6-
{{- $BATCH_DB_PASSWORD := .Values.global.secrets.BATCH_DB_PASSWORD }}
75
{{- $secretObj := (lookup "v1" "Secret" .Release.Namespace .Release.Name ) | default dict }}
86
{{- $secretData := (get $secretObj "data") | default dict }}
97
# set below to existing secret data or generate a random one when not exists
10-
{{- $COMS_DB_PASSWORD = (get $secretData "COMS_DB_PASSWORD") | default ($COMS_DB_PASSWORD | b64enc) }}
118
{{- $VDYP_DB_PASSWORD = (get $secretData "VDYP_DB_PASSWORD") | default ($VDYP_DB_PASSWORD | b64enc) }}
12-
{{- $BATCH_DB_PASSWORD = (get $secretData "$BATCH_DB_PASSWORD") | default ($BATCH_DB_PASSWORD | b64enc) }}
139
{{- $databasePassword = (get $secretData "databasePassword") | default ($databasePassword | b64enc) }}
1410
{{- $databaseName := .Values.global.secrets.databaseName| default "quickstart" }}
1511
{{- $host := printf "%s-%s:5432" .Release.Name .Values.global.databaseAlias }}
@@ -43,8 +39,6 @@ data:
4339
POSTGRES_PASSWORD: {{ $databasePassword | quote }}
4440
POSTGRES_USER: {{ $databaseUser | b64enc | quote }}
4541
POSTGRES_DATABASE: {{ $databaseName | b64enc | quote }}
46-
COMS_DB_PASSWORD: {{ $COMS_DB_PASSWORD | quote }}
4742
VDYP_DB_PASSWORD: {{ $VDYP_DB_PASSWORD | quote }}
48-
BATCH_DB_PASSWORD: {{ $BATCH_DB_PASSWORD | quote }}
4943

5044
{{- end }}

charts/app/values-dev.yaml

Lines changed: 2 additions & 143 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ global:
2323
#-- domain of the application, it is required, apps.silver.devops.gov.bc.ca for silver cluster and apps.devops.gov.bc.ca for gold cluster
2424
domain: "apps.silver.devops.gov.bc.ca" # it is apps.gold.devops.gov.bc.ca for gold cluster
2525
#-- the database Alias gives a nice way to switch to different databases, crunchy, patroni ... etc.
26-
databaseAlias: bitnami-pg
26+
databaseAlias: crunchy-postgres-dev
2727
postgresql:
2828
auth:
2929
password: unused
@@ -127,143 +127,6 @@ frontend:
127127
VITE_SSO_REDIRECT_URI: ~
128128
VITE_API_URL: ~
129129

130-
crunchy: # enable it for TEST and PROD, for PR based pipelines simply use single postgres
131-
enabled: false
132-
133-
crunchyImage: artifacts.developer.gov.bc.ca/bcgov-docker-local/crunchy-postgres-gis:ubi8-15.2-3.3-0
134-
135-
postgresVersion: 15
136-
postGISVersion: '3.3'
137-
imagePullPolicy: Always
138-
instances:
139-
name: ha # high availability
140-
replicas: 1 # 2 or 3 for high availability in TEST and PROD.
141-
metadata:
142-
annotations:
143-
prometheus.io/scrape: 'true'
144-
prometheus.io/port: '9187'
145-
dataVolumeClaimSpec:
146-
storage: 120Mi
147-
storageClassName: netapp-block-standard
148-
requests:
149-
cpu: 25m
150-
memory: 256Mi
151-
limits:
152-
cpu: 100m
153-
memory: 512Mi
154-
replicaCertCopy:
155-
requests:
156-
cpu: 1m
157-
memory: 32Mi
158-
limits:
159-
cpu: 50m
160-
memory: 64Mi
161-
162-
pgBackRest:
163-
enabled: false
164-
image: # it's not necessary to specify an image as the images specified in the Crunchy Postgres Operator will be pulled by default
165-
retention: "1" # Ideally a larger number such as 30 backups/days
166-
# If retention-full-type set to 'count' then the oldest backups will expire when the number of backups reach the number defined in retention
167-
# If retention-full-type set to 'time' then the number defined in retention will take that many days worth of full backups before expiration
168-
retentionFullType: count
169-
repos:
170-
schedules:
171-
full: 0 8 * * *
172-
incremental: 0 0,4,12,16,20 * * *
173-
volume:
174-
accessModes: "ReadWriteOnce"
175-
storage: 64Mi
176-
storageClassName: netapp-file-backup
177-
repoHost:
178-
requests:
179-
cpu: 1m
180-
memory: 64Mi
181-
limits:
182-
cpu: 50m
183-
memory: 128Mi
184-
sidecars:
185-
requests:
186-
cpu: 1m
187-
memory: 64Mi
188-
limits:
189-
cpu: 50m
190-
memory: 128Mi
191-
192-
patroni:
193-
postgresql:
194-
pg_hba: "host all all 0.0.0.0/0 md5"
195-
parameters:
196-
shared_buffers: 16MB # default is 128MB; a good tuned default for shared_buffers is 25% of the memory allocated to the pod
197-
wal_buffers: "64kB" # this can be set to -1 to automatically set as 1/32 of shared_buffers or 64kB, whichever is larger
198-
min_wal_size: 32MB
199-
max_wal_size: 64MB # default is 1GB
200-
max_slot_wal_keep_size: 128MB # default is -1, allowing unlimited wal growth when replicas fall behind
201-
202-
proxy:
203-
pgBouncer:
204-
image: # it's not necessary to specify an image as the images specified in the Crunchy Postgres Operator will be pulled by default
205-
replicas: 1
206-
requests:
207-
cpu: 1m
208-
memory: 64Mi
209-
limits:
210-
cpu: 50m
211-
memory: 128Mi
212-
213-
# Postgres Cluster resource values:
214-
pgmonitor:
215-
enabled: false
216-
exporter:
217-
image: # it's not necessary to specify an image as the images specified in the Crunchy Postgres Operator will be pulled by default
218-
requests:
219-
cpu: 1m
220-
memory: 64Mi
221-
limits:
222-
cpu: 50m
223-
memory: 128Mi
224-
225-
bitnami-pg:
226-
enabled: true
227-
image:
228-
registry: ghcr.io
229-
repository: bcgov/nr-containers/bitnami/postgresql
230-
tag: 15.8.0
231-
auth:
232-
existingSecret: '{{ .Release.Name }}'
233-
username: ~
234-
database: ~
235-
shmVolume:
236-
enabled: false
237-
backup:
238-
enabled: false
239-
cronjob:
240-
containerSecurityContext: { }
241-
podSecurityContext:
242-
enabled: false
243-
storage:
244-
size: 200Mi
245-
primary:
246-
persistence:
247-
enabled: true
248-
storageClass: netapp-block-standard
249-
accessModes:
250-
- ReadWriteOnce
251-
size: 100Mi
252-
containerSecurityContext:
253-
enabled: false
254-
podSecurityContext:
255-
enabled: false
256-
initdb:
257-
scriptsSecret: '{{ .Release.Name }}-initdb-scripts'
258-
259-
resources:
260-
requests:
261-
cpu: 50m
262-
memory: 150Mi
263-
limits:
264-
cpu: 150m
265-
memory: 250Mi
266-
267130
backup:
268131
enabled: true
269132
pvc:
@@ -331,6 +194,7 @@ backup:
331194

332195
coms:
333196
enabled: true
197+
db_secret: crunchy-postgres-dev-pguser-coms
334198
image:
335199
repository: ghcr.io/bcgov/common-object-management-service
336200
tag: ~
@@ -358,11 +222,6 @@ coms:
358222
BASICAUTH_ENABLED: ~
359223
BASICAUTH_USERNAME: ~
360224
BASICAUTH_PASSWORD: ~
361-
DB_HOST: ~
362-
DB_PORT: "5432"
363-
DB_USERNAME: ~
364-
DB_PASSWORD: ~
365-
DB_DATABASE: ~
366225

367226
batch:
368227
enabled: true

0 commit comments

Comments
 (0)