From fe3db0b845d379f25114310d6d39fcd1b8f6cbef Mon Sep 17 00:00:00 2001 From: Arlo Watts <67204708+arlowatts@users.noreply.github.com> Date: Fri, 30 Aug 2024 14:24:48 -0700 Subject: [PATCH] No downtime changes (#140) * 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 --- Services/ClaimService/src/ClaimService.csproj | 5 +- .../src/Controllers/ClaimController.cs | 23 +++++- Services/ClaimService/src/appsettings.json | 1 + Services/ClaimService/src/health-check.sh | 3 + Services/Common/src/Common.csproj | 1 + .../src/Controllers/ServiceBaseController.cs | 4 +- .../src/Delegates/IPharmanetDelegate.cs | 3 +- .../Common/src/Delegates/PharmanetDelegate.cs | 5 +- .../src/Models/PharmanetDelegateConfig.cs | 8 +- .../Common/src/Services/IPharmanetService.cs | 5 +- .../Common/src/Services/PharmanetService.cs | 5 +- Services/Common/src/health-check-common.sh | 44 +++++++++++ .../ConsentService/src/ConsentService.csproj | 5 +- .../src/Controllers/ConsentController.cs | 22 +++++- Services/ConsentService/src/appsettings.json | 1 + Services/ConsentService/src/health-check.sh | 3 + .../src/Controllers/LocationController.cs | 23 +++++- .../src/LocationService.csproj | 3 +- Services/LocationService/src/appsettings.json | 1 + Services/LocationService/src/health-check.sh | 3 + .../MedicationDispenseController.cs | 29 ++++++-- .../src/MedicationDispenseService.csproj | 2 +- .../src/appsettings.json | 1 + .../src/health-check.sh | 3 + .../MedicationRequestController.cs | 26 +++++-- .../src/MedicationRequestService.csproj | 3 +- .../src/appsettings.json | 1 + .../src/health-check.sh | 3 + .../src/Controllers/MedicationController.cs | 26 +++++-- .../src/MedicationService.csproj | 3 +- .../MedicationService/src/appsettings.json | 1 + .../MedicationService/src/health-check.sh | 3 + .../MedicationStatementController.cs | 29 ++++++-- .../src/MedicationStatementService.csproj | 5 +- .../src/appsettings.json | 1 + .../src/health-check.sh | 3 + .../src/Controllers/PatientController.cs | 23 +++++- .../PatientService/src/PatientService.csproj | 3 +- Services/PatientService/src/appsettings.json | 1 + Services/PatientService/src/health-check.sh | 3 + .../src/Controllers/PractitionerController.cs | 23 +++++- .../src/PractitionerService.csproj | 3 +- .../PractitionerService/src/appsettings.json | 1 + .../PractitionerService/src/health-check.sh | 3 + test/pnet-proxy/app.js | 6 +- tools/helm/common/values.yaml | 3 + .../helm/config/claimservice/dev-values.yaml | 9 ++- .../helm/config/claimservice/prd-values.yaml | 6 +- .../helm/config/claimservice/tr1-values.yaml | 11 ++- .../helm/config/claimservice/vc1-values.yaml | 11 ++- .../helm/config/claimservice/vc2-values.yaml | 11 ++- .../helm/config/claimservice/vs1-values.yaml | 11 ++- .../config/consentservice/dev-values.yaml | 9 ++- .../config/consentservice/prd-values.yaml | 6 +- .../config/consentservice/tr1-values.yaml | 11 ++- .../config/consentservice/vc1-values.yaml | 11 ++- .../config/consentservice/vc2-values.yaml | 11 ++- .../config/consentservice/vs1-values.yaml | 11 ++- .../config/locationservice/dev-values.yaml | 9 ++- .../config/locationservice/prd-values.yaml | 6 +- .../config/locationservice/tr1-values.yaml | 11 ++- .../config/locationservice/vc1-values.yaml | 11 ++- .../config/locationservice/vc2-values.yaml | 11 ++- .../config/locationservice/vs1-values.yaml | 11 ++- .../medicationdispenseservice/dev-values.yaml | 9 ++- .../medicationdispenseservice/prd-values.yaml | 6 +- .../medicationdispenseservice/tr1-values.yaml | 11 ++- .../medicationdispenseservice/vc1-values.yaml | 11 ++- .../medicationdispenseservice/vc2-values.yaml | 11 ++- .../medicationdispenseservice/vs1-values.yaml | 11 ++- .../medicationrequestservice/dev-values.yaml | 9 ++- .../medicationrequestservice/prd-values.yaml | 6 +- .../medicationrequestservice/tr1-values.yaml | 11 ++- .../medicationrequestservice/vc1-values.yaml | 11 ++- .../medicationrequestservice/vc2-values.yaml | 11 ++- .../medicationrequestservice/vs1-values.yaml | 11 ++- .../config/medicationservice/dev-values.yaml | 9 ++- .../config/medicationservice/prd-values.yaml | 6 +- .../config/medicationservice/tr1-values.yaml | 11 ++- .../config/medicationservice/vc1-values.yaml | 11 ++- .../config/medicationservice/vc2-values.yaml | 11 ++- .../config/medicationservice/vs1-values.yaml | 11 ++- .../dev-values.yaml | 9 ++- .../prd-values.yaml | 6 +- .../tr1-values.yaml | 11 ++- .../vc1-values.yaml | 11 ++- .../vc2-values.yaml | 11 ++- .../vs1-values.yaml | 11 ++- .../config/patientservice/dev-values.yaml | 9 ++- .../config/patientservice/prd-values.yaml | 6 +- .../config/patientservice/tr1-values.yaml | 11 ++- .../config/patientservice/vc1-values.yaml | 11 ++- .../config/patientservice/vc2-values.yaml | 11 ++- .../config/patientservice/vs1-values.yaml | 11 ++- .../practitionerservice/dev-values.yaml | 9 ++- .../practitionerservice/prd-values.yaml | 6 +- .../practitionerservice/tr1-values.yaml | 11 ++- .../practitionerservice/vc1-values.yaml | 11 ++- .../practitionerservice/vc2-values.yaml | 11 ++- .../practitionerservice/vs1-values.yaml | 11 ++- tools/helm/deploy.sh | 7 +- .../helm/pnet-proxy/templates/deployment.yaml | 2 +- tools/helm/ppmservice/Chart.yaml | 4 +- tools/helm/ppmservice/templates/_helpers.tpl | 1 + .../helm/ppmservice/templates/deployment.yaml | 73 +++++++++---------- tools/helm/ppmservice/templates/service.yaml | 2 +- tools/helm/ppmservice/values.yaml | 17 ++--- 107 files changed, 696 insertions(+), 317 deletions(-) create mode 100755 Services/ClaimService/src/health-check.sh create mode 100755 Services/Common/src/health-check-common.sh create mode 100755 Services/ConsentService/src/health-check.sh create mode 100755 Services/LocationService/src/health-check.sh create mode 100755 Services/MedicationDispenseService/src/health-check.sh create mode 100755 Services/MedicationRequestService/src/health-check.sh create mode 100755 Services/MedicationService/src/health-check.sh create mode 100755 Services/MedicationStatementService/src/health-check.sh create mode 100755 Services/PatientService/src/health-check.sh create mode 100755 Services/PractitionerService/src/health-check.sh diff --git a/Services/ClaimService/src/ClaimService.csproj b/Services/ClaimService/src/ClaimService.csproj index 6e86d487..e7e4ab69 100644 --- a/Services/ClaimService/src/ClaimService.csproj +++ b/Services/ClaimService/src/ClaimService.csproj @@ -3,13 +3,10 @@ Health.PharmaNet.ClaimService bin\$(Configuration)\$(TargetFramework)\$(MSBuildThisFileName).xml - - net6.0 - - + diff --git a/Services/ClaimService/src/Controllers/ClaimController.cs b/Services/ClaimService/src/Controllers/ClaimController.cs index 01233d34..744a6cf4 100644 --- a/Services/ClaimService/src/Controllers/ClaimController.cs +++ b/Services/ClaimService/src/Controllers/ClaimController.cs @@ -13,6 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. //------------------------------------------------------------------------- + namespace Health.PharmaNet.Controllers { using System.Security.Claims; @@ -33,10 +34,9 @@ namespace Health.PharmaNet.Controllers using Microsoft.Extensions.Logging; /// - /// The MedicationService controller. + /// The Claim service controller. /// [ApiVersion("1.0")] - [Route("/api/v{version:apiVersion}/Claim/")] [ApiController] public class ClaimController : ServiceBaseController { @@ -61,11 +61,12 @@ public ClaimController( } /// - /// The Patient is a citizen as patient resource and manages demographics, addresses, and identifiers. + /// Execute a transaction on this service. /// /// A DocumentReference response as Json. /// Returns Ok when the transaction went through. /// Authorization error, returns JSON describing the error. + [Route("/api/v{version:apiVersion}/Claim/")] [HttpPost] [Produces("application/fhir+json")] [ProducesResponseType(StatusCodes.Status200OK)] @@ -74,5 +75,21 @@ public async Task> Claim() { return await this.PharmanetRequest().ConfigureAwait(true); } + + /// + /// Execute a health check on this service. + /// + /// A DocumentReference response as Json. + /// Returns Ok when the transaction went through. + /// Authorization error, returns JSON describing the error. + [Route("/healthz")] + [HttpPost] + [Produces("application/fhir+json")] + [ProducesResponseType(StatusCodes.Status200OK)] + [Authorize(Policy = FhirScopesPolicy.Access)] + public async Task> HealthCheck() + { + return await this.PharmanetRequest(true).ConfigureAwait(true); + } } } diff --git a/Services/ClaimService/src/appsettings.json b/Services/ClaimService/src/appsettings.json index 0a3eb317..f2907b65 100644 --- a/Services/ClaimService/src/appsettings.json +++ b/Services/ClaimService/src/appsettings.json @@ -377,6 +377,7 @@ }, "PharmanetProxy": { "Endpoint": "{pharmanet_endpoint}", + "HealthCheckEndpoint": "{health check endpoint}", "Password": "{password}", "Username": "{username}", "ClientCertificatePath": "", diff --git a/Services/ClaimService/src/health-check.sh b/Services/ClaimService/src/health-check.sh new file mode 100755 index 00000000..e4c94b45 --- /dev/null +++ b/Services/ClaimService/src/health-check.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +./health-check-common.sh 'TVNIfF5+XCZ8fHx8fHx8WlBOfDB8UHwNWlpafFRBQw1aWlp8VERVDVpDQXx8fDAxDQo=' diff --git a/Services/Common/src/Common.csproj b/Services/Common/src/Common.csproj index 7f71d64e..265e35b3 100644 --- a/Services/Common/src/Common.csproj +++ b/Services/Common/src/Common.csproj @@ -39,6 +39,7 @@ + diff --git a/Services/Common/src/Controllers/ServiceBaseController.cs b/Services/Common/src/Controllers/ServiceBaseController.cs index 9629732d..dae9ad1d 100644 --- a/Services/Common/src/Controllers/ServiceBaseController.cs +++ b/Services/Common/src/Controllers/ServiceBaseController.cs @@ -111,7 +111,7 @@ public ServiceBaseController( // [ProducesResponseType(StatusCodes.Status200OK)] // [Authorize(Policy = FhirScopesPolicy.Access)] [Authorize] - protected async Task> PharmanetRequest() + protected async Task> PharmanetRequest(bool isHealthCheck = false) { Logger.LogInformation(this.logger, $"ServiceBaseController.PharmanetRequest start"); @@ -154,7 +154,7 @@ protected async Task> PharmanetRequest() } Logger.LogInformation(this.logger, $"Trace ID: {traceId}: ServiceBaseController.PharmanetRequest: Authorization completed. Submitting request..."); - RequestResult response = await this.service.SubmitRequest(fhirRequest, traceId + "").ConfigureAwait(true); + RequestResult response = await this.service.SubmitRequest(fhirRequest, traceId + "", isHealthCheck).ConfigureAwait(true); if (response.IsSuccessStatusCode == false) { Logger.LogError(this.logger, $"An Error occurred while invoking Pharmanet endpoint: {response.ErrorMessage}"); diff --git a/Services/Common/src/Delegates/IPharmanetDelegate.cs b/Services/Common/src/Delegates/IPharmanetDelegate.cs index c8096103..c9c1db30 100644 --- a/Services/Common/src/Delegates/IPharmanetDelegate.cs +++ b/Services/Common/src/Delegates/IPharmanetDelegate.cs @@ -28,7 +28,8 @@ public interface IPharmanetDelegate /// The Pharmanet Delegate, which communicates directly to the Pharmanet proxy service. /// /// A PharmanetMessageModel instance containing the HL7v2 request message. + /// A boolean indicating if this request is a health check or a transaction. /// A PharmanetMessageModel as response. - public Task> SubmitRequest(PharmanetMessageModel request); + public Task> SubmitRequest(PharmanetMessageModel request, bool isHealthCheck); } } diff --git a/Services/Common/src/Delegates/PharmanetDelegate.cs b/Services/Common/src/Delegates/PharmanetDelegate.cs index 469a024f..aa9157d2 100644 --- a/Services/Common/src/Delegates/PharmanetDelegate.cs +++ b/Services/Common/src/Delegates/PharmanetDelegate.cs @@ -94,8 +94,9 @@ public PharmanetDelegate(HttpClient client, ILogger logger, I /// Submit a PharmanetMessage to Pharmanet System. /// /// The PharmanetMessage request containing HL7v2 base 64 payload. + /// A boolean indicating if this request is a health check or a transaction. /// A PharmanetMessage response. - public async Task> SubmitRequest(PharmanetMessageModel request) + public async Task> SubmitRequest(PharmanetMessageModel request, bool isHealthCheck) { Logger.LogInformation(this.logger, $"Transaction UUID: {request.TransactionId}: PharmanetDelegate.SubmitRequest start"); @@ -109,7 +110,7 @@ public async Task> SubmitRequest(PharmanetM try { - Uri delegateUri = new Uri(this.pharmanetDelegateConfig.Endpoint); + Uri delegateUri = new Uri(isHealthCheck ? this.pharmanetDelegateConfig.HealthCheckEndpoint : this.pharmanetDelegateConfig.Endpoint); Logger.LogInformation(this.logger, $"Transaction UUID: {request.TransactionId}: PharmanetDelegate.SubmitRequest: Sending message to PharmaNet..."); // This log statement logs sensitive health information - use it only for debugging in a development environment diff --git a/Services/Common/src/Models/PharmanetDelegateConfig.cs b/Services/Common/src/Models/PharmanetDelegateConfig.cs index aa9f1ee9..30e48f4d 100644 --- a/Services/Common/src/Models/PharmanetDelegateConfig.cs +++ b/Services/Common/src/Models/PharmanetDelegateConfig.cs @@ -39,6 +39,12 @@ public class PharmanetDelegateConfig [JsonPropertyName("Endpoint")] public string Endpoint { get; set; } = string.Empty; + /// + /// Gets or sets the endpoint path for the service's health checks. + /// + [JsonPropertyName("HealthCheckEndpoint")] + public string HealthCheckEndpoint { get; set; } = string.Empty; + /// /// Gets or sets the username to use for authentication. /// @@ -63,4 +69,4 @@ public class PharmanetDelegateConfig [JsonPropertyName("ClientCertificatePassword")] public string ClientCertificatePassword { get; set; } = string.Empty; } -} \ No newline at end of file +} diff --git a/Services/Common/src/Services/IPharmanetService.cs b/Services/Common/src/Services/IPharmanetService.cs index 26d69061..8e0cdaff 100644 --- a/Services/Common/src/Services/IPharmanetService.cs +++ b/Services/Common/src/Services/IPharmanetService.cs @@ -29,7 +29,8 @@ public interface IPharmanetService /// /// An HL7 FHIR DocumentReference request containing HL7v2 payload. /// The value used to track messages from API Gateway. + /// A boolean indicating if this request is a health check or a transaction. /// Returns a DocumentReference response. - Task> SubmitRequest(DocumentReference request, string traceId); + Task> SubmitRequest(DocumentReference request, string traceId, bool isHealthCheck); } -} \ No newline at end of file +} diff --git a/Services/Common/src/Services/PharmanetService.cs b/Services/Common/src/Services/PharmanetService.cs index ba09cb30..a935141f 100644 --- a/Services/Common/src/Services/PharmanetService.cs +++ b/Services/Common/src/Services/PharmanetService.cs @@ -57,8 +57,9 @@ public PharmanetService( /// /// The DocumentReference to be submitted. /// The value used to track messages from API Gateway. + /// A boolean indicating if this request is a health check or a transaction. /// Returns a DocumentReference containing the response from PharmaNet. - public async Task> SubmitRequest(DocumentReference request, string traceId) + public async Task> SubmitRequest(DocumentReference request, string traceId, bool isHealthCheck) { Logger.LogInformation(this.logger, $"Trace ID: {traceId}: PharmanetService.SubmitRequest start"); @@ -73,7 +74,7 @@ public async Task> SubmitRequest(DocumentRefere // This log statement logs sensitive health information - use it only for debugging in a development environment // Logger.LogDebug(this.logger, $"Pharmanet Request: {requestMessage.Hl7Message}"); - RequestResult result = await this.pharmanetDelegate.SubmitRequest(requestMessage).ConfigureAwait(true); + RequestResult result = await this.pharmanetDelegate.SubmitRequest(requestMessage, isHealthCheck).ConfigureAwait(true); response.StatusCode = result.StatusCode; response.ErrorMessage = result.ErrorMessage; diff --git a/Services/Common/src/health-check-common.sh b/Services/Common/src/health-check-common.sh new file mode 100755 index 00000000..3b69b317 --- /dev/null +++ b/Services/Common/src/health-check-common.sh @@ -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}'}}]}" diff --git a/Services/ConsentService/src/ConsentService.csproj b/Services/ConsentService/src/ConsentService.csproj index 7fa6b367..10c361df 100644 --- a/Services/ConsentService/src/ConsentService.csproj +++ b/Services/ConsentService/src/ConsentService.csproj @@ -3,13 +3,10 @@ Health.PharmaNet.ConsentService bin\$(Configuration)\$(TargetFramework)\$(MSBuildThisFileName).xml - - net6.0 - - + diff --git a/Services/ConsentService/src/Controllers/ConsentController.cs b/Services/ConsentService/src/Controllers/ConsentController.cs index 970c5640..23687904 100644 --- a/Services/ConsentService/src/Controllers/ConsentController.cs +++ b/Services/ConsentService/src/Controllers/ConsentController.cs @@ -34,10 +34,9 @@ namespace Health.PharmaNet.Controllers using Microsoft.Extensions.Logging; /// - /// The MedicationService controller. + /// The Consent service controller. /// [ApiVersion("1.0")] - [Route("/api/v{version:apiVersion}/Consent/")] [ApiController] public class ConsentController : ServiceBaseController { @@ -62,11 +61,12 @@ public ConsentController( } /// - /// The ProtectiveKeyword acts as a lock; only a practitioner with the protective word can unlock the record to view and/or update its contents. ... Access to PharmaNet is strictly controlled. + /// Execute a transaction on this service. /// /// A DocumentReference response as Json. /// Returns Ok when the transaction went through. /// Authorization error, returns JSON describing the error. + [Route("/api/v{version:apiVersion}/Consent/")] [HttpPost] [Produces("application/fhir+json")] [ProducesResponseType(StatusCodes.Status200OK)] @@ -75,5 +75,21 @@ public async Task> Consent() { return await this.PharmanetRequest().ConfigureAwait(true); } + + /// + /// Execute a health check on this service. + /// + /// A DocumentReference response as Json. + /// Returns Ok when the transaction went through. + /// Authorization error, returns JSON describing the error. + [Route("/healthz")] + [HttpPost] + [Produces("application/fhir+json")] + [ProducesResponseType(StatusCodes.Status200OK)] + [Authorize(Policy = FhirScopesPolicy.Access)] + public async Task> HealthCheck() + { + return await this.PharmanetRequest(true).ConfigureAwait(true); + } } } diff --git a/Services/ConsentService/src/appsettings.json b/Services/ConsentService/src/appsettings.json index 03c7b2a0..9e168ad6 100644 --- a/Services/ConsentService/src/appsettings.json +++ b/Services/ConsentService/src/appsettings.json @@ -71,6 +71,7 @@ }, "PharmanetProxy": { "Endpoint": "{pharmanet_endpoint}", + "HealthCheckEndpoint": "{health check endpoint}", "Password": "{password}", "Username": "{username}", "ClientCertificatePath": "", diff --git a/Services/ConsentService/src/health-check.sh b/Services/ConsentService/src/health-check.sh new file mode 100755 index 00000000..ebf9d406 --- /dev/null +++ b/Services/ConsentService/src/health-check.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +./health-check-common.sh 'TVNIfF5+XCZ8fHx8fHx8WlBOfDB8UHwNWlpafFRDUA1aQ0F8fHwwMA0K' diff --git a/Services/LocationService/src/Controllers/LocationController.cs b/Services/LocationService/src/Controllers/LocationController.cs index 549de5bc..8bbdb8da 100644 --- a/Services/LocationService/src/Controllers/LocationController.cs +++ b/Services/LocationService/src/Controllers/LocationController.cs @@ -13,6 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. //------------------------------------------------------------------------- + namespace Health.PharmaNet.Controllers { using System.Security.Claims; @@ -33,10 +34,9 @@ namespace Health.PharmaNet.Controllers using Microsoft.Extensions.Logging; /// - /// The MedicationService controller. + /// The Location service controller. /// [ApiVersion("1.0")] - [Route("/api/v{version:apiVersion}/Location/")] [ApiController] public class LocationController : ServiceBaseController { @@ -61,11 +61,12 @@ public LocationController( } /// - /// The Patient is a citizen as patient resource and manages demographics, addresses, and identifiers. + /// Execute a transaction on this service. /// /// A DocumentReference response as Json. /// Returns Ok when the transaction went through. /// Authorization error, returns JSON describing the error. + [Route("/api/v{version:apiVersion}/Location/")] [HttpPost] [Produces("application/fhir+json")] [ProducesResponseType(StatusCodes.Status200OK)] @@ -74,5 +75,21 @@ public async Task> Location() { return await this.PharmanetRequest().ConfigureAwait(true); } + + /// + /// Execute a health check on this service. + /// + /// A DocumentReference response as Json. + /// Returns Ok when the transaction went through. + /// Authorization error, returns JSON describing the error. + [Route("/healthz")] + [HttpPost] + [Produces("application/fhir+json")] + [ProducesResponseType(StatusCodes.Status200OK)] + [Authorize(Policy = FhirScopesPolicy.Access)] + public async Task> HealthCheck() + { + return await this.PharmanetRequest(true).ConfigureAwait(true); + } } } diff --git a/Services/LocationService/src/LocationService.csproj b/Services/LocationService/src/LocationService.csproj index 8c716368..2433db89 100644 --- a/Services/LocationService/src/LocationService.csproj +++ b/Services/LocationService/src/LocationService.csproj @@ -5,9 +5,8 @@ bin\$(Configuration)\$(TargetFramework)\$(MSBuildThisFileName).xml net6.0 - - + diff --git a/Services/LocationService/src/appsettings.json b/Services/LocationService/src/appsettings.json index 2e15a5f4..e03193fc 100644 --- a/Services/LocationService/src/appsettings.json +++ b/Services/LocationService/src/appsettings.json @@ -77,6 +77,7 @@ }, "PharmanetProxy": { "Endpoint": "{pharmanet_endpoint}", + "HealthCheckEndpoint": "{health check endpoint}", "Password": "{password}", "Username": "{username}", "ClientCertificatePath": "", diff --git a/Services/LocationService/src/health-check.sh b/Services/LocationService/src/health-check.sh new file mode 100755 index 00000000..6bcc6349 --- /dev/null +++ b/Services/LocationService/src/health-check.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +./health-check-common.sh 'TVNIfF5+XCZ8fHx8fHx8WlBOfDB8UHwNWlpafFRJTA1aQ0F8fHwwMA0K' diff --git a/Services/MedicationDispenseService/src/Controllers/MedicationDispenseController.cs b/Services/MedicationDispenseService/src/Controllers/MedicationDispenseController.cs index dd451de9..1e177430 100644 --- a/Services/MedicationDispenseService/src/Controllers/MedicationDispenseController.cs +++ b/Services/MedicationDispenseService/src/Controllers/MedicationDispenseController.cs @@ -13,16 +13,20 @@ // See the License for the specific language governing permissions and // limitations under the License. //------------------------------------------------------------------------- + namespace Health.PharmaNet.Controllers { + using System.Security.Claims; using System.Threading.Tasks; using Health.PharmaNet.Common.Authorization.Policy; + using Health.PharmaNet.Common.Http; using Health.PharmaNet.Parsers; using Health.PharmaNet.Services; using Hl7.Fhir.Model; + using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; @@ -30,10 +34,9 @@ namespace Health.PharmaNet.Controllers using Microsoft.Extensions.Logging; /// - /// The MedicationService controller. + /// The MedicationDispense service controller. /// [ApiVersion("1.0")] - [Route("/api/v{version:apiVersion}/MedicationDispense/")] [ApiController] public class MedicationDispenseController : ServiceBaseController { @@ -58,12 +61,12 @@ public MedicationDispenseController( } /// - /// This resource is primarily used for the identification and definition - /// of a medication for the purposes of prescribing, dispensing, and administering - /// a medication as well as for making statements about medication use. + /// Execute a transaction on this service. + /// /// A DocumentReference response as Json. /// Returns Ok when the transaction went through. /// Authorization error, returns JSON describing the error. + [Route("/api/v{version:apiVersion}/MedicationDispense/")] [HttpPost] [Produces("application/fhir+json")] [ProducesResponseType(StatusCodes.Status200OK)] @@ -72,5 +75,21 @@ public async Task> MedicationDispense() { return await this.PharmanetRequest().ConfigureAwait(true); } + + /// + /// Execute a health check on this service. + /// + /// A DocumentReference response as Json. + /// Returns Ok when the transaction went through. + /// Authorization error, returns JSON describing the error. + [Route("/healthz")] + [HttpPost] + [Produces("application/fhir+json")] + [ProducesResponseType(StatusCodes.Status200OK)] + [Authorize(Policy = FhirScopesPolicy.Access)] + public async Task> HealthCheck() + { + return await this.PharmanetRequest(true).ConfigureAwait(true); + } } } diff --git a/Services/MedicationDispenseService/src/MedicationDispenseService.csproj b/Services/MedicationDispenseService/src/MedicationDispenseService.csproj index 34429988..4f0838ef 100644 --- a/Services/MedicationDispenseService/src/MedicationDispenseService.csproj +++ b/Services/MedicationDispenseService/src/MedicationDispenseService.csproj @@ -6,7 +6,7 @@ net6.0 - + diff --git a/Services/MedicationDispenseService/src/appsettings.json b/Services/MedicationDispenseService/src/appsettings.json index 61aa1391..fa7ca880 100644 --- a/Services/MedicationDispenseService/src/appsettings.json +++ b/Services/MedicationDispenseService/src/appsettings.json @@ -176,6 +176,7 @@ }, "PharmanetProxy": { "Endpoint": "{pharmanet_endpoint}", + "HealthCheckEndpoint": "{health check endpoint}", "Password": "{password}", "Username": "{username}", "ClientCertificatePath": "", diff --git a/Services/MedicationDispenseService/src/health-check.sh b/Services/MedicationDispenseService/src/health-check.sh new file mode 100755 index 00000000..1bf19ff4 --- /dev/null +++ b/Services/MedicationDispenseService/src/health-check.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +./health-check-common.sh 'TVNIfF5+XCZ8fHx8fHx8WlBOfDB8UHwNWlpafFRNVQ1aQ0F8fHwwMQ0K' diff --git a/Services/MedicationRequestService/src/Controllers/MedicationRequestController.cs b/Services/MedicationRequestService/src/Controllers/MedicationRequestController.cs index 23dc5643..bbf0cf88 100644 --- a/Services/MedicationRequestService/src/Controllers/MedicationRequestController.cs +++ b/Services/MedicationRequestService/src/Controllers/MedicationRequestController.cs @@ -13,6 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. //------------------------------------------------------------------------- + namespace Health.PharmaNet.Controllers { using System.Security.Claims; @@ -33,10 +34,9 @@ namespace Health.PharmaNet.Controllers using Microsoft.Extensions.Logging; /// - /// The MedicationService controller. + /// The MedicationRequest service controller. /// [ApiVersion("1.0")] - [Route("/api/v{version:apiVersion}/MedicationRequest/")] [ApiController] public class MedicationRequestController : ServiceBaseController { @@ -61,14 +61,12 @@ public MedicationRequestController( } /// - /// The MedicationRequest is an order or request for both supply of the medication and the instructions for administration of - /// the medication to a patient. The resource is called "MedicationRequest" rather than "MedicationPrescription" or "MedicationOrder" - /// to generalize the use across inpatient and outpatient settings, including care plans, etc., and to harmonize with workflow patterns. + /// Execute a transaction on this service. /// /// A DocumentReference response as Json. /// Returns Ok when the transaction went through. /// Authorization error, returns JSON describing the error. - /// The service error occurred. + [Route("/api/v{version:apiVersion}/MedicationRequest/")] [HttpPost] [Produces("application/fhir+json")] [ProducesResponseType(StatusCodes.Status200OK)] @@ -77,5 +75,21 @@ public async Task> MedicationRequest() { return await this.PharmanetRequest().ConfigureAwait(true); } + + /// + /// Execute a health check on this service. + /// + /// A DocumentReference response as Json. + /// Returns Ok when the transaction went through. + /// Authorization error, returns JSON describing the error. + [Route("/healthz")] + [HttpPost] + [Produces("application/fhir+json")] + [ProducesResponseType(StatusCodes.Status200OK)] + [Authorize(Policy = FhirScopesPolicy.Access)] + public async Task> HealthCheck() + { + return await this.PharmanetRequest(true).ConfigureAwait(true); + } } } diff --git a/Services/MedicationRequestService/src/MedicationRequestService.csproj b/Services/MedicationRequestService/src/MedicationRequestService.csproj index 5b48a9e0..4fe927a6 100644 --- a/Services/MedicationRequestService/src/MedicationRequestService.csproj +++ b/Services/MedicationRequestService/src/MedicationRequestService.csproj @@ -5,9 +5,8 @@ bin\$(Configuration)\$(TargetFramework)\$(MSBuildThisFileName).xml net6.0 - - + diff --git a/Services/MedicationRequestService/src/appsettings.json b/Services/MedicationRequestService/src/appsettings.json index 9242f00e..f1fd9c13 100644 --- a/Services/MedicationRequestService/src/appsettings.json +++ b/Services/MedicationRequestService/src/appsettings.json @@ -179,6 +179,7 @@ }, "PharmanetProxy": { "Endpoint": "{pharmanet_endpoint}", + "HealthCheckEndpoint": "{health check endpoint}", "Password": "{password}", "Username": "{username}", "ClientCertificatePath": "", diff --git a/Services/MedicationRequestService/src/health-check.sh b/Services/MedicationRequestService/src/health-check.sh new file mode 100755 index 00000000..7db44b43 --- /dev/null +++ b/Services/MedicationRequestService/src/health-check.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +./health-check-common.sh 'TVNIfF5+XCZ8fHx8fHx8WlBOfDB8UHwNWlpafFRSWA1aQ0F8fHxYMA0K' diff --git a/Services/MedicationService/src/Controllers/MedicationController.cs b/Services/MedicationService/src/Controllers/MedicationController.cs index f910d082..cd75b3cc 100644 --- a/Services/MedicationService/src/Controllers/MedicationController.cs +++ b/Services/MedicationService/src/Controllers/MedicationController.cs @@ -13,6 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. //------------------------------------------------------------------------- + namespace Health.PharmaNet.Controllers { using System.Security.Claims; @@ -33,10 +34,9 @@ namespace Health.PharmaNet.Controllers using Microsoft.Extensions.Logging; /// - /// The MedicationService controller. + /// The Medication service controller. /// [ApiVersion("1.0")] - [Route("/api/v{version:apiVersion}/Medication/")] [ApiController] public class MedicationController : ServiceBaseController { @@ -61,12 +61,12 @@ public MedicationController( } /// - /// This resource is primarily used for the identification and definition - /// of a medication for the purposes of prescribing, dispensing, and administering - /// a medication as well as for making statements about medication use. + /// Execute a transaction on this service. + /// /// A DocumentReference response as Json. /// Returns Ok when the transaction went through. /// Authorization error, returns JSON describing the error. + [Route("/api/v{version:apiVersion}/Medication/")] [HttpPost] [Produces("application/fhir+json")] [ProducesResponseType(StatusCodes.Status200OK)] @@ -75,5 +75,21 @@ public async Task> Medication() { return await this.PharmanetRequest().ConfigureAwait(true); } + + /// + /// Execute a health check on this service. + /// + /// A DocumentReference response as Json. + /// Returns Ok when the transaction went through. + /// Authorization error, returns JSON describing the error. + [Route("/healthz")] + [HttpPost] + [Produces("application/fhir+json")] + [ProducesResponseType(StatusCodes.Status200OK)] + [Authorize(Policy = FhirScopesPolicy.Access)] + public async Task> HealthCheck() + { + return await this.PharmanetRequest(true).ConfigureAwait(true); + } } } diff --git a/Services/MedicationService/src/MedicationService.csproj b/Services/MedicationService/src/MedicationService.csproj index 04688c1a..836a36f7 100644 --- a/Services/MedicationService/src/MedicationService.csproj +++ b/Services/MedicationService/src/MedicationService.csproj @@ -5,9 +5,8 @@ bin\$(Configuration)\$(TargetFramework)\$(MSBuildThisFileName).xml net6.0 - - + diff --git a/Services/MedicationService/src/appsettings.json b/Services/MedicationService/src/appsettings.json index 72ea7688..6ab37ffb 100644 --- a/Services/MedicationService/src/appsettings.json +++ b/Services/MedicationService/src/appsettings.json @@ -76,6 +76,7 @@ }, "PharmanetProxy": { "Endpoint": "{pharmanet_endpoint}", + "HealthCheckEndpoint": "{health check endpoint}", "Password": "{password}", "Username": "{username}", "ClientCertificatePath": "", diff --git a/Services/MedicationService/src/health-check.sh b/Services/MedicationService/src/health-check.sh new file mode 100755 index 00000000..f3ebc4b2 --- /dev/null +++ b/Services/MedicationService/src/health-check.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +./health-check-common.sh 'TVNIfF5+XCZ8fHx8fHx8WlBOfDB8UHwNWlpafFREUg1aQ0F8fHwwMA0K' diff --git a/Services/MedicationStatementService/src/Controllers/MedicationStatementController.cs b/Services/MedicationStatementService/src/Controllers/MedicationStatementController.cs index cd92d88d..147d3b7b 100644 --- a/Services/MedicationStatementService/src/Controllers/MedicationStatementController.cs +++ b/Services/MedicationStatementService/src/Controllers/MedicationStatementController.cs @@ -13,16 +13,20 @@ // See the License for the specific language governing permissions and // limitations under the License. //------------------------------------------------------------------------- + namespace Health.PharmaNet.Controllers { + using System.Security.Claims; using System.Threading.Tasks; using Health.PharmaNet.Common.Authorization.Policy; + using Health.PharmaNet.Common.Http; using Health.PharmaNet.Parsers; using Health.PharmaNet.Services; using Hl7.Fhir.Model; + using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; @@ -30,10 +34,9 @@ namespace Health.PharmaNet.Controllers using Microsoft.Extensions.Logging; /// - /// The MedicationService controller. For medication product information. + /// The MedicationStatement service controller. /// [ApiVersion("1.0")] - [Route("/api/v{version:apiVersion}/MedicationStatement/")] [ApiController] public class MedicationStatementController : ServiceBaseController { @@ -58,14 +61,12 @@ public MedicationStatementController( } /// - /// The MedicationRequest is an order or request for both supply of the medication and the - /// instructions for administration of the medication to a patient. The resource is called "MedicationRequest" rather than - /// "MedicationPrescription" or "MedicationOrder" to generalize the use across inpatient and outpatient settings, including care plans, etc., - /// and to harmonize with workflow patterns. + /// Execute a transaction on this service. /// /// A DocumentReference response as Json. /// Returns Ok when the transaction went through. /// Authorization error, returns JSON describing the error. + [Route("/api/v{version:apiVersion}/MedicationStatement/")] [HttpPost] [Produces("application/fhir+json")] [ProducesResponseType(StatusCodes.Status200OK)] @@ -74,5 +75,21 @@ public async Task> MedicationStatement() { return await this.PharmanetRequest().ConfigureAwait(true); } + + /// + /// Execute a health check on this service. + /// + /// A DocumentReference response as Json. + /// Returns Ok when the transaction went through. + /// Authorization error, returns JSON describing the error. + [Route("/healthz")] + [HttpPost] + [Produces("application/fhir+json")] + [ProducesResponseType(StatusCodes.Status200OK)] + [Authorize(Policy = FhirScopesPolicy.Access)] + public async Task> HealthCheck() + { + return await this.PharmanetRequest(true).ConfigureAwait(true); + } } } diff --git a/Services/MedicationStatementService/src/MedicationStatementService.csproj b/Services/MedicationStatementService/src/MedicationStatementService.csproj index 0073cbcd..4904562c 100644 --- a/Services/MedicationStatementService/src/MedicationStatementService.csproj +++ b/Services/MedicationStatementService/src/MedicationStatementService.csproj @@ -2,12 +2,11 @@ Health.PharmaNet.MedicationStatementService - net6.0 bin\$(Configuration)\$(TargetFramework)\$(MSBuildThisFileName).xml + net6.0 - - + diff --git a/Services/MedicationStatementService/src/appsettings.json b/Services/MedicationStatementService/src/appsettings.json index 6afcaffd..6a4a647c 100644 --- a/Services/MedicationStatementService/src/appsettings.json +++ b/Services/MedicationStatementService/src/appsettings.json @@ -284,6 +284,7 @@ }, "PharmanetProxy": { "Endpoint": "{pharmanet_endpoint}", + "HealthCheckEndpoint": "{health check endpoint}", "Password": "{password}", "Username": "{username}", "ClientCertificatePath": "", diff --git a/Services/MedicationStatementService/src/health-check.sh b/Services/MedicationStatementService/src/health-check.sh new file mode 100755 index 00000000..154c57e1 --- /dev/null +++ b/Services/MedicationStatementService/src/health-check.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +./health-check-common.sh 'TVNIfF5+XCZ8fHx8fHx8WlBOfDB8UHwNWlpafFREVQ1aQ0F8fHwwMA0K' diff --git a/Services/PatientService/src/Controllers/PatientController.cs b/Services/PatientService/src/Controllers/PatientController.cs index 88c4720e..331be8ae 100644 --- a/Services/PatientService/src/Controllers/PatientController.cs +++ b/Services/PatientService/src/Controllers/PatientController.cs @@ -13,6 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. //------------------------------------------------------------------------- + namespace Health.PharmaNet.Controllers { using System.Security.Claims; @@ -33,10 +34,9 @@ namespace Health.PharmaNet.Controllers using Microsoft.Extensions.Logging; /// - /// The MedicationService controller. + /// The Patient service controller. /// [ApiVersion("1.0")] - [Route("/api/v{version:apiVersion}/Patient/")] [ApiController] public class PatientController : ServiceBaseController { @@ -61,11 +61,12 @@ public PatientController( } /// - /// The Patient is a citizen as patient resource and manages demographics, addresses, and identifiers. + /// Execute a transaction on this service. /// /// A DocumentReference response as Json. /// Returns Ok when the transaction went through. /// Authorization error, returns JSON describing the error. + [Route("/api/v{version:apiVersion}/Patient/")] [HttpPost] [Produces("application/fhir+json")] [ProducesResponseType(StatusCodes.Status200OK)] @@ -74,5 +75,21 @@ public async Task> Patient() { return await this.PharmanetRequest().ConfigureAwait(true); } + + /// + /// Execute a health check on this service. + /// + /// A DocumentReference response as Json. + /// Returns Ok when the transaction went through. + /// Authorization error, returns JSON describing the error. + [Route("/healthz")] + [HttpPost] + [Produces("application/fhir+json")] + [ProducesResponseType(StatusCodes.Status200OK)] + [Authorize(Policy = FhirScopesPolicy.Access)] + public async Task> HealthCheck() + { + return await this.PharmanetRequest(true).ConfigureAwait(true); + } } } diff --git a/Services/PatientService/src/PatientService.csproj b/Services/PatientService/src/PatientService.csproj index 161dae69..20d6f876 100644 --- a/Services/PatientService/src/PatientService.csproj +++ b/Services/PatientService/src/PatientService.csproj @@ -5,9 +5,8 @@ bin\$(Configuration)\$(TargetFramework)\$(MSBuildThisFileName).xml net6.0 - - + diff --git a/Services/PatientService/src/appsettings.json b/Services/PatientService/src/appsettings.json index 5053a371..05f7fb5b 100644 --- a/Services/PatientService/src/appsettings.json +++ b/Services/PatientService/src/appsettings.json @@ -212,6 +212,7 @@ }, "PharmanetProxy": { "Endpoint": "{pharmanet_endpoint}", + "HealthCheckEndpoint": "{health check endpoint}", "Password": "{password}", "Username": "{username}", "ClientCertificatePath": "", diff --git a/Services/PatientService/src/health-check.sh b/Services/PatientService/src/health-check.sh new file mode 100755 index 00000000..9d572f85 --- /dev/null +++ b/Services/PatientService/src/health-check.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +./health-check-common.sh 'TVNIfF5+XCZ8fHx8fHx8WlBOfDB8UHwNWlpafFRJRA1aQ0F8fHwwMA0K' diff --git a/Services/PractitionerService/src/Controllers/PractitionerController.cs b/Services/PractitionerService/src/Controllers/PractitionerController.cs index 0d56e3df..81ce5b73 100644 --- a/Services/PractitionerService/src/Controllers/PractitionerController.cs +++ b/Services/PractitionerService/src/Controllers/PractitionerController.cs @@ -13,6 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. //------------------------------------------------------------------------- + namespace Health.PharmaNet.Controllers { using System.Security.Claims; @@ -33,10 +34,9 @@ namespace Health.PharmaNet.Controllers using Microsoft.Extensions.Logging; /// - /// The MedicationService controller. + /// The Practitioner service controller. /// [ApiVersion("1.0")] - [Route("/api/v{version:apiVersion}/Practitioner/")] [ApiController] public class PractitionerController : ServiceBaseController { @@ -61,11 +61,12 @@ public PractitionerController( } /// - /// The Patient is a citizen as patient resource and manages demographics, addresses, and identifiers. + /// Execute a transaction on this service. /// /// A DocumentReference response as Json. /// Returns Ok when the transaction went through. /// Authorization error, returns JSON describing the error. + [Route("/api/v{version:apiVersion}/Practitioner/")] [HttpPost] [Produces("application/fhir+json")] [ProducesResponseType(StatusCodes.Status200OK)] @@ -74,5 +75,21 @@ public async Task> Practitioner() { return await this.PharmanetRequest().ConfigureAwait(true); } + + /// + /// Execute a health check on this service. + /// + /// A DocumentReference response as Json. + /// Returns Ok when the transaction went through. + /// Authorization error, returns JSON describing the error. + [Route("/healthz")] + [HttpPost] + [Produces("application/fhir+json")] + [ProducesResponseType(StatusCodes.Status200OK)] + [Authorize(Policy = FhirScopesPolicy.Access)] + public async Task> HealthCheck() + { + return await this.PharmanetRequest(true).ConfigureAwait(true); + } } } diff --git a/Services/PractitionerService/src/PractitionerService.csproj b/Services/PractitionerService/src/PractitionerService.csproj index 8bb30d48..58b84e20 100644 --- a/Services/PractitionerService/src/PractitionerService.csproj +++ b/Services/PractitionerService/src/PractitionerService.csproj @@ -5,9 +5,8 @@ bin\$(Configuration)\$(TargetFramework)\$(MSBuildThisFileName).xml net6.0 - - + diff --git a/Services/PractitionerService/src/appsettings.json b/Services/PractitionerService/src/appsettings.json index 68214c89..7d2cd07a 100644 --- a/Services/PractitionerService/src/appsettings.json +++ b/Services/PractitionerService/src/appsettings.json @@ -71,6 +71,7 @@ }, "PharmanetProxy": { "Endpoint": "{pharmanet_endpoint}", + "HealthCheckEndpoint": "{health check endpoint}", "Password": "{password}", "Username": "{username}", "ClientCertificatePath": "", diff --git a/Services/PractitionerService/src/health-check.sh b/Services/PractitionerService/src/health-check.sh new file mode 100755 index 00000000..a76bfe01 --- /dev/null +++ b/Services/PractitionerService/src/health-check.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +./health-check-common.sh 'TVNIfF5+XCZ8fHx8fHx8WlBOfDB8UHwNWlpafFRJUA1aQ0F8fHwwMA0K' diff --git a/test/pnet-proxy/app.js b/test/pnet-proxy/app.js index 7e9e6f8e..d9e41c30 100644 --- a/test/pnet-proxy/app.js +++ b/test/pnet-proxy/app.js @@ -4,7 +4,7 @@ const port = 8080; const host = "0.0.0.0"; const app = express(); -const meanDelayMilliseconds = 250; +const meanDelayMilliseconds = 0; const responseJson = { "transactionUUID": "22c263c9-1903-4cbf-8eb2-c43fa7b9dfa7", @@ -16,7 +16,7 @@ app.post("/submit", function (req, res) { res.contentType = "application/json"; - res.setTimeout(randomExp(meanDelayMilliseconds), () => { res.send(responseJson); }); + res.setTimeout(Math.max(randomExp(meanDelayMilliseconds), 1), () => { res.send(responseJson); }); }); app.get("/", function (req, res) { @@ -24,7 +24,7 @@ app.get("/", function (req, res) { res.contentType = "application/json"; - res.setTimeout(randomExp(meanDelayMilliseconds), () => { res.send(responseJson); }); + res.setTimeout(Math.max(randomExp(meanDelayMilliseconds), 1), () => { res.send(responseJson); }); }); // Generate a random number, exponentially distributed with the given mean. diff --git a/tools/helm/common/values.yaml b/tools/helm/common/values.yaml index 2c772b45..e9526db1 100644 --- a/tools/helm/common/values.yaml +++ b/tools/helm/common/values.yaml @@ -4,6 +4,9 @@ Secrets: PharmaNet_PharmanetProxy__Endpoint: ${endpoint} PharmaNet_PharmanetProxy__Password: ${password} PharmaNet_PharmanetProxy__Username: ${username} + HEALTH_CHECK_CLIENT_ID: # client id used to authenticate health checks + HEALTH_CHECK_CLIENT_SECRET: # client secret used to authenticate health checks + PharmaNet_PharmanetProxy__HealthCheckEndpoint: # endpoint used for health checks #Used to load the certificate file into the common config map Configuration: diff --git a/tools/helm/config/claimservice/dev-values.yaml b/tools/helm/config/claimservice/dev-values.yaml index 8d723602..4eb33ef9 100644 --- a/tools/helm/config/claimservice/dev-values.yaml +++ b/tools/helm/config/claimservice/dev-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-dev-secrets PharmaNet_PharmanetProxy__Password: common-dev-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-dev-secrets + HEALTH_CHECK_CLIENT_ID: common-dev-secrets + HEALTH_CHECK_CLIENT_SECRET: common-dev-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-dev-secrets OpenShift: Environment: dev @@ -16,10 +19,8 @@ image: resources: limits: - cpu: 16m + cpu: 10m memory: 256Mi requests: - cpu: 2m + cpu: 5m memory: 128Mi - -replicaCount: 1 diff --git a/tools/helm/config/claimservice/prd-values.yaml b/tools/helm/config/claimservice/prd-values.yaml index bfe18562..6517c7ab 100644 --- a/tools/helm/config/claimservice/prd-values.yaml +++ b/tools/helm/config/claimservice/prd-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-prd-secrets PharmaNet_PharmanetProxy__Password: common-prd-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-prd-secrets + HEALTH_CHECK_CLIENT_ID: common-prd-secrets + HEALTH_CHECK_CLIENT_SECRET: common-prd-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-prd-secrets OpenShift: Environment: prd @@ -22,4 +25,5 @@ resources: cpu: 60m memory: 128Mi -replicaCount: 8 +deploymentSpec: + replicas: 8 diff --git a/tools/helm/config/claimservice/tr1-values.yaml b/tools/helm/config/claimservice/tr1-values.yaml index 0aab7b32..f8e20354 100644 --- a/tools/helm/config/claimservice/tr1-values.yaml +++ b/tools/helm/config/claimservice/tr1-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-tr1-secrets PharmaNet_PharmanetProxy__Password: common-tr1-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-tr1-secrets + HEALTH_CHECK_CLIENT_ID: common-tr1-secrets + HEALTH_CHECK_CLIENT_SECRET: common-tr1-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-tr1-secrets OpenShift: Environment: tr1 @@ -16,8 +19,8 @@ image: resources: limits: - cpu: 100m - memory: 200Mi + cpu: 10m + memory: 256Mi requests: - cpu: 1m - memory: 100Mi + cpu: 5m + memory: 128Mi diff --git a/tools/helm/config/claimservice/vc1-values.yaml b/tools/helm/config/claimservice/vc1-values.yaml index 1c620328..c5491032 100644 --- a/tools/helm/config/claimservice/vc1-values.yaml +++ b/tools/helm/config/claimservice/vc1-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-vc1-secrets PharmaNet_PharmanetProxy__Password: common-vc1-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-vc1-secrets + HEALTH_CHECK_CLIENT_ID: common-vc1-secrets + HEALTH_CHECK_CLIENT_SECRET: common-vc1-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-vc1-secrets OpenShift: Environment: vc1 @@ -16,8 +19,8 @@ image: resources: limits: - cpu: 100m - memory: 200Mi + cpu: 10m + memory: 256Mi requests: - cpu: 1m - memory: 100Mi + cpu: 5m + memory: 128Mi diff --git a/tools/helm/config/claimservice/vc2-values.yaml b/tools/helm/config/claimservice/vc2-values.yaml index 7d71cd12..4583db75 100644 --- a/tools/helm/config/claimservice/vc2-values.yaml +++ b/tools/helm/config/claimservice/vc2-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-vc2-secrets PharmaNet_PharmanetProxy__Password: common-vc2-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-vc2-secrets + HEALTH_CHECK_CLIENT_ID: common-vc2-secrets + HEALTH_CHECK_CLIENT_SECRET: common-vc2-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-vc2-secrets OpenShift: Environment: vc2 @@ -16,8 +19,8 @@ image: resources: limits: - cpu: 100m - memory: 200Mi + cpu: 10m + memory: 256Mi requests: - cpu: 1m - memory: 100Mi + cpu: 5m + memory: 128Mi diff --git a/tools/helm/config/claimservice/vs1-values.yaml b/tools/helm/config/claimservice/vs1-values.yaml index 83642e86..9191c809 100644 --- a/tools/helm/config/claimservice/vs1-values.yaml +++ b/tools/helm/config/claimservice/vs1-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-vs1-secrets PharmaNet_PharmanetProxy__Password: common-vs1-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-vs1-secrets + HEALTH_CHECK_CLIENT_ID: common-vs1-secrets + HEALTH_CHECK_CLIENT_SECRET: common-vs1-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-vs1-secrets OpenShift: Environment: vs1 @@ -16,8 +19,8 @@ image: resources: limits: - cpu: 100m - memory: 200Mi + cpu: 10m + memory: 256Mi requests: - cpu: 1m - memory: 100Mi + cpu: 5m + memory: 128Mi diff --git a/tools/helm/config/consentservice/dev-values.yaml b/tools/helm/config/consentservice/dev-values.yaml index fe3d62b2..67ef1678 100644 --- a/tools/helm/config/consentservice/dev-values.yaml +++ b/tools/helm/config/consentservice/dev-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-dev-secrets PharmaNet_PharmanetProxy__Password: common-dev-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-dev-secrets + HEALTH_CHECK_CLIENT_ID: common-dev-secrets + HEALTH_CHECK_CLIENT_SECRET: common-dev-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-dev-secrets OpenShift: Environment: dev @@ -16,10 +19,8 @@ image: resources: limits: - cpu: 16m + cpu: 10m memory: 256Mi requests: - cpu: 2m + cpu: 5m memory: 128Mi - -replicaCount: 1 diff --git a/tools/helm/config/consentservice/prd-values.yaml b/tools/helm/config/consentservice/prd-values.yaml index 89020801..f90ae121 100644 --- a/tools/helm/config/consentservice/prd-values.yaml +++ b/tools/helm/config/consentservice/prd-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-prd-secrets PharmaNet_PharmanetProxy__Password: common-prd-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-prd-secrets + HEALTH_CHECK_CLIENT_ID: common-prd-secrets + HEALTH_CHECK_CLIENT_SECRET: common-prd-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-prd-secrets OpenShift: Environment: prd @@ -22,4 +25,5 @@ resources: cpu: 8m memory: 128Mi -replicaCount: 2 +deploymentSpec: + replicas: 2 diff --git a/tools/helm/config/consentservice/tr1-values.yaml b/tools/helm/config/consentservice/tr1-values.yaml index f46619ac..09d4a8e3 100644 --- a/tools/helm/config/consentservice/tr1-values.yaml +++ b/tools/helm/config/consentservice/tr1-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-tr1-secrets PharmaNet_PharmanetProxy__Password: common-tr1-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-tr1-secrets + HEALTH_CHECK_CLIENT_ID: common-tr1-secrets + HEALTH_CHECK_CLIENT_SECRET: common-tr1-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-tr1-secrets OpenShift: Environment: tr1 @@ -16,8 +19,8 @@ image: resources: limits: - cpu: 100m - memory: 200Mi + cpu: 10m + memory: 256Mi requests: - cpu: 1m - memory: 100Mi + cpu: 5m + memory: 128Mi diff --git a/tools/helm/config/consentservice/vc1-values.yaml b/tools/helm/config/consentservice/vc1-values.yaml index 120897ab..f42d0f9e 100644 --- a/tools/helm/config/consentservice/vc1-values.yaml +++ b/tools/helm/config/consentservice/vc1-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-vc1-secrets PharmaNet_PharmanetProxy__Password: common-vc1-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-vc1-secrets + HEALTH_CHECK_CLIENT_ID: common-vc1-secrets + HEALTH_CHECK_CLIENT_SECRET: common-vc1-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-vc1-secrets OpenShift: Environment: vc1 @@ -16,8 +19,8 @@ image: resources: limits: - cpu: 100m - memory: 200Mi + cpu: 10m + memory: 256Mi requests: - cpu: 1m - memory: 100Mi + cpu: 5m + memory: 128Mi diff --git a/tools/helm/config/consentservice/vc2-values.yaml b/tools/helm/config/consentservice/vc2-values.yaml index 43d84e42..383459c8 100644 --- a/tools/helm/config/consentservice/vc2-values.yaml +++ b/tools/helm/config/consentservice/vc2-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-vc2-secrets PharmaNet_PharmanetProxy__Password: common-vc2-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-vc2-secrets + HEALTH_CHECK_CLIENT_ID: common-vc2-secrets + HEALTH_CHECK_CLIENT_SECRET: common-vc2-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-vc2-secrets OpenShift: Environment: vc2 @@ -16,8 +19,8 @@ image: resources: limits: - cpu: 100m - memory: 200Mi + cpu: 10m + memory: 256Mi requests: - cpu: 1m - memory: 100Mi + cpu: 5m + memory: 128Mi diff --git a/tools/helm/config/consentservice/vs1-values.yaml b/tools/helm/config/consentservice/vs1-values.yaml index e146be2c..f0775566 100644 --- a/tools/helm/config/consentservice/vs1-values.yaml +++ b/tools/helm/config/consentservice/vs1-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-vs1-secrets PharmaNet_PharmanetProxy__Password: common-vs1-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-vs1-secrets + HEALTH_CHECK_CLIENT_ID: common-vs1-secrets + HEALTH_CHECK_CLIENT_SECRET: common-vs1-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-vs1-secrets OpenShift: Environment: vs1 @@ -16,8 +19,8 @@ image: resources: limits: - cpu: 100m - memory: 200Mi + cpu: 10m + memory: 256Mi requests: - cpu: 1m - memory: 100Mi + cpu: 5m + memory: 128Mi diff --git a/tools/helm/config/locationservice/dev-values.yaml b/tools/helm/config/locationservice/dev-values.yaml index 302e0908..85c3c903 100644 --- a/tools/helm/config/locationservice/dev-values.yaml +++ b/tools/helm/config/locationservice/dev-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-dev-secrets PharmaNet_PharmanetProxy__Password: common-dev-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-dev-secrets + HEALTH_CHECK_CLIENT_ID: common-dev-secrets + HEALTH_CHECK_CLIENT_SECRET: common-dev-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-dev-secrets OpenShift: Environment: dev @@ -16,10 +19,8 @@ image: resources: limits: - cpu: 16m + cpu: 10m memory: 256Mi requests: - cpu: 2m + cpu: 5m memory: 128Mi - -replicaCount: 1 diff --git a/tools/helm/config/locationservice/prd-values.yaml b/tools/helm/config/locationservice/prd-values.yaml index bc27088b..53bc179e 100644 --- a/tools/helm/config/locationservice/prd-values.yaml +++ b/tools/helm/config/locationservice/prd-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-prd-secrets PharmaNet_PharmanetProxy__Password: common-prd-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-prd-secrets + HEALTH_CHECK_CLIENT_ID: common-prd-secrets + HEALTH_CHECK_CLIENT_SECRET: common-prd-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-prd-secrets OpenShift: Environment: prd @@ -22,4 +25,5 @@ resources: cpu: 8m memory: 128Mi -replicaCount: 2 +deploymentSpec: + replicas: 2 diff --git a/tools/helm/config/locationservice/tr1-values.yaml b/tools/helm/config/locationservice/tr1-values.yaml index 28f9ba83..559a2ebe 100644 --- a/tools/helm/config/locationservice/tr1-values.yaml +++ b/tools/helm/config/locationservice/tr1-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-tr1-secrets PharmaNet_PharmanetProxy__Password: common-tr1-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-tr1-secrets + HEALTH_CHECK_CLIENT_ID: common-tr1-secrets + HEALTH_CHECK_CLIENT_SECRET: common-tr1-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-tr1-secrets OpenShift: Environment: tr1 @@ -16,8 +19,8 @@ image: resources: limits: - cpu: 100m - memory: 200Mi + cpu: 10m + memory: 256Mi requests: - cpu: 1m - memory: 100Mi + cpu: 5m + memory: 128Mi diff --git a/tools/helm/config/locationservice/vc1-values.yaml b/tools/helm/config/locationservice/vc1-values.yaml index 38e89f0c..0e8245a3 100644 --- a/tools/helm/config/locationservice/vc1-values.yaml +++ b/tools/helm/config/locationservice/vc1-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-vc1-secrets PharmaNet_PharmanetProxy__Password: common-vc1-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-vc1-secrets + HEALTH_CHECK_CLIENT_ID: common-vc1-secrets + HEALTH_CHECK_CLIENT_SECRET: common-vc1-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-vc1-secrets OpenShift: Environment: vc1 @@ -16,8 +19,8 @@ image: resources: limits: - cpu: 100m - memory: 200Mi + cpu: 10m + memory: 256Mi requests: - cpu: 1m - memory: 100Mi + cpu: 5m + memory: 128Mi diff --git a/tools/helm/config/locationservice/vc2-values.yaml b/tools/helm/config/locationservice/vc2-values.yaml index 6160b818..a2f5e777 100644 --- a/tools/helm/config/locationservice/vc2-values.yaml +++ b/tools/helm/config/locationservice/vc2-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-vc2-secrets PharmaNet_PharmanetProxy__Password: common-vc2-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-vc2-secrets + HEALTH_CHECK_CLIENT_ID: common-vc2-secrets + HEALTH_CHECK_CLIENT_SECRET: common-vc2-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-vc2-secrets OpenShift: Environment: vc2 @@ -16,8 +19,8 @@ image: resources: limits: - cpu: 100m - memory: 200Mi + cpu: 10m + memory: 256Mi requests: - cpu: 1m - memory: 100Mi + cpu: 5m + memory: 128Mi diff --git a/tools/helm/config/locationservice/vs1-values.yaml b/tools/helm/config/locationservice/vs1-values.yaml index 1895432c..c005ce18 100644 --- a/tools/helm/config/locationservice/vs1-values.yaml +++ b/tools/helm/config/locationservice/vs1-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-vs1-secrets PharmaNet_PharmanetProxy__Password: common-vs1-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-vs1-secrets + HEALTH_CHECK_CLIENT_ID: common-vs1-secrets + HEALTH_CHECK_CLIENT_SECRET: common-vs1-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-vs1-secrets OpenShift: Environment: vs1 @@ -16,8 +19,8 @@ image: resources: limits: - cpu: 100m - memory: 200Mi + cpu: 10m + memory: 256Mi requests: - cpu: 1m - memory: 100Mi + cpu: 5m + memory: 128Mi diff --git a/tools/helm/config/medicationdispenseservice/dev-values.yaml b/tools/helm/config/medicationdispenseservice/dev-values.yaml index 8cdfdeca..a3991613 100644 --- a/tools/helm/config/medicationdispenseservice/dev-values.yaml +++ b/tools/helm/config/medicationdispenseservice/dev-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-dev-secrets PharmaNet_PharmanetProxy__Password: common-dev-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-dev-secrets + HEALTH_CHECK_CLIENT_ID: common-dev-secrets + HEALTH_CHECK_CLIENT_SECRET: common-dev-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-dev-secrets OpenShift: Environment: dev @@ -16,10 +19,8 @@ image: resources: limits: - cpu: 16m + cpu: 10m memory: 256Mi requests: - cpu: 2m + cpu: 5m memory: 128Mi - -replicaCount: 1 diff --git a/tools/helm/config/medicationdispenseservice/prd-values.yaml b/tools/helm/config/medicationdispenseservice/prd-values.yaml index 8f65976b..e3f00419 100644 --- a/tools/helm/config/medicationdispenseservice/prd-values.yaml +++ b/tools/helm/config/medicationdispenseservice/prd-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-prd-secrets PharmaNet_PharmanetProxy__Password: common-prd-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-prd-secrets + HEALTH_CHECK_CLIENT_ID: common-prd-secrets + HEALTH_CHECK_CLIENT_SECRET: common-prd-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-prd-secrets OpenShift: Environment: prd @@ -22,4 +25,5 @@ resources: cpu: 8m memory: 128Mi -replicaCount: 2 +deploymentSpec: + replicas: 2 diff --git a/tools/helm/config/medicationdispenseservice/tr1-values.yaml b/tools/helm/config/medicationdispenseservice/tr1-values.yaml index 80eb37ee..7521a6e3 100644 --- a/tools/helm/config/medicationdispenseservice/tr1-values.yaml +++ b/tools/helm/config/medicationdispenseservice/tr1-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-tr1-secrets PharmaNet_PharmanetProxy__Password: common-tr1-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-tr1-secrets + HEALTH_CHECK_CLIENT_ID: common-tr1-secrets + HEALTH_CHECK_CLIENT_SECRET: common-tr1-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-tr1-secrets OpenShift: Environment: tr1 @@ -16,8 +19,8 @@ image: resources: limits: - cpu: 100m - memory: 200Mi + cpu: 10m + memory: 256Mi requests: - cpu: 1m - memory: 100Mi + cpu: 5m + memory: 128Mi diff --git a/tools/helm/config/medicationdispenseservice/vc1-values.yaml b/tools/helm/config/medicationdispenseservice/vc1-values.yaml index 8861e5ef..c21e013b 100644 --- a/tools/helm/config/medicationdispenseservice/vc1-values.yaml +++ b/tools/helm/config/medicationdispenseservice/vc1-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-vc1-secrets PharmaNet_PharmanetProxy__Password: common-vc1-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-vc1-secrets + HEALTH_CHECK_CLIENT_ID: common-vc1-secrets + HEALTH_CHECK_CLIENT_SECRET: common-vc1-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-vc1-secrets OpenShift: Environment: vc1 @@ -16,8 +19,8 @@ image: resources: limits: - cpu: 100m - memory: 200Mi + cpu: 10m + memory: 256Mi requests: - cpu: 1m - memory: 100Mi + cpu: 5m + memory: 128Mi diff --git a/tools/helm/config/medicationdispenseservice/vc2-values.yaml b/tools/helm/config/medicationdispenseservice/vc2-values.yaml index 3724b2af..2ed9c3e4 100644 --- a/tools/helm/config/medicationdispenseservice/vc2-values.yaml +++ b/tools/helm/config/medicationdispenseservice/vc2-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-vc2-secrets PharmaNet_PharmanetProxy__Password: common-vc2-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-vc2-secrets + HEALTH_CHECK_CLIENT_ID: common-vc2-secrets + HEALTH_CHECK_CLIENT_SECRET: common-vc2-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-vc2-secrets OpenShift: Environment: vc2 @@ -16,8 +19,8 @@ image: resources: limits: - cpu: 100m - memory: 200Mi + cpu: 10m + memory: 256Mi requests: - cpu: 1m - memory: 100Mi + cpu: 5m + memory: 128Mi diff --git a/tools/helm/config/medicationdispenseservice/vs1-values.yaml b/tools/helm/config/medicationdispenseservice/vs1-values.yaml index 3b22b5f8..f814d010 100644 --- a/tools/helm/config/medicationdispenseservice/vs1-values.yaml +++ b/tools/helm/config/medicationdispenseservice/vs1-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-vs1-secrets PharmaNet_PharmanetProxy__Password: common-vs1-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-vs1-secrets + HEALTH_CHECK_CLIENT_ID: common-vs1-secrets + HEALTH_CHECK_CLIENT_SECRET: common-vs1-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-vs1-secrets OpenShift: Environment: vs1 @@ -16,8 +19,8 @@ image: resources: limits: - cpu: 100m - memory: 200Mi + cpu: 10m + memory: 256Mi requests: - cpu: 1m - memory: 100Mi + cpu: 5m + memory: 128Mi diff --git a/tools/helm/config/medicationrequestservice/dev-values.yaml b/tools/helm/config/medicationrequestservice/dev-values.yaml index 2f8146f1..77a3e804 100644 --- a/tools/helm/config/medicationrequestservice/dev-values.yaml +++ b/tools/helm/config/medicationrequestservice/dev-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-dev-secrets PharmaNet_PharmanetProxy__Password: common-dev-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-dev-secrets + HEALTH_CHECK_CLIENT_ID: common-dev-secrets + HEALTH_CHECK_CLIENT_SECRET: common-dev-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-dev-secrets OpenShift: Environment: dev @@ -16,10 +19,8 @@ image: resources: limits: - cpu: 16m + cpu: 10m memory: 256Mi requests: - cpu: 2m + cpu: 5m memory: 128Mi - -replicaCount: 1 diff --git a/tools/helm/config/medicationrequestservice/prd-values.yaml b/tools/helm/config/medicationrequestservice/prd-values.yaml index 825d42bf..6f40d2a5 100644 --- a/tools/helm/config/medicationrequestservice/prd-values.yaml +++ b/tools/helm/config/medicationrequestservice/prd-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-prd-secrets PharmaNet_PharmanetProxy__Password: common-prd-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-prd-secrets + HEALTH_CHECK_CLIENT_ID: common-prd-secrets + HEALTH_CHECK_CLIENT_SECRET: common-prd-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-prd-secrets OpenShift: Environment: prd @@ -22,4 +25,5 @@ resources: cpu: 60m memory: 128Mi -replicaCount: 8 +deploymentSpec: + replicas: 8 diff --git a/tools/helm/config/medicationrequestservice/tr1-values.yaml b/tools/helm/config/medicationrequestservice/tr1-values.yaml index a8bff98b..bcac388e 100644 --- a/tools/helm/config/medicationrequestservice/tr1-values.yaml +++ b/tools/helm/config/medicationrequestservice/tr1-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-tr1-secrets PharmaNet_PharmanetProxy__Password: common-tr1-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-tr1-secrets + HEALTH_CHECK_CLIENT_ID: common-tr1-secrets + HEALTH_CHECK_CLIENT_SECRET: common-tr1-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-tr1-secrets OpenShift: Environment: tr1 @@ -16,8 +19,8 @@ image: resources: limits: - cpu: 100m - memory: 200Mi + cpu: 10m + memory: 256Mi requests: - cpu: 1m - memory: 100Mi + cpu: 5m + memory: 128Mi diff --git a/tools/helm/config/medicationrequestservice/vc1-values.yaml b/tools/helm/config/medicationrequestservice/vc1-values.yaml index 95a35af0..cac08baa 100644 --- a/tools/helm/config/medicationrequestservice/vc1-values.yaml +++ b/tools/helm/config/medicationrequestservice/vc1-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-vc1-secrets PharmaNet_PharmanetProxy__Password: common-vc1-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-vc1-secrets + HEALTH_CHECK_CLIENT_ID: common-vc1-secrets + HEALTH_CHECK_CLIENT_SECRET: common-vc1-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-vc1-secrets OpenShift: Environment: vc1 @@ -16,8 +19,8 @@ image: resources: limits: - cpu: 100m - memory: 200Mi + cpu: 10m + memory: 256Mi requests: - cpu: 1m - memory: 100Mi + cpu: 5m + memory: 128Mi diff --git a/tools/helm/config/medicationrequestservice/vc2-values.yaml b/tools/helm/config/medicationrequestservice/vc2-values.yaml index 2eb55b57..ea6d38cc 100644 --- a/tools/helm/config/medicationrequestservice/vc2-values.yaml +++ b/tools/helm/config/medicationrequestservice/vc2-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-vc2-secrets PharmaNet_PharmanetProxy__Password: common-vc2-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-vc2-secrets + HEALTH_CHECK_CLIENT_ID: common-vc2-secrets + HEALTH_CHECK_CLIENT_SECRET: common-vc2-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-vc2-secrets OpenShift: Environment: vc2 @@ -16,8 +19,8 @@ image: resources: limits: - cpu: 100m - memory: 200Mi + cpu: 10m + memory: 256Mi requests: - cpu: 1m - memory: 100Mi + cpu: 5m + memory: 128Mi diff --git a/tools/helm/config/medicationrequestservice/vs1-values.yaml b/tools/helm/config/medicationrequestservice/vs1-values.yaml index 012506ee..6919cd54 100644 --- a/tools/helm/config/medicationrequestservice/vs1-values.yaml +++ b/tools/helm/config/medicationrequestservice/vs1-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-vs1-secrets PharmaNet_PharmanetProxy__Password: common-vs1-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-vs1-secrets + HEALTH_CHECK_CLIENT_ID: common-vs1-secrets + HEALTH_CHECK_CLIENT_SECRET: common-vs1-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-vs1-secrets OpenShift: Environment: vs1 @@ -16,8 +19,8 @@ image: resources: limits: - cpu: 100m - memory: 200Mi + cpu: 10m + memory: 256Mi requests: - cpu: 1m - memory: 100Mi + cpu: 5m + memory: 128Mi diff --git a/tools/helm/config/medicationservice/dev-values.yaml b/tools/helm/config/medicationservice/dev-values.yaml index 907f78c3..7e8fb30f 100644 --- a/tools/helm/config/medicationservice/dev-values.yaml +++ b/tools/helm/config/medicationservice/dev-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-dev-secrets PharmaNet_PharmanetProxy__Password: common-dev-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-dev-secrets + HEALTH_CHECK_CLIENT_ID: common-dev-secrets + HEALTH_CHECK_CLIENT_SECRET: common-dev-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-dev-secrets OpenShift: Environment: dev @@ -16,10 +19,8 @@ image: resources: limits: - cpu: 16m + cpu: 10m memory: 256Mi requests: - cpu: 2m + cpu: 5m memory: 128Mi - -replicaCount: 1 diff --git a/tools/helm/config/medicationservice/prd-values.yaml b/tools/helm/config/medicationservice/prd-values.yaml index 655952ef..4f0d014f 100644 --- a/tools/helm/config/medicationservice/prd-values.yaml +++ b/tools/helm/config/medicationservice/prd-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-prd-secrets PharmaNet_PharmanetProxy__Password: common-prd-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-prd-secrets + HEALTH_CHECK_CLIENT_ID: common-prd-secrets + HEALTH_CHECK_CLIENT_SECRET: common-prd-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-prd-secrets OpenShift: Environment: prd @@ -22,4 +25,5 @@ resources: cpu: 8m memory: 128Mi -replicaCount: 2 +deploymentSpec: + replicas: 2 diff --git a/tools/helm/config/medicationservice/tr1-values.yaml b/tools/helm/config/medicationservice/tr1-values.yaml index 4309dfaf..6dfa1a39 100644 --- a/tools/helm/config/medicationservice/tr1-values.yaml +++ b/tools/helm/config/medicationservice/tr1-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-tr1-secrets PharmaNet_PharmanetProxy__Password: common-tr1-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-tr1-secrets + HEALTH_CHECK_CLIENT_ID: common-tr1-secrets + HEALTH_CHECK_CLIENT_SECRET: common-tr1-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-tr1-secrets OpenShift: Environment: tr1 @@ -16,8 +19,8 @@ image: resources: limits: - cpu: 100m - memory: 200Mi + cpu: 10m + memory: 256Mi requests: - cpu: 1m - memory: 100Mi + cpu: 5m + memory: 128Mi diff --git a/tools/helm/config/medicationservice/vc1-values.yaml b/tools/helm/config/medicationservice/vc1-values.yaml index c511a44b..ebb8dfc2 100644 --- a/tools/helm/config/medicationservice/vc1-values.yaml +++ b/tools/helm/config/medicationservice/vc1-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-vc1-secrets PharmaNet_PharmanetProxy__Password: common-vc1-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-vc1-secrets + HEALTH_CHECK_CLIENT_ID: common-vc1-secrets + HEALTH_CHECK_CLIENT_SECRET: common-vc1-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-vc1-secrets OpenShift: Environment: vc1 @@ -16,8 +19,8 @@ image: resources: limits: - cpu: 100m - memory: 200Mi + cpu: 10m + memory: 256Mi requests: - cpu: 1m - memory: 100Mi + cpu: 5m + memory: 128Mi diff --git a/tools/helm/config/medicationservice/vc2-values.yaml b/tools/helm/config/medicationservice/vc2-values.yaml index 51fea888..a5263cb5 100644 --- a/tools/helm/config/medicationservice/vc2-values.yaml +++ b/tools/helm/config/medicationservice/vc2-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-vc2-secrets PharmaNet_PharmanetProxy__Password: common-vc2-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-vc2-secrets + HEALTH_CHECK_CLIENT_ID: common-vc2-secrets + HEALTH_CHECK_CLIENT_SECRET: common-vc2-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-vc2-secrets OpenShift: Environment: vc2 @@ -16,8 +19,8 @@ image: resources: limits: - cpu: 100m - memory: 200Mi + cpu: 10m + memory: 256Mi requests: - cpu: 1m - memory: 100Mi + cpu: 5m + memory: 128Mi diff --git a/tools/helm/config/medicationservice/vs1-values.yaml b/tools/helm/config/medicationservice/vs1-values.yaml index a36fc1ba..09b99ee6 100644 --- a/tools/helm/config/medicationservice/vs1-values.yaml +++ b/tools/helm/config/medicationservice/vs1-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-vs1-secrets PharmaNet_PharmanetProxy__Password: common-vs1-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-vs1-secrets + HEALTH_CHECK_CLIENT_ID: common-vs1-secrets + HEALTH_CHECK_CLIENT_SECRET: common-vs1-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-vs1-secrets OpenShift: Environment: vs1 @@ -16,8 +19,8 @@ image: resources: limits: - cpu: 100m - memory: 200Mi + cpu: 10m + memory: 256Mi requests: - cpu: 1m - memory: 100Mi + cpu: 5m + memory: 128Mi diff --git a/tools/helm/config/medicationstatementservice/dev-values.yaml b/tools/helm/config/medicationstatementservice/dev-values.yaml index 0ad03549..bbd92ec1 100644 --- a/tools/helm/config/medicationstatementservice/dev-values.yaml +++ b/tools/helm/config/medicationstatementservice/dev-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-dev-secrets PharmaNet_PharmanetProxy__Password: common-dev-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-dev-secrets + HEALTH_CHECK_CLIENT_ID: common-dev-secrets + HEALTH_CHECK_CLIENT_SECRET: common-dev-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-dev-secrets OpenShift: Environment: dev @@ -16,10 +19,8 @@ image: resources: limits: - cpu: 16m + cpu: 10m memory: 256Mi requests: - cpu: 2m + cpu: 5m memory: 128Mi - -replicaCount: 1 diff --git a/tools/helm/config/medicationstatementservice/prd-values.yaml b/tools/helm/config/medicationstatementservice/prd-values.yaml index 91f5b70c..387894e2 100644 --- a/tools/helm/config/medicationstatementservice/prd-values.yaml +++ b/tools/helm/config/medicationstatementservice/prd-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-prd-secrets PharmaNet_PharmanetProxy__Password: common-prd-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-prd-secrets + HEALTH_CHECK_CLIENT_ID: common-prd-secrets + HEALTH_CHECK_CLIENT_SECRET: common-prd-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-prd-secrets OpenShift: Environment: prd @@ -22,4 +25,5 @@ resources: cpu: 45m memory: 128Mi -replicaCount: 4 +deploymentSpec: + replicas: 4 diff --git a/tools/helm/config/medicationstatementservice/tr1-values.yaml b/tools/helm/config/medicationstatementservice/tr1-values.yaml index cfb1993d..a6703b71 100644 --- a/tools/helm/config/medicationstatementservice/tr1-values.yaml +++ b/tools/helm/config/medicationstatementservice/tr1-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-tr1-secrets PharmaNet_PharmanetProxy__Password: common-tr1-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-tr1-secrets + HEALTH_CHECK_CLIENT_ID: common-tr1-secrets + HEALTH_CHECK_CLIENT_SECRET: common-tr1-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-tr1-secrets OpenShift: Environment: tr1 @@ -16,8 +19,8 @@ image: resources: limits: - cpu: 100m - memory: 200Mi + cpu: 10m + memory: 256Mi requests: - cpu: 1m - memory: 100Mi + cpu: 5m + memory: 128Mi diff --git a/tools/helm/config/medicationstatementservice/vc1-values.yaml b/tools/helm/config/medicationstatementservice/vc1-values.yaml index c24af8f9..37b4ec80 100644 --- a/tools/helm/config/medicationstatementservice/vc1-values.yaml +++ b/tools/helm/config/medicationstatementservice/vc1-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-vc1-secrets PharmaNet_PharmanetProxy__Password: common-vc1-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-vc1-secrets + HEALTH_CHECK_CLIENT_ID: common-vc1-secrets + HEALTH_CHECK_CLIENT_SECRET: common-vc1-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-vc1-secrets OpenShift: Environment: vc1 @@ -16,8 +19,8 @@ image: resources: limits: - cpu: 100m - memory: 200Mi + cpu: 10m + memory: 256Mi requests: - cpu: 1m - memory: 100Mi + cpu: 5m + memory: 128Mi diff --git a/tools/helm/config/medicationstatementservice/vc2-values.yaml b/tools/helm/config/medicationstatementservice/vc2-values.yaml index 257f7986..b8e7aeda 100644 --- a/tools/helm/config/medicationstatementservice/vc2-values.yaml +++ b/tools/helm/config/medicationstatementservice/vc2-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-vc2-secrets PharmaNet_PharmanetProxy__Password: common-vc2-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-vc2-secrets + HEALTH_CHECK_CLIENT_ID: common-vc2-secrets + HEALTH_CHECK_CLIENT_SECRET: common-vc2-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-vc2-secrets OpenShift: Environment: vc2 @@ -16,8 +19,8 @@ image: resources: limits: - cpu: 100m - memory: 200Mi + cpu: 10m + memory: 256Mi requests: - cpu: 1m - memory: 100Mi + cpu: 5m + memory: 128Mi diff --git a/tools/helm/config/medicationstatementservice/vs1-values.yaml b/tools/helm/config/medicationstatementservice/vs1-values.yaml index 05b135dd..58e3a43b 100644 --- a/tools/helm/config/medicationstatementservice/vs1-values.yaml +++ b/tools/helm/config/medicationstatementservice/vs1-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-vs1-secrets PharmaNet_PharmanetProxy__Password: common-vs1-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-vs1-secrets + HEALTH_CHECK_CLIENT_ID: common-vs1-secrets + HEALTH_CHECK_CLIENT_SECRET: common-vs1-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-vs1-secrets OpenShift: Environment: vs1 @@ -16,8 +19,8 @@ image: resources: limits: - cpu: 100m - memory: 200Mi + cpu: 10m + memory: 256Mi requests: - cpu: 1m - memory: 100Mi + cpu: 5m + memory: 128Mi diff --git a/tools/helm/config/patientservice/dev-values.yaml b/tools/helm/config/patientservice/dev-values.yaml index 6d035b46..173c8a53 100644 --- a/tools/helm/config/patientservice/dev-values.yaml +++ b/tools/helm/config/patientservice/dev-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-dev-secrets PharmaNet_PharmanetProxy__Password: common-dev-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-dev-secrets + HEALTH_CHECK_CLIENT_ID: common-dev-secrets + HEALTH_CHECK_CLIENT_SECRET: common-dev-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-dev-secrets OpenShift: Environment: dev @@ -16,10 +19,8 @@ image: resources: limits: - cpu: 16m + cpu: 10m memory: 256Mi requests: - cpu: 2m + cpu: 5m memory: 128Mi - -replicaCount: 1 diff --git a/tools/helm/config/patientservice/prd-values.yaml b/tools/helm/config/patientservice/prd-values.yaml index 57298d99..b87e5d9b 100644 --- a/tools/helm/config/patientservice/prd-values.yaml +++ b/tools/helm/config/patientservice/prd-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-prd-secrets PharmaNet_PharmanetProxy__Password: common-prd-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-prd-secrets + HEALTH_CHECK_CLIENT_ID: common-prd-secrets + HEALTH_CHECK_CLIENT_SECRET: common-prd-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-prd-secrets OpenShift: Environment: prd @@ -22,4 +25,5 @@ resources: cpu: 16m memory: 128Mi -replicaCount: 2 +deploymentSpec: + replicas: 2 diff --git a/tools/helm/config/patientservice/tr1-values.yaml b/tools/helm/config/patientservice/tr1-values.yaml index b306b41e..ab3a1a01 100644 --- a/tools/helm/config/patientservice/tr1-values.yaml +++ b/tools/helm/config/patientservice/tr1-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-tr1-secrets PharmaNet_PharmanetProxy__Password: common-tr1-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-tr1-secrets + HEALTH_CHECK_CLIENT_ID: common-tr1-secrets + HEALTH_CHECK_CLIENT_SECRET: common-tr1-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-tr1-secrets OpenShift: Environment: tr1 @@ -16,8 +19,8 @@ image: resources: limits: - cpu: 100m - memory: 200Mi + cpu: 10m + memory: 256Mi requests: - cpu: 1m - memory: 100Mi + cpu: 5m + memory: 128Mi diff --git a/tools/helm/config/patientservice/vc1-values.yaml b/tools/helm/config/patientservice/vc1-values.yaml index 8e1783ad..c8c2242b 100644 --- a/tools/helm/config/patientservice/vc1-values.yaml +++ b/tools/helm/config/patientservice/vc1-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-vc1-secrets PharmaNet_PharmanetProxy__Password: common-vc1-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-vc1-secrets + HEALTH_CHECK_CLIENT_ID: common-vc1-secrets + HEALTH_CHECK_CLIENT_SECRET: common-vc1-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-vc1-secrets OpenShift: Environment: vc1 @@ -16,8 +19,8 @@ image: resources: limits: - cpu: 100m - memory: 200Mi + cpu: 10m + memory: 256Mi requests: - cpu: 1m - memory: 100Mi + cpu: 5m + memory: 128Mi diff --git a/tools/helm/config/patientservice/vc2-values.yaml b/tools/helm/config/patientservice/vc2-values.yaml index f2ec8acb..b703aec2 100644 --- a/tools/helm/config/patientservice/vc2-values.yaml +++ b/tools/helm/config/patientservice/vc2-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-vc2-secrets PharmaNet_PharmanetProxy__Password: common-vc2-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-vc2-secrets + HEALTH_CHECK_CLIENT_ID: common-vc2-secrets + HEALTH_CHECK_CLIENT_SECRET: common-vc2-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-vc2-secrets OpenShift: Environment: vc2 @@ -16,8 +19,8 @@ image: resources: limits: - cpu: 100m - memory: 200Mi + cpu: 10m + memory: 256Mi requests: - cpu: 1m - memory: 100Mi + cpu: 5m + memory: 128Mi diff --git a/tools/helm/config/patientservice/vs1-values.yaml b/tools/helm/config/patientservice/vs1-values.yaml index 7bdc42fc..230fb8b4 100644 --- a/tools/helm/config/patientservice/vs1-values.yaml +++ b/tools/helm/config/patientservice/vs1-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-vs1-secrets PharmaNet_PharmanetProxy__Password: common-vs1-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-vs1-secrets + HEALTH_CHECK_CLIENT_ID: common-vs1-secrets + HEALTH_CHECK_CLIENT_SECRET: common-vs1-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-vs1-secrets OpenShift: Environment: vs1 @@ -16,8 +19,8 @@ image: resources: limits: - cpu: 100m - memory: 200Mi + cpu: 10m + memory: 256Mi requests: - cpu: 1m - memory: 100Mi + cpu: 5m + memory: 128Mi diff --git a/tools/helm/config/practitionerservice/dev-values.yaml b/tools/helm/config/practitionerservice/dev-values.yaml index 1c256fd4..ec84f7a0 100644 --- a/tools/helm/config/practitionerservice/dev-values.yaml +++ b/tools/helm/config/practitionerservice/dev-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-dev-secrets PharmaNet_PharmanetProxy__Password: common-dev-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-dev-secrets + HEALTH_CHECK_CLIENT_ID: common-dev-secrets + HEALTH_CHECK_CLIENT_SECRET: common-dev-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-dev-secrets OpenShift: Environment: dev @@ -16,10 +19,8 @@ image: resources: limits: - cpu: 16m + cpu: 10m memory: 256Mi requests: - cpu: 2m + cpu: 5m memory: 128Mi - -replicaCount: 1 diff --git a/tools/helm/config/practitionerservice/prd-values.yaml b/tools/helm/config/practitionerservice/prd-values.yaml index 572c9dc5..2d0220d3 100644 --- a/tools/helm/config/practitionerservice/prd-values.yaml +++ b/tools/helm/config/practitionerservice/prd-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-prd-secrets PharmaNet_PharmanetProxy__Password: common-prd-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-prd-secrets + HEALTH_CHECK_CLIENT_ID: common-prd-secrets + HEALTH_CHECK_CLIENT_SECRET: common-prd-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-prd-secrets OpenShift: Environment: prd @@ -22,4 +25,5 @@ resources: cpu: 8m memory: 128Mi -replicaCount: 2 +deploymentSpec: + replicas: 2 diff --git a/tools/helm/config/practitionerservice/tr1-values.yaml b/tools/helm/config/practitionerservice/tr1-values.yaml index cada6dae..f015aa0a 100644 --- a/tools/helm/config/practitionerservice/tr1-values.yaml +++ b/tools/helm/config/practitionerservice/tr1-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-tr1-secrets PharmaNet_PharmanetProxy__Password: common-tr1-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-tr1-secrets + HEALTH_CHECK_CLIENT_ID: common-tr1-secrets + HEALTH_CHECK_CLIENT_SECRET: common-tr1-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-tr1-secrets OpenShift: Environment: tr1 @@ -16,8 +19,8 @@ image: resources: limits: - cpu: 100m - memory: 200Mi + cpu: 10m + memory: 256Mi requests: - cpu: 1m - memory: 100Mi + cpu: 5m + memory: 128Mi diff --git a/tools/helm/config/practitionerservice/vc1-values.yaml b/tools/helm/config/practitionerservice/vc1-values.yaml index dcd5da0a..d29bc693 100644 --- a/tools/helm/config/practitionerservice/vc1-values.yaml +++ b/tools/helm/config/practitionerservice/vc1-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-vc1-secrets PharmaNet_PharmanetProxy__Password: common-vc1-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-vc1-secrets + HEALTH_CHECK_CLIENT_ID: common-vc1-secrets + HEALTH_CHECK_CLIENT_SECRET: common-vc1-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-vc1-secrets OpenShift: Environment: vc1 @@ -16,8 +19,8 @@ image: resources: limits: - cpu: 100m - memory: 200Mi + cpu: 10m + memory: 256Mi requests: - cpu: 1m - memory: 100Mi + cpu: 5m + memory: 128Mi diff --git a/tools/helm/config/practitionerservice/vc2-values.yaml b/tools/helm/config/practitionerservice/vc2-values.yaml index a5971892..87497b70 100644 --- a/tools/helm/config/practitionerservice/vc2-values.yaml +++ b/tools/helm/config/practitionerservice/vc2-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-vc2-secrets PharmaNet_PharmanetProxy__Password: common-vc2-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-vc2-secrets + HEALTH_CHECK_CLIENT_ID: common-vc2-secrets + HEALTH_CHECK_CLIENT_SECRET: common-vc2-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-vc2-secrets OpenShift: Environment: vc2 @@ -16,8 +19,8 @@ image: resources: limits: - cpu: 100m - memory: 200Mi + cpu: 10m + memory: 256Mi requests: - cpu: 1m - memory: 100Mi + cpu: 5m + memory: 128Mi diff --git a/tools/helm/config/practitionerservice/vs1-values.yaml b/tools/helm/config/practitionerservice/vs1-values.yaml index 270d0d3d..2f78c862 100644 --- a/tools/helm/config/practitionerservice/vs1-values.yaml +++ b/tools/helm/config/practitionerservice/vs1-values.yaml @@ -6,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: common-vs1-secrets PharmaNet_PharmanetProxy__Password: common-vs1-secrets PharmaNet_PharmanetProxy__ClientCertificatePassword: common-vs1-secrets + HEALTH_CHECK_CLIENT_ID: common-vs1-secrets + HEALTH_CHECK_CLIENT_SECRET: common-vs1-secrets + PharmaNet_PharmanetProxy__HealthCheckEndpoint: common-vs1-secrets OpenShift: Environment: vs1 @@ -16,8 +19,8 @@ image: resources: limits: - cpu: 100m - memory: 200Mi + cpu: 10m + memory: 256Mi requests: - cpu: 1m - memory: 100Mi + cpu: 5m + memory: 128Mi diff --git a/tools/helm/deploy.sh b/tools/helm/deploy.sh index 41afd851..d6a36a38 100755 --- a/tools/helm/deploy.sh +++ b/tools/helm/deploy.sh @@ -54,10 +54,13 @@ basedir=$(dirname $0) # The list of services services=("claim" "consent" "location" "medicationdispense" "medicationrequest" "medication" "medicationstatement" "patient" "practitioner") +# Deploy the pnet-proxy container used for health checks +helm $helmCommand -n $namespace pnet-proxy-${environment} ${basedir}/pnet-proxy/ + # Deploy the common secrets that each PPM API service references -helm $helmCommand -n $namespace -f ${basedir}/config/common/${environment}-values.yaml common-${environment} ${basedir}/common +helm $helmCommand -n $namespace -f ${basedir}/config/common/${environment}-values.yaml common-${environment} ${basedir}/common/ # Deploy the PPM API services for service in ${services[@]}; do - helm $helmCommand -n $namespace -f ${basedir}/config/${service}service/${environment}-values.yaml ${service}service-${environment} ${basedir}/ppmservice + helm $helmCommand -n $namespace -f ${basedir}/config/${service}service/${environment}-values.yaml ${service}service-${environment} ${basedir}/ppmservice/ done diff --git a/tools/helm/pnet-proxy/templates/deployment.yaml b/tools/helm/pnet-proxy/templates/deployment.yaml index fdb14d90..2ca25e78 100644 --- a/tools/helm/pnet-proxy/templates/deployment.yaml +++ b/tools/helm/pnet-proxy/templates/deployment.yaml @@ -25,4 +25,4 @@ spec: - containerPort: 8080 protocol: TCP strategy: - type: Recreate + type: RollingUpdate diff --git a/tools/helm/ppmservice/Chart.yaml b/tools/helm/ppmservice/Chart.yaml index 6aadc90d..472c90bc 100644 --- a/tools/helm/ppmservice/Chart.yaml +++ b/tools/helm/ppmservice/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: ppmservice -description: Deploys a PPM service. +description: Deploys a PNET API service type: application -version: 0.1.0 +version: 1.0.0 appVersion: "1.0.0" diff --git a/tools/helm/ppmservice/templates/_helpers.tpl b/tools/helm/ppmservice/templates/_helpers.tpl index 8d3cf341..285fdb1f 100644 --- a/tools/helm/ppmservice/templates/_helpers.tpl +++ b/tools/helm/ppmservice/templates/_helpers.tpl @@ -34,6 +34,7 @@ Create chart name and version as used by the chart label. Common labels */}} {{- define "ppmservice.labels" -}} +env: {{ .Values.OpenShift.Environment }} helm.sh/chart: {{ include "ppmservice.chart" . }} {{ include "ppmservice.selectorLabels" . }} {{- end }} diff --git a/tools/helm/ppmservice/templates/deployment.yaml b/tools/helm/ppmservice/templates/deployment.yaml index aa2f3780..dce87b32 100644 --- a/tools/helm/ppmservice/templates/deployment.yaml +++ b/tools/helm/ppmservice/templates/deployment.yaml @@ -1,27 +1,21 @@ -kind: DeploymentConfig -apiVersion: apps.openshift.io/v1 +apiVersion: apps/v1 +kind: Deployment metadata: name: {{ include "ppmservice.fullname" . }} labels: {{- include "ppmservice.labels" . | nindent 4 }} spec: - replicas: {{ .Values.replicaCount }} + replicas: {{ .Values.deploymentSpec.replicas }} selector: - deploymentconfig: {{ include "ppmservice.fullname" . }} - {{- include "ppmservice.selectorLabels" . | nindent 4 }} + matchLabels: + deployment: {{ include "ppmservice.fullname" . }} + {{- include "ppmservice.selectorLabels" . | nindent 6 }} + progressDeadlineSeconds: {{ .Values.deploymentSpec.progressDeadlineSeconds }} strategy: - activeDeadlineSeconds: 21600 - resources: - limits: - cpu: {{ .Values.deployment.strategy.resources.limits.cpu }} - memory: {{ .Values.deployment.strategy.resources.limits.memory }} - rollingParams: - intervalSeconds: 1 - maxSurge: {{ .Values.deployment.strategy.rollingParams.maxSurge }} - maxUnavailable: {{ .Values.deployment.strategy.rollingParams.maxUnavailable }} - timeoutSeconds: {{ .Values.deployment.strategy.rollingParams.timeoutSeconds }} - updatePeriodSeconds: 1 - type: {{ .Values.deployment.strategy.type }} + rollingUpdate: + maxSurge: {{ .Values.deploymentSpec.strategy.rollingUpdate.maxSurge }} + maxUnavailable: {{ .Values.deploymentSpec.strategy.rollingUpdate.maxUnavailable }} + type: RollingUpdate template: metadata: {{- with .Values.podAnnotations }} @@ -30,11 +24,12 @@ spec: {{- end }} labels: {{- include "ppmservice.selectorLabels" . | nindent 8 }} - deploymentconfig: {{ include "ppmservice.fullname" . }} + deployment: {{ include "ppmservice.fullname" . }} spec: automountServiceAccountToken: false containers: - name: {{ .Values.image.stream }} + image: 'image-registry.openshift-image-registry.svc:5000/{{ .Values.OpenShift.ImageProject }}/{{ .Values.image.stream }}:{{ .Values.OpenShift.Environment }}' resources: limits: cpu: {{ .Values.resources.limits.cpu }} @@ -66,16 +61,27 @@ spec: name: {{ $secret }} key: {{ $key }} {{- end }} + startupProbe: + periodSeconds: 60 + timeoutSeconds: 10 + successThreshold: 1 + failureThreshold: 10 + exec: + command: + - './health-check.sh' readinessProbe: - failureThreshold: 3 - httpGet: - path: /health - port: {{ .Values.Application.Port }} - scheme: HTTP - initialDelaySeconds: 10 periodSeconds: 20 - successThreshold: 1 - timeoutSeconds: 4 + timeoutSeconds: 10 + successThreshold: 3 + exec: + command: + - './health-check.sh' + lifecycle: + preStop: + exec: + command: + - 'sleep' + - '10' terminationMessagePath: /{{ include "ppmservice.fullname" . }}/termination-log terminationMessagePolicy: File volumeMounts: @@ -86,22 +92,9 @@ spec: restartPolicy: Always schedulerName: default-scheduler securityContext: {} - terminationGracePeriodSeconds: 30 + terminationGracePeriodSeconds: 60 volumes: - name: volume-pharmanet-cert configMap: name: pharmanet-{{ .Values.OpenShift.Environment }}-cert defaultMode: 420 - test: false - triggers: - - type: ImageChange - imageChangeParams: - automatic: true - containerNames: - - {{ .Values.image.stream }} - from: - kind: ImageStreamTag - name: {{ .Values.image.stream }}:{{ .Values.OpenShift.Environment }} - namespace: {{ .Values.OpenShift.ImageProject }} - - type: ConfigChange - \ No newline at end of file diff --git a/tools/helm/ppmservice/templates/service.yaml b/tools/helm/ppmservice/templates/service.yaml index 56f78269..ad7efb85 100644 --- a/tools/helm/ppmservice/templates/service.yaml +++ b/tools/helm/ppmservice/templates/service.yaml @@ -13,4 +13,4 @@ spec: protocol: TCP selector: {{- include "ppmservice.selectorLabels" . | nindent 4 }} - deploymentconfig: {{ include "ppmservice.fullname" . }} + deployment: {{ include "ppmservice.fullname" . }} diff --git a/tools/helm/ppmservice/values.yaml b/tools/helm/ppmservice/values.yaml index 578dea8d..1ccf1f2f 100644 --- a/tools/helm/ppmservice/values.yaml +++ b/tools/helm/ppmservice/values.yaml @@ -1,5 +1,3 @@ -replicaCount: 1 - Application: Port: 8080 Configuration: {} @@ -8,6 +6,9 @@ Application: PharmaNet_PharmanetProxy__Username: ${common-secrets} PharmaNet_PharmanetProxy__Password: ${common-secrets} PharmaNet_PharmanetProxy__ClientCertificatePassword: ${common-secrets} + HEALTH_CHECK_CLIENT_ID: ${common-secrets} + HEALTH_CHECK_CLIENT_SECRET: ${common-secrets} + PharmaNet_PharmanetProxy__HealthCheckEndpoint: ${common-secrets} Environment: ASPNETCORE_ENVIRONMENT: ${ASPNETCORE_ENVIRONMENT} @@ -27,17 +28,13 @@ podAnnotations: {} service: port: 8080 -deployment: +deploymentSpec: + replicas: 1 + progressDeadlineSeconds: 21600 strategy: - resources: - limits: - cpu: 500m - memory: 512Mi - rollingParams: + rollingUpdate: maxSurge: 25% maxUnavailable: 25% - timeoutSeconds: 600 - type: Rolling resources: limits: