Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update route.yaml #1906

Merged
merged 4 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions chart/cas-cif/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ dependencies:
- name: certbot
version: 0.1.3
repository: https://bcdevops.github.io/certbot
condition: certbot.enabled
38 changes: 38 additions & 0 deletions chart/cas-cif/templates/route.prod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{{- if hasSuffix "-prod" .Release.Namespace }}

{{- $keySecret := "Secret not found" }}
{{- $certSecret := "Secret not found" }}
{{- $CACertSecret := "Secret not found" }}

{{- $existingSSLSecret := (lookup "v1" "Secret" .Release.Namespace "ssl-cert-cas-cif" ) }}
{{- if $existingSSLSecret }}
{{- $keySecret = index $existingSSLSecret.data "private-key" | b64dec | quote}}
{{- $certSecret = index $existingSSLSecret.data "certificate" | b64dec | quote}}
{{- $CACertSecret = index $existingSSLSecret.data "CACert" | b64dec | quote}}
{{- end -}}

apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: {{ template "cas-cif.fullname" . }}
labels: {{ include "cas-cif.labels" . | nindent 4 }}
annotations:
haproxy.router.openshift.io/balance: roundrobin

spec:
host: {{ .Values.hostName }}
port:
targetPort: {{ template "cas-cif.fullname" . }}
tls:
insecureEdgeTerminationPolicy: Redirect
termination: edge
key: {{ $keySecret }}
certificate: {{ $certSecret }}
caCertificate: {{ $CACertSecret }}
to:
kind: Service
name: {{ template "cas-cif.fullname" . }}
weight: 100
wildcardPolicy: None

{{- end }}
4 changes: 4 additions & 0 deletions chart/cas-cif/templates/route.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{{- if not (hasSuffix "-prod" .Release.Namespace)}}

{{- $route := (lookup "route.openshift.io/v1" "Route" .Release.Namespace "cas-cif" ) }}
{{- $certificate := "" }}
{{- $key := "" }}
Expand Down Expand Up @@ -32,3 +34,5 @@ spec:
name: {{ template "cas-cif.fullname" . }}
weight: 100
wildcardPolicy: None

{{- end -}}
3 changes: 3 additions & 0 deletions chart/cas-cif/values-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ deploy-db:

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

certbot:
enabled: true
5 changes: 1 addition & 4 deletions chart/cas-cif/values-prod.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
hostName: cif.gov.bc.ca

certbot:
certbot:
server:
secretName: cas-acme-url
secretKey: url
enabled: false

deploy-db:
airflowEndpoint: https://cas-airflow-prod.apps.silver.devops.gov.bc.ca
Expand Down
3 changes: 3 additions & 0 deletions chart/cas-cif/values-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@ deploy-db:

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

certbot:
enabled: true
Loading