Skip to content

Commit

Permalink
Merge pull request #1953 from bcgov/chore/pgbackrest-and-certificate-…
Browse files Browse the repository at this point in the history
…fixes

Chore/pgbackrest and certificate fixes
  • Loading branch information
dleard authored Jan 15, 2025
2 parents 6bbaf1c + 6e8b905 commit 0625016
Show file tree
Hide file tree
Showing 11 changed files with 5 additions and 64 deletions.
9 changes: 1 addition & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -246,14 +246,7 @@ install:
@set -euo pipefail; \
dagConfig=$$(echo '{"org": "bcgov", "repo": "cas-cif", "ref": "$(GIT_SHA1)", "path": "dags/cas_cif_dags.py"}' | base64 -w0); \
helm dep up $(CHART_DIR); \
if ! helm status --namespace $(NAMESPACE) $(CHART_INSTANCE); then \
echo 'Installing the application and issuing SSL certificate'; \
helm install --set certbot.manualRun=true $(HELM_OPTS) $(CHART_INSTANCE) $(CHART_DIR); \
elif [ $(ISSUE_CERT) ]; then \
helm upgrade --set certbot.manualRun=true $(HELM_OPTS) $(CHART_INSTANCE) $(CHART_DIR); \
else \
helm upgrade $(HELM_OPTS) $(CHART_INSTANCE) $(CHART_DIR); \
fi;
helm install $(HELM_OPTS) $(CHART_INSTANCE) $(CHART_DIR);


restore_prereq: ## Prerequisites for the restore target
Expand Down
7 changes: 2 additions & 5 deletions chart/cas-cif/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,5 @@ dependencies:
- name: cas-airflow-dag-trigger
repository: https://bcgov.github.io/cas-airflow
version: 1.0.7
- name: certbot
repository: https://bcdevops.github.io/certbot
version: 0.1.3
digest: sha256:d2da5fb2e1380ca061fdadb0e4cbe54137f1e3d43f90afe245339ddb320a771b
generated: "2024-12-16T11:23:41.617911-08:00"
digest: sha256:0693261c3831cac56b20a88001ce8492535570768f78c9a46f1eb89d7280818c
generated: "2025-01-15T14:35:44.502894429-08:00"
4 changes: 0 additions & 4 deletions chart/cas-cif/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,3 @@ dependencies:
repository: https://bcgov.github.io/cas-airflow
alias: deploy-db
condition: deploy-db.enabled
- name: certbot
version: 0.1.3
repository: https://bcdevops.github.io/certbot
condition: certbot.enabled
3 changes: 0 additions & 3 deletions chart/cas-cif/templates/postgres.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ spec:
postgres-operator.crunchydata.com/instance-set: pgha1
proxy:
pgBouncer:
image: artifacts.developer.gov.bc.ca/bcgov-docker-local/crunchy-pgbouncer:ubi8-1.18-0
resources:
requests:
cpu: 10m
Expand Down Expand Up @@ -83,7 +82,6 @@ spec:
- cif
backups:
pgbackrest:
image: artifacts.developer.gov.bc.ca/bcgov-docker-local/crunchy-pgbackrest:ubi8-2.41-4
{{- if .Values.db.restore.enabled }}
restore:
enabled: true
Expand Down Expand Up @@ -114,7 +112,6 @@ spec:
monitoring:
pgmonitor:
exporter:
image: artifacts.developer.gov.bc.ca/bcgov-docker-local/crunchy-postgres-exporter:ubi8-5.3.1-0
resources:
requests:
cpu: 50m
Expand Down
16 changes: 0 additions & 16 deletions chart/cas-cif/templates/route.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@
{{- if not (hasSuffix "-prod" .Release.Namespace)}}

{{- $route := (lookup "route.openshift.io/v1" "Route" .Release.Namespace "cas-cif" ) }}
{{- $certificate := "" }}
{{- $key := "" }}
{{- $caCertificate := "" }}
{{- if $route }}
{{- $certificate = $route.spec.tls.certificate }}
{{- $key = $route.spec.tls.key }}
{{- $caCertificate = $route.spec.tls.caCertificate }}
{{- end -}}

apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: {{ template "cas-cif.fullname" . }}
labels: {{ include "cas-cif.labels" . | nindent 4 }}
certbot-managed: "true"

spec:
host: {{ .Values.hostName }}
Expand All @@ -24,11 +13,6 @@ spec:
tls:
termination: edge
insecureEdgeTerminationPolicy: Redirect
{{- if $certificate }}
certificate: {{ $certificate | quote }}
key: {{ $key | quote }}
caCertificate: {{ $caCertificate | quote }}
{{- end }}
to:
kind: Service
name: {{ template "cas-cif.fullname" . }}
Expand Down
5 changes: 1 addition & 4 deletions chart/cas-cif/values-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ app:
sitewide_notice:
content: <div class="alert alert-warning">This is the DEV environment.</div>

hostName: dev.cif.gov.bc.ca
hostName: cas-cif-dev.apps.silver.devops.gov.bc.ca

db:
preUpgradeCommand: |
Expand All @@ -18,6 +18,3 @@ deploy-db:

download-dags:
airflowEndpoint: https://cas-airflow-dev.apps.silver.devops.gov.bc.ca

certbot:
enabled: true
3 changes: 0 additions & 3 deletions chart/cas-cif/values-prod.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
hostName: cif.gov.bc.ca

certbot:
enabled: false

deploy-db:
airflowEndpoint: https://cas-airflow-prod.apps.silver.devops.gov.bc.ca

Expand Down
5 changes: 1 addition & 4 deletions chart/cas-cif/values-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ app:
sitewide_notice:
content: <div class="alert alert-warning">This is the TEST environment.</div>

hostName: test.cif.gov.bc.ca
hostName: cas-cif-test.apps.silver.devops.gov.bc.ca

db:
postUpgradeCommandEnv: |
Expand All @@ -28,6 +28,3 @@ deploy-db:

download-dags:
airflowEndpoint: https://cas-airflow-test.apps.silver.devops.gov.bc.ca

certbot:
enabled: true
6 changes: 0 additions & 6 deletions chart/cas-cif/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,6 @@ db:

hostName: ~

certbot:
image:
pullPolicy: IfNotPresent
certbot:
email: [email protected]

resources:
limits:
cpu: 800m
Expand Down
2 changes: 0 additions & 2 deletions database_backup_test/backup-test/templates/postgres.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ spec:
postgres-operator.crunchydata.com/instance-set: pgha1
proxy:
pgBouncer:
image: artifacts.developer.gov.bc.ca/bcgov-docker-local/crunchy-pgbouncer:ubi8-1.18-0
resources:
requests:
cpu: 10m
Expand Down Expand Up @@ -83,7 +82,6 @@ spec:
- cif
backups:
pgbackrest:
image: artifacts.developer.gov.bc.ca/bcgov-docker-local/crunchy-pgbackrest:ubi8-2.41-4
{{- if .Values.db.restore.enabled }}
restore:
enabled: true
Expand Down
9 changes: 0 additions & 9 deletions shipit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,3 @@ deploy:
ci:
allow_failures:
- "yarn-audit"

tasks:
renew_cert:
action: "Renew SSL Certificate"
description: "Send a request via certbot to issue an SSL certificate"
steps:
- export ISSUE_CERT=true
- make install:
timeout: 5000

0 comments on commit 0625016

Please sign in to comment.