Skip to content

Commit

Permalink
Tracking pull request to merge release-1.6.0 to main (#228)
Browse files Browse the repository at this point in the history
* update to 1.6.0

* add search field to GER application admin console (#230)

* itvr-357--scan-uploaded-files (#229)

* helm clamav (#231)

* reorg chat folder and start to add app charts (#232)

* Itvr 340 missing bcsc fields (#233)

* initial commit

* add prop from spouseForm

* disable submit button

* disable submit button for spouseForm

* itvr-367--small-fixes (#234)

* itvr-293--accessibility (#237)

* Itvr 361 (#236)

* initial commit

* update cancellation email body

* send email

* implement CR suggestions

* send email after status is updated

* save queryset to list for iteration

* tracker-update (#238)

* itvr-375--cleanup-tasks (#240)

* small fix (#241)

* snowplow link tracking (#242)

* add CORS_ORIGIN_WHITELIST

* add helm for frontend and backend (#243)

Co-authored-by: vibhiquartech <[email protected]>
Co-authored-by: tim738745 <[email protected]>
  • Loading branch information
3 people authored Jul 29, 2022
1 parent 7bcfc26 commit dd2aa2e
Show file tree
Hide file tree
Showing 112 changed files with 2,943 additions and 157 deletions.
6 changes: 3 additions & 3 deletions .pipeline/lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const phases = {
frontendCpuRequest: '30m', frontendCpuLimit: '60m', frontendMemoryRequest: '30Mi', frontendMemoryLimit: '60Mi', frontendReplicas: 1,
reactAppBCSCKeycloakClientId: 'itvr', reactAppBCSCKeycloakRealm: 'rzh2zkjq', reactAppBCSCKeycloakUrl: 'https://dev.oidc.gov.bc.ca/auth/', reactAppApiBase: `https://itvr-backend-dev-${changeId}.apps.silver.devops.gov.bc.ca`,
reactAppBCeIDKeycloakClientId: 'itvr-2674', reactAppBCeIDKeycloakRealm: 'onestopauth-basic', reactAppBCeIDKeycloakUrl: 'https://dev.oidc.gov.bc.ca/auth/',
backendCpuRequest: '60m', backendCpuLimit: '120m', backendMemoryRequest: '150Mi', backendMemoryLimit: '300Mi', backendHealthCheckDelay: 30, backendHost: `itvr-backend-dev-${changeId}.${ocpName}.gov.bc.ca`, backendReplicas: 1, backendDjangoDebug: 'True', bucketName: 'itvrdv', craEnvironment: 'A',
backendCpuRequest: '60m', backendCpuLimit: '120m', backendMemoryRequest: '150Mi', backendMemoryLimit: '300Mi', backendHealthCheckDelay: 30, backendHost: `itvr-backend-dev-${changeId}.${ocpName}.gov.bc.ca`, backendReplicas: 1, backendDjangoDebug: 'True', bucketName: 'itvrdv', craEnvironment: 'A', corsOriginWhitelist: 'https://itvr-dev.apps.silver.devops.gov.bc.ca',
minioCpuRequest: '30m', minioCpuLimit: '100m', minioMemoryRequest: '150Mi', minioMemoryLimit: '300Mi', minioPvcSize: '3Gi',
schemaspyCpuRequest: '50m', schemaspyCpuLimit: '200m', schemaspyMemoryRequest: '150M', schemaspyMemoryLimit: '300M', schemaspyHealthCheckDelay: 160,
rabbitmqCpuRequest: '250m', rabbitmqCpuLimit: '700m', rabbitmqMemoryRequest: '500M', rabbitmqMemoryLimit: '1G', rabbitmqPvcSize: '1G', rabbitmqReplica: 1, rabbitmqPostStartSleep: 120, storageClass: 'netapp-block-standard',
Expand All @@ -57,7 +57,7 @@ const phases = {
frontendCpuRequest: '30m', frontendCpuLimit: '60m', frontendMemoryRequest: '30Mi', frontendMemoryLimit: '60Mi', frontendReplicas: 2, frontendMinReplicas: 1, frontendMaxReplicas: 3,
reactAppBCSCKeycloakClientId: 'itvr', reactAppBCSCKeycloakRealm: 'rzh2zkjq', reactAppBCSCKeycloakUrl: 'https://test.oidc.gov.bc.ca/auth/', reactAppApiBase: `https://itvr-backend-test.apps.silver.devops.gov.bc.ca`,
reactAppBCeIDKeycloakClientId: 'itvr-2674', reactAppBCeIDKeycloakRealm: 'onestopauth-basic', reactAppBCeIDKeycloakUrl: 'https://test.oidc.gov.bc.ca/auth/',
backendCpuRequest: '60m', backendCpuLimit: '120m', backendMemoryRequest: '150Mi', backendMemoryLimit: '300Mi', backendHealthCheckDelay: 30, backendReplicas: 2, backendMinReplicas: 1, backendMaxReplicas: 3, backendHost: `itvr-backend-test.${ocpName}.gov.bc.ca`, backendDjangoDebug: 'False', bucketName: 'itvrts', craEnvironment: 'A',
backendCpuRequest: '60m', backendCpuLimit: '120m', backendMemoryRequest: '150Mi', backendMemoryLimit: '300Mi', backendHealthCheckDelay: 30, backendReplicas: 2, backendMinReplicas: 1, backendMaxReplicas: 3, backendHost: `itvr-backend-test.${ocpName}.gov.bc.ca`, backendDjangoDebug: 'False', bucketName: 'itvrts', craEnvironment: 'A', corsOriginWhitelist: 'https://itvr-test.apps.silver.devops.gov.bc.ca',
minioCpuRequest: '30m', minioCpuLimit: '100m', minioMemoryRequest: '150Mi', minioMemoryLimit: '300Mi', minioPvcSize: '3G',
schemaspyCpuRequest: '20m', schemaspyCpuLimit: '200m', schemaspyMemoryRequest: '150M', schemaspyMemoryLimit: '300M', schemaspyHealthCheckDelay: 160,
rabbitmqCpuRequest: '250m', rabbitmqCpuLimit: '700m', rabbitmqMemoryRequest: '500M', rabbitmqMemoryLimit: '700M', rabbitmqPvcSize: '1G', rabbitmqReplica: 2, rabbitmqPostStartSleep: 120, storageClass: 'netapp-block-standard',
Expand All @@ -72,7 +72,7 @@ const phases = {
frontendCpuRequest: '30m', frontendCpuLimit: '60m', frontendMemoryRequest: '30Mi', frontendMemoryLimit: '60Mi', frontendReplicas: 2, frontendMinReplicas: 2, frontendMaxReplicas: 5,
reactAppBCSCKeycloakClientId: 'itvr', reactAppBCSCKeycloakRealm: 'rzh2zkjq', reactAppBCSCKeycloakUrl: 'https://oidc.gov.bc.ca/auth/', reactAppApiBase: `https://itvr-backend-prod.apps.silver.devops.gov.bc.ca`,
reactAppBCeIDKeycloakClientId: 'itvr-2674', reactAppBCeIDKeycloakRealm: 'onestopauth-basic', reactAppBCeIDKeycloakUrl: 'https://oidc.gov.bc.ca/auth/',
backendCpuRequest: '60m', backendCpuLimit: '120m', backendMemoryRequest: '150Mi', backendMemoryLimit: '300Mi', backendHealthCheckDelay: 30, backendReplicas: 3, backendMinReplicas: 3, backendMaxReplicas: 5, backendHost: `itvr-backend-prod.${ocpName}.gov.bc.ca`, backendDjangoDebug: 'False', bucketName: 'itvrpr', craEnvironment: 'P',
backendCpuRequest: '60m', backendCpuLimit: '120m', backendMemoryRequest: '150Mi', backendMemoryLimit: '300Mi', backendHealthCheckDelay: 30, backendReplicas: 3, backendMinReplicas: 3, backendMaxReplicas: 5, backendHost: `itvr-backend-prod.${ocpName}.gov.bc.ca`, backendDjangoDebug: 'False', bucketName: 'itvrpr', craEnvironment: 'P', corsOriginWhitelist: 'https://electric-vehicle-rebates.gov.bc.ca',
minioCpuRequest: '30m', minioCpuLimit: '100m', minioMemoryRequest: '150Mi', minioMemoryLimit: '300Mi', minioPvcSize: '3G',
schemaspyCpuRequest: '50m', schemaspyCpuLimit: '400m', schemaspyMemoryRequest: '150M', schemaspyMemoryLimit: '300M', schemaspyHealthCheckDelay: 160,
rabbitmqCpuRequest: '250m', rabbitmqCpuLimit: '700m', rabbitmqMemoryRequest: '500M', rabbitmqMemoryLimit: '1G', rabbitmqPvcSize: '5G', rabbitmqReplica: 2, rabbitmqPostStartSleep: 120, storageClass: 'netapp-block-standard',
Expand Down
6 changes: 4 additions & 2 deletions .pipeline/lib/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ module.exports = settings => {
'REPLICAS': phases[phase].backendReplicas,
'DJANGO_DEBUG': phases[phase].backendDjangoDebug,
'CRA_ENVIRONMENT': phases[phase].craEnvironment,
'BUCKET_NAME': phases[phase].bucketName
'BUCKET_NAME': phases[phase].bucketName,
'CORS_ORIGIN_WHITELIST': phases[phase].corsOriginWhitelist
}
}))

Expand All @@ -107,7 +108,8 @@ module.exports = settings => {
'MEMORY_LIMIT': phases[phase].taskQueueMemoryLimit,
'REPLICAS': phases[phase].taskQueueReplicas,
'CRA_ENVIRONMENT': phases[phase].craEnvironment,
'DJANGO_DEBUG': phases[phase].taskQueueDjangoDebug
'DJANGO_DEBUG': phases[phase].taskQueueDjangoDebug,
'CORS_ORIGIN_WHITELIST': phases[phase].corsOriginWhitelist
}
}))

Expand Down
Empty file added chart/itvr-apps/Chart.yaml
Empty file.
24 changes: 24 additions & 0 deletions chart/itvr-apps/charts/itvr-backend/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: v2
name: itvr-backend
description: A Helm chart for Kubernetes

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# 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.0.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.6.0"
22 changes: 22 additions & 0 deletions chart/itvr-apps/charts/itvr-backend/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
1. Get the application URL by running these commands:
{{- if .Values.ingress.enabled }}
{{- range $host := .Values.ingress.hosts }}
{{- range .paths }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
{{- end }}
{{- end }}
{{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "itvr-backend.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "itvr-backend.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "itvr-backend.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "itvr-backend.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
{{- end }}
150 changes: 150 additions & 0 deletions chart/itvr-apps/charts/itvr-backend/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
{{/*
version: 1.0.0
appVersion: "1.6.0"
nameOverride: ""
fullnameOverride: ""
1. deploy PR based
pr225 is the .Release.Name
Set below to to be empty string in values file
nameOverride: ""
fullnameOverride: ""
imageTools value should be the build PR image in tools project
Run the below command
helm template -f ./values-dev.yaml pr225 .
name: pr225-itvr-backend
labels:
helm.sh/chart: itvr-backend-1.0.0
app.kubernetes.io/name: itvr-backend
app.kubernetes.io/instance: pr225
app.kubernetes.io/version: "1.6.0"
app.kubernetes.io/managed-by: Helm
2. only build racking PR
helm template -f ./values-dev.yaml itvr-backend .
name: itvr-backend
labels:
helm.sh/chart: itvr-backend-1.0.0
app.kubernetes.io/name: itvr-backend
app.kubernetes.io/instance: itvr-backend
app.kubernetes.io/version: "1.6.0"
app.kubernetes.io/managed-by: Helm
it makes PR based pipeline possible for dev environment
At this moment, when deploy on Dev, Test and Prod, set the value for nameOverride and fullnameOverride to be itvr-backend
*/}}


{{/*
Expand the name of the chart.
*/}}
{{- define "itvr-backend.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
The .Release.Name is the first parameter of command helm install itvr-backend
*/}}
{{- define "itvr-backend.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "itvr-backend.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels:
app.kubernetes.io/managed-by would be Helm
*/}}
{{- define "itvr-backend.labels" -}}
helm.sh/chart: {{ include "itvr-backend.chart" . }}
{{ include "itvr-backend.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "itvr-backend.selectorLabels" -}}
app.kubernetes.io/name: {{ include "itvr-backend.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Define the deploymentconfig name
*/}}
{{- define "itvr-backend.deploymentconfigName" -}}
{{- include "itvr-backend.fullname" . }}
{{- end }}

{{/*
Define the deploymentconfig name
*/}}
{{- define "itvr-backend.imagestreamName" -}}
{{- include "itvr-backend.fullname" . }}
{{- end }}

{{/*
Define the service name
*/}}
{{- define "itvr-backend.serviceName" -}}
{{- include "itvr-backend.fullname" . }}
{{- end }}


{{/*
Define the route name
*/}}
{{- define "itvr-backend.routeName" -}}
{{- include "itvr-backend.fullname" . }}
{{- end }}

{{/*
Define the djangoSecretKey
*/}}
{{- define "itvr-backend.djangoSecretKey" -}}
{{- randAlphaNum 50 | nospace | b64enc }}
{{- end }}

{{/*
Define the djangoSaltKey
*/}}
{{- define "itvr-backend.djangoSaltKey" -}}
{{- randAlphaNum 50 | nospace | b64enc }}
{{- end }}

{{/*
Define the django-secret name
*/}}
{{- define "itvr-backend.django-secret" -}}
itvr-django-secret-{{ .Values.envName }}
{{- end }}

{{/*
Define the django-salt name
*/}}
{{- define "itvr-backend.django-salt" -}}
itvr-django-salt-{{ .Values.envName }}
{{- end }}
Loading

0 comments on commit dd2aa2e

Please sign in to comment.