-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update Chart.yaml * Update to use Deployment instead of DeploymentConfig * Reorganize values.yaml * Increase pnet-proxy response delay for testing * Change pnet-proxy source for testing * Add health check scripts * Update Chart.yaml * Include shell script in build * Add directive to copy shell scripts to build output * Remove jq dependency * Make health check scripts executable * Fix transaction submit path * Add health check secrets for service account * Add health check secrets to Helm chart * Remove unused and unnecessary lines from csproj files * Update readiness probe to use health check script * Clean up health check script * Revert changes to pnet-proxy * Reduce delay to 0 to optimize health checks * Switch pnet-proxy to build from no-downtime-changes branch * Add minimum time delay to guarantee that a response is sent * Increase readiness probe delay * Add preStop hook to avoid transaction loss * Explicitly quote strings * Add startup probe for smoother start * Add Kong-Request-ID header to health check * Increase failure threshold and termination grace period * Implement health check endpoint at /healthz * Set health check endpoint to /healthz * Change pnet-proxy to use RollingUpdate * Apply health check code to all microservices * Replace sample transactions with minimal forms * Increase dev resource limits due to stronger health checks * Add pnet-proxy to deployment script * Fix health check transactions * Add comments to reflect changes * Change pnet-proxy source back to main branch * Remove replicaCount from dev-values.yaml * Update values format to match new structure * Add env label * Add environment identifier to pnet-proxy * Update resource requests and limits for non-prod environments
- Loading branch information
Showing
107 changed files
with
696 additions
and
317 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
|
||
./health-check-common.sh 'TVNIfF5+XCZ8fHx8fHx8WlBOfDB8UHwNWlpafFRBQw1aWlp8VERVDVpDQXx8fDAxDQo=' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/bash | ||
|
||
# get the payload from the script argument | ||
payload=$1 | ||
|
||
# select the correct keycloak token url by environment | ||
if [ $ASPNETCORE_ENVIRONMENT = 'dev' ]; then | ||
tokenEndpoint='https://common-logon-dev.hlth.gov.bc.ca/auth/realms/v2_pos/protocol/openid-connect/token' | ||
|
||
elif [ $ASPNETCORE_ENVIRONMENT = 'tr1' ]; then | ||
tokenEndpoint='https://common-logon-test.hlth.gov.bc.ca/auth/realms/moh_applications/protocol/openid-connect/token' | ||
|
||
elif [ $ASPNETCORE_ENVIRONMENT = 'vs1' ]; then | ||
tokenEndpoint='https://common-logon-test.hlth.gov.bc.ca/auth/realms/moh_applications/protocol/openid-connect/token' | ||
|
||
elif [ $ASPNETCORE_ENVIRONMENT = 'vc2' ]; then | ||
tokenEndpoint='https://common-logon-test.hlth.gov.bc.ca/auth/realms/moh_applications/protocol/openid-connect/token' | ||
|
||
elif [ $ASPNETCORE_ENVIRONMENT = 'vc1' ]; then | ||
tokenEndpoint='https://common-logon-test.hlth.gov.bc.ca/auth/realms/moh_applications/protocol/openid-connect/token' | ||
|
||
elif [ $ASPNETCORE_ENVIRONMENT = 'prd' ]; then | ||
tokenEndpoint='https://common-logon.hlth.gov.bc.ca/auth/realms/moh_applications/protocol/openid-connect/token' | ||
|
||
else | ||
exit 1 | ||
fi | ||
|
||
# request the access token from keycloak | ||
accessToken=$(curl --silent --location --request POST ${tokenEndpoint} \ | ||
--header 'Content-Type: application/x-www-form-urlencoded' \ | ||
--data-urlencode 'grant_type=client_credentials' \ | ||
--data-urlencode "client_id=${HEALTH_CHECK_CLIENT_ID}" \ | ||
--data-urlencode 'audience=pharmanet' \ | ||
--data-urlencode 'scope=openid system/*.write system/*.read system/Claim.read system/Claim.write system/Consent.read system/Consent.write system/Location.read system/Medication.read system/MedicationDispense.read system/MedicationDispense.write system/MedicationRequest.read system/MedicationRequest.write system/MedicationStatement.read system/Patient.read system/Patient.write system/Practitioner.read' \ | ||
--data-urlencode "client_secret=${HEALTH_CHECK_CLIENT_SECRET}" \ | ||
| sed 's/.*"access_token":"\([0-9a-zA-Z_\-]*\.[0-9a-zA-Z_\-]*\.[0-9a-zA-Z_\-]*\)".*/\1/') | ||
|
||
# submit a transaction to the current service | ||
curl --silent --request POST "http://127.0.0.1:8080/healthz" \ | ||
--header 'Content-Type: application/json' \ | ||
--header "Authorization: Bearer ${accessToken}" \ | ||
--header 'Kong-Request-ID: health-check' \ | ||
--data "{'resourceType':'DocumentReference','status':'current','date':'$(date --iso-8601=seconds)','content':[{'attachment':{'contentType':'x-application/hl7-v2+er7','data':'${payload}'}}]}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
|
||
./health-check-common.sh 'TVNIfF5+XCZ8fHx8fHx8WlBOfDB8UHwNWlpafFRDUA1aQ0F8fHwwMA0K' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
|
||
./health-check-common.sh 'TVNIfF5+XCZ8fHx8fHx8WlBOfDB8UHwNWlpafFRJTA1aQ0F8fHwwMA0K' |
Oops, something went wrong.