Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

kie-kogito-serverless-operator-491: Make the Operator configure the Jobs Service Leader liveness check #523

Merged
merged 1 commit into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions controllers/platform/services/properties_services_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ func generateJobServiceDeploymentDevProperties() *properties.Properties {
p.Set("quarkus.http.port", "8080")
p.Set("quarkus.kogito.devservices.enabled", "false")
p.Set(`quarkus.smallrye-health.check."org.kie.kogito.jobs.service.messaging.http.health.knative.KSinkInjectionHealthCheck".enabled`, "false")
p.Set(`quarkus.smallrye-health.check."org.kie.kogito.jobs.service.management.JobServiceLeaderLivenessHealthCheck".enabled`, "true")
p.Set("kogito.jobs-service.management.leader-check.expiration-in-seconds", "60")
p.Sort()
return p
}
Expand All @@ -128,6 +130,8 @@ func generateJobServiceDeploymentWithPostgreSQLProperties() *properties.Properti
p.Set("quarkus.kogito.devservices.enabled", "false")
p.Set(`quarkus.smallrye-health.check."org.kie.kogito.jobs.service.messaging.http.health.knative.KSinkInjectionHealthCheck".enabled`, "false")
p.Set("quarkus.datasource.reactive.url", "postgresql://postgres:5432/sonataflow?search_path=myschema")
p.Set(`quarkus.smallrye-health.check."org.kie.kogito.jobs.service.management.JobServiceLeaderLivenessHealthCheck".enabled`, "true")
p.Set("kogito.jobs-service.management.leader-check.expiration-in-seconds", "60")
p.Sort()
return p
}
Expand All @@ -142,6 +146,8 @@ func generateJobServiceDeploymentWithDataIndexAndEphemeralProperties() *properti
p.Set("quarkus.http.port", "8080")
p.Set("quarkus.kogito.devservices.enabled", "false")
p.Set(`quarkus.smallrye-health.check."org.kie.kogito.jobs.service.messaging.http.health.knative.KSinkInjectionHealthCheck".enabled`, "false")
p.Set(`quarkus.smallrye-health.check."org.kie.kogito.jobs.service.management.JobServiceLeaderLivenessHealthCheck".enabled`, "true")
p.Set("kogito.jobs-service.management.leader-check.expiration-in-seconds", "60")
p.Sort()
return p
}
Expand All @@ -157,6 +163,8 @@ func generateJobServiceDeploymentWithDataIndexAndPostgreSQLProperties() *propert
p.Set("quarkus.kogito.devservices.enabled", "false")
p.Set(`quarkus.smallrye-health.check."org.kie.kogito.jobs.service.messaging.http.health.knative.KSinkInjectionHealthCheck".enabled`, "false")
p.Set("quarkus.datasource.reactive.url", "postgresql://postgres:5432/sonataflow?search_path=myschema")
p.Set(`quarkus.smallrye-health.check."org.kie.kogito.jobs.service.management.JobServiceLeaderLivenessHealthCheck".enabled`, "true")
p.Set("kogito.jobs-service.management.leader-check.expiration-in-seconds", "60")
p.Sort()
return p
}
Expand Down
2 changes: 2 additions & 0 deletions controllers/platform/services/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,8 @@ func (j JobServiceHandler) GenerateServiceProperties() (*properties.Properties,
props := properties.NewProperties()
props.Set(constants.KogitoServiceURLProperty, GenerateServiceURL(constants.KogitoServiceURLProtocol, j.platform.Namespace, j.GetServiceName()))
props.Set(constants.JobServiceKafkaSmallRyeHealthProperty, "false")
props.Set(constants.JobServiceLeaderLivenessSmallRyeHealthProperty, "true")
props.Set(constants.JobServiceLeaderCheckExpirationInSeconds, constants.DefaultJobServiceLeaderCheckExpirationInSeconds)
// add data source reactive URL
if j.hasPostgreSQLConfigured() {
p := persistence.RetrievePostgreSQLConfiguration(j.platform.Spec.Services.JobService.Persistence, j.platform.Spec.Persistence, j.GetServiceName())
Expand Down
27 changes: 15 additions & 12 deletions controllers/profiles/common/constants/platform_services.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@ const (

ConfigMapWorkflowPropsVolumeName = "workflow-properties"

JobServiceRequestEventsURL = "mp.messaging.outgoing.kogito-job-service-job-request-events.url"
JobServiceRequestEventsConnector = "mp.messaging.outgoing.kogito-job-service-job-request-events.connector"
JobServiceStatusChangeEvents = "kogito.jobs-service.http.job-status-change-events"
JobServiceStatusChangeEventsURL = "mp.messaging.outgoing.kogito-job-service-job-status-events-http.url"
JobServiceURLProtocol = "http"
JobServiceDataSourceReactiveURL = "quarkus.datasource.reactive.url"
JobServiceJobEventsPath = "/v2/jobs/events"
JobServiceRequestEventsURL = "mp.messaging.outgoing.kogito-job-service-job-request-events.url"
JobServiceRequestEventsConnector = "mp.messaging.outgoing.kogito-job-service-job-request-events.connector"
JobServiceStatusChangeEvents = "kogito.jobs-service.http.job-status-change-events"
JobServiceStatusChangeEventsURL = "mp.messaging.outgoing.kogito-job-service-job-status-events-http.url"
JobServiceURLProtocol = "http"
JobServiceDataSourceReactiveURL = "quarkus.datasource.reactive.url"
JobServiceJobEventsPath = "/v2/jobs/events"
JobServiceLeaderCheckExpirationInSeconds = "kogito.jobs-service.management.leader-check.expiration-in-seconds"
DefaultJobServiceLeaderCheckExpirationInSeconds = "60"

KogitoProcessInstancesEventsURL = "mp.messaging.outgoing.kogito-processinstances-events.url"
KogitoProcessInstancesEventsEnabled = "kogito.events.processinstances.enabled"
Expand All @@ -49,11 +51,12 @@ const (
// of its start health check.
KogitoJobServiceHealthCheckEnabled = "kogito.jobs-service.health-enabled"
// KogitoJobServiceURL configures the jobs service, this value can be used internally by the workflow.
KogitoJobServiceURL = "kogito.jobs-service.url"
KogitoServiceURLProperty = "kogito.service.url"
KogitoServiceURLProtocol = "http"
DataIndexKafkaSmallRyeHealthProperty = `quarkus.smallrye-health.check."io.quarkus.kafka.client.health.KafkaHealthCheck".enabled`
JobServiceKafkaSmallRyeHealthProperty = `quarkus.smallrye-health.check."org.kie.kogito.jobs.service.messaging.http.health.knative.KSinkInjectionHealthCheck".enabled`
KogitoJobServiceURL = "kogito.jobs-service.url"
KogitoServiceURLProperty = "kogito.service.url"
KogitoServiceURLProtocol = "http"
DataIndexKafkaSmallRyeHealthProperty = `quarkus.smallrye-health.check."io.quarkus.kafka.client.health.KafkaHealthCheck".enabled`
JobServiceKafkaSmallRyeHealthProperty = `quarkus.smallrye-health.check."org.kie.kogito.jobs.service.messaging.http.health.knative.KSinkInjectionHealthCheck".enabled`
JobServiceLeaderLivenessSmallRyeHealthProperty = `quarkus.smallrye-health.check."org.kie.kogito.jobs.service.management.JobServiceLeaderLivenessHealthCheck".enabled`

DataIndexServiceName = "data-index-service"
JobServiceName = "jobs-service"
Expand Down
Loading