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

feat: add leader election configuration, disable max reconciliation #37

Merged
merged 2 commits into from
Oct 8, 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
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,21 @@ app:
fieldPath: metadata.namespace
serviceAccount:
enabled: true

operator:
keycloak:
client:
enabled: true
spec:
kcConfig:
defaultClientScopes: [ ocx-ws:write, ocx-pm-assignment:write, ocx-tn:write, ocx-th:write ]
defaultClientScopes: [ ocx-ws:write, ocx-pm:write, ocx-pm-assignment:write, ocx-tn:write, ocx-th:write, ocx-hp:write ]

----

x-th:write, ocx-hp:write ]

----

# Values: JOSDK_WATCH_CURRENT, JOSDK_ALL_NAMESPACES or comma separated list of namespaces
ted list of namespaces
watchNamespaces: "JOSDK_WATCH_CURRENT"
----

Original file line number Diff line number Diff line change
Expand Up @@ -11,38 +11,38 @@ h| Version
| tkit-quarkus-log-cdi

| https://1000kit.github.io/tkit-quarkus/current/tkit-quarkus/tkit-quarkus-log-cdi.html[Link]
| https://github.com/1000kit/tkit-quarkus/blob/2.31.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-log-cdi.adoc[Link]
| 2.31.0
| https://github.com/1000kit/tkit-quarkus/blob/2.33.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-log-cdi.adoc[Link]
| 2.33.0

| tkit-quarkus-log-rs

| https://1000kit.github.io/tkit-quarkus/current/tkit-quarkus/tkit-quarkus-log-rs.html[Link]
| https://github.com/1000kit/tkit-quarkus/blob/2.31.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-log-rs.adoc[Link]
| 2.31.0
| https://github.com/1000kit/tkit-quarkus/blob/2.33.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-log-rs.adoc[Link]
| 2.33.0

| tkit-quarkus-log-json

| https://1000kit.github.io/tkit-quarkus/current/tkit-quarkus/tkit-quarkus-log-json.html[Link]
| https://github.com/1000kit/tkit-quarkus/blob/2.31.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-log-json.adoc[Link]
| 2.31.0
| https://github.com/1000kit/tkit-quarkus/blob/2.33.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-log-json.adoc[Link]
| 2.33.0

| quarkus-arc

| https://quarkus.io/guides/cdi-reference[Link]
| https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-arc.adoc[Link]
| 3.13.2
| 3.15.1

| quarkus-micrometer-registry-prometheus

| https://quarkus.io/guides/telemetry-micrometer[Link]
| https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-micrometer-registry-prometheus.adoc[Link]
| 3.13.2
| 3.15.1

| quarkus-opentelemetry

| https://quarkus.io/guides/opentelemetry[Link]
| https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-opentelemetry.adoc[Link]
| 3.13.2
| 3.15.1

| quarkus-openapi-generator

Expand All @@ -54,43 +54,43 @@ h| Version

| https://quarkus.io/guides/rest-client[Link]
| https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-rest-client.adoc[Link]
| 3.13.2
| 3.15.1

| quarkus-rest-client-jackson

| https://quarkus.io/guides/rest-client[Link]
|
| 3.13.2
| 3.15.1

| quarkus-oidc

| https://quarkus.io/guides/security-oidc-bearer-token-authentication-tutorial[Link]
| https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-oidc.adoc[Link]
| 3.13.2
| 3.15.1

| tkit-quarkus-security

| https://1000kit.github.io/tkit-quarkus/current/tkit-quarkus/tkit-quarkus-security.html[Link]
| https://github.com/1000kit/tkit-quarkus/blob/2.31.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-security.adoc[Link]
| 2.31.0
| https://github.com/1000kit/tkit-quarkus/blob/2.33.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-security.adoc[Link]
| 2.33.0

| onecx-core

| https://onecx.github.io/docs/onecx-quarkus/current/onecx-quarkus/onecx-core.html[Link]
|
| 0.26.0
| 0.31.0

| quarkus-smallrye-health

| https://quarkus.io/guides/smallrye-health[Link]
| https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-smallrye-health.adoc[Link]
| 3.13.2
| 3.15.1

| quarkus-container-image-docker

| https://quarkus.io/guides/container-image[Link]
| https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-container-image-docker.adoc[Link]
| 3.13.2
| 3.15.1


| quarkus-operator-sdk-bundle-generator
Expand All @@ -109,13 +109,13 @@ h| Version

|
|
| 3.13.2
| 3.15.1

| quarkus-rest-client-oidc-filter

|
|
| 3.13.2
| 3.15.1


|===
Original file line number Diff line number Diff line change
@@ -1,149 +1,167 @@

:summaryTableId: onecx-data-orchestrator-operator
[.configuration-legend]
icon:lock[title=Fixed at build time] Configuration property fixed at build time - All other configuration properties are overridable at runtime
[.configuration-reference.searchable, cols="80,.^10,.^10"]
|===

h|[[onecx-data-orchestrator-operator_configuration]]link:#onecx-data-orchestrator-operator_configuration[Configuration property]

h|[.header-title]##Configuration property##
h|Type
h|Default

a| [[onecx-data-orchestrator-operator_onecx-data-orchestrator-digest]]`link:#onecx-data-orchestrator-operator_onecx-data-orchestrator-digest[onecx.data-orchestrator.digest]`

a| [[onecx-data-orchestrator-operator_onecx-data-orchestrator-digest]] [.property-path]##link:#onecx-data-orchestrator-operator_onecx-data-orchestrator-digest[`onecx.data-orchestrator.digest`]##

[.description]
--
Digest algorithms.


ifdef::add-copy-button-to-env-var[]
Environment variable: env_var_with_copy_button:+++ONECX_DATA_ORCHESTRATOR_DIGEST+++[]
endif::add-copy-button-to-env-var[]
ifndef::add-copy-button-to-env-var[]
Environment variable: `+++ONECX_DATA_ORCHESTRATOR_DIGEST+++`
endif::add-copy-button-to-env-var[]
--|string
--
|string
|`MD5`


a| [[onecx-data-orchestrator-operator_onecx-data-orchestrator-token-user-name]]`link:#onecx-data-orchestrator-operator_onecx-data-orchestrator-token-user-name[onecx.data-orchestrator.token.user-name]`

a| [[onecx-data-orchestrator-operator_onecx-data-orchestrator-token-user-name]] [.property-path]##link:#onecx-data-orchestrator-operator_onecx-data-orchestrator-token-user-name[`onecx.data-orchestrator.token.user-name`]##

[.description]
--
Username for rest call.


ifdef::add-copy-button-to-env-var[]
Environment variable: env_var_with_copy_button:+++ONECX_DATA_ORCHESTRATOR_TOKEN_USER_NAME+++[]
endif::add-copy-button-to-env-var[]
ifndef::add-copy-button-to-env-var[]
Environment variable: `+++ONECX_DATA_ORCHESTRATOR_TOKEN_USER_NAME+++`
endif::add-copy-button-to-env-var[]
--|string
--
|string
|`data-orchestrator-operator`


a| [[onecx-data-orchestrator-operator_onecx-data-orchestrator-token-header-param]]`link:#onecx-data-orchestrator-operator_onecx-data-orchestrator-token-header-param[onecx.data-orchestrator.token.header-param]`

a| [[onecx-data-orchestrator-operator_onecx-data-orchestrator-token-header-param]] [.property-path]##link:#onecx-data-orchestrator-operator_onecx-data-orchestrator-token-header-param[`onecx.data-orchestrator.token.header-param`]##

[.description]
--
Token header parameter.


ifdef::add-copy-button-to-env-var[]
Environment variable: env_var_with_copy_button:+++ONECX_DATA_ORCHESTRATOR_TOKEN_HEADER_PARAM+++[]
endif::add-copy-button-to-env-var[]
ifndef::add-copy-button-to-env-var[]
Environment variable: `+++ONECX_DATA_ORCHESTRATOR_TOKEN_HEADER_PARAM+++`
endif::add-copy-button-to-env-var[]
--|string
--
|string
|`apm-principal-token`


a| [[onecx-data-orchestrator-operator_onecx-data-orchestrator-token-claim-organization-param]]`link:#onecx-data-orchestrator-operator_onecx-data-orchestrator-token-claim-organization-param[onecx.data-orchestrator.token.claim-organization-param]`

a| [[onecx-data-orchestrator-operator_onecx-data-orchestrator-token-claim-organization-param]] [.property-path]##link:#onecx-data-orchestrator-operator_onecx-data-orchestrator-token-claim-organization-param[`onecx.data-orchestrator.token.claim-organization-param`]##

[.description]
--
Token claim organization parameter.


ifdef::add-copy-button-to-env-var[]
Environment variable: env_var_with_copy_button:+++ONECX_DATA_ORCHESTRATOR_TOKEN_CLAIM_ORGANIZATION_PARAM+++[]
endif::add-copy-button-to-env-var[]
ifndef::add-copy-button-to-env-var[]
Environment variable: `+++ONECX_DATA_ORCHESTRATOR_TOKEN_CLAIM_ORGANIZATION_PARAM+++`
endif::add-copy-button-to-env-var[]
--|string
--
|string
|`orgId`


a| [[onecx-data-orchestrator-operator_onecx-data-orchestrator-token-claim-organization-param-array]]`link:#onecx-data-orchestrator-operator_onecx-data-orchestrator-token-claim-organization-param-array[onecx.data-orchestrator.token.claim-organization-param-array]`

a| [[onecx-data-orchestrator-operator_onecx-data-orchestrator-token-claim-organization-param-array]] [.property-path]##link:#onecx-data-orchestrator-operator_onecx-data-orchestrator-token-claim-organization-param-array[`onecx.data-orchestrator.token.claim-organization-param-array`]##

[.description]
--
Token claim organization parameter array.


ifdef::add-copy-button-to-env-var[]
Environment variable: env_var_with_copy_button:+++ONECX_DATA_ORCHESTRATOR_TOKEN_CLAIM_ORGANIZATION_PARAM_ARRAY+++[]
endif::add-copy-button-to-env-var[]
ifndef::add-copy-button-to-env-var[]
Environment variable: `+++ONECX_DATA_ORCHESTRATOR_TOKEN_CLAIM_ORGANIZATION_PARAM_ARRAY+++`
endif::add-copy-button-to-env-var[]
--|boolean
--
|boolean
|`false`


a| [[onecx-data-orchestrator-operator_onecx-data-orchestrator-client-shared]]`link:#onecx-data-orchestrator-operator_onecx-data-orchestrator-client-shared[onecx.data-orchestrator.client.shared]`

a| [[onecx-data-orchestrator-operator_onecx-data-orchestrator-client-shared]] [.property-path]##link:#onecx-data-orchestrator-operator_onecx-data-orchestrator-client-shared[`onecx.data-orchestrator.client.shared`]##

[.description]
--
Set to true to share the HTTP client between REST clients.


ifdef::add-copy-button-to-env-var[]
Environment variable: env_var_with_copy_button:+++ONECX_DATA_ORCHESTRATOR_CLIENT_SHARED+++[]
endif::add-copy-button-to-env-var[]
ifndef::add-copy-button-to-env-var[]
Environment variable: `+++ONECX_DATA_ORCHESTRATOR_CLIENT_SHARED+++`
endif::add-copy-button-to-env-var[]
--|boolean
--
|boolean
|`true`


a| [[onecx-data-orchestrator-operator_onecx-data-orchestrator-client-connection-pool-size]]`link:#onecx-data-orchestrator-operator_onecx-data-orchestrator-client-connection-pool-size[onecx.data-orchestrator.client.connection-pool-size]`

a| [[onecx-data-orchestrator-operator_onecx-data-orchestrator-client-connection-pool-size]] [.property-path]##link:#onecx-data-orchestrator-operator_onecx-data-orchestrator-client-connection-pool-size[`onecx.data-orchestrator.client.connection-pool-size`]##

[.description]
--
The size of the rest client connection pool.


ifdef::add-copy-button-to-env-var[]
Environment variable: env_var_with_copy_button:+++ONECX_DATA_ORCHESTRATOR_CLIENT_CONNECTION_POOL_SIZE+++[]
endif::add-copy-button-to-env-var[]
ifndef::add-copy-button-to-env-var[]
Environment variable: `+++ONECX_DATA_ORCHESTRATOR_CLIENT_CONNECTION_POOL_SIZE+++`
endif::add-copy-button-to-env-var[]
--|int
--
|int
|`30`


a| [[onecx-data-orchestrator-operator_onecx-data-orchestrator-client-key-keys]]`link:#onecx-data-orchestrator-operator_onecx-data-orchestrator-client-key-keys[onecx.data-orchestrator.client.key."keys"]`

a| [[onecx-data-orchestrator-operator_onecx-data-orchestrator-client-key-keys]] [.property-path]##link:#onecx-data-orchestrator-operator_onecx-data-orchestrator-client-key-keys[`onecx.data-orchestrator.client.key."keys"`]##

[.description]
--
Clients key configuration


ifdef::add-copy-button-to-env-var[]
Environment variable: env_var_with_copy_button:+++ONECX_DATA_ORCHESTRATOR_CLIENT_KEY__KEYS_+++[]
endif::add-copy-button-to-env-var[]
ifndef::add-copy-button-to-env-var[]
Environment variable: `+++ONECX_DATA_ORCHESTRATOR_CLIENT_KEY__KEYS_+++`
endif::add-copy-button-to-env-var[]
--|link:https://docs.oracle.com/javase/8/docs/api/java/lang/String.html[String]
--
|Map<String,String>
|

|===
a| [[onecx-data-orchestrator-operator_onecx-data-orchestrator-leader-election-lease-name]] [.property-path]##link:#onecx-data-orchestrator-operator_onecx-data-orchestrator-leader-election-lease-name[`onecx.data-orchestrator.leader-election.lease-name`]##

[.description]
--
Lease name


ifdef::add-copy-button-to-env-var[]
Environment variable: env_var_with_copy_button:+++ONECX_DATA_ORCHESTRATOR_LEADER_ELECTION_LEASE_NAME+++[]
endif::add-copy-button-to-env-var[]
ifndef::add-copy-button-to-env-var[]
Environment variable: `+++ONECX_DATA_ORCHESTRATOR_LEADER_ELECTION_LEASE_NAME+++`
endif::add-copy-button-to-env-var[]
--
|string
|`onecx-data-orchestrator-operator-lease`

|===


:!summaryTableId:
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ public interface DataConfig {
@WithDefault("client")
ConfigClient client();

/**
* Leader election configuration
*/
@WithName("leader-election")
LeaderElectionConfig leaderElectionConfig();

/**
* Client configuration.
*/
Expand Down Expand Up @@ -92,4 +98,17 @@ interface TokenConfig {
boolean claimOrganizationParamArray();

}

/**
* Leader election config
*/
interface LeaderElectionConfig {

/**
* Lease name
*/
@WithName("lease-name")
@WithDefault("onecx-data-orchestrator-operator-lease")
String leaseName();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import io.javaoperatorsdk.operator.processing.event.source.filter.OnUpdateFilter;
import io.smallrye.config.SmallRyeConfig;

@ControllerConfiguration(name = "data", namespaces = WATCH_CURRENT_NAMESPACE, onAddFilter = DataController.SlotAddFilter.class, onUpdateFilter = DataController.SlotUpdateFilter.class)
@ControllerConfiguration(name = "data", maxReconciliationInterval = @MaxReconciliationInterval(interval = Constants.NO_MAX_RECONCILIATION_INTERVAL), namespaces = WATCH_CURRENT_NAMESPACE, onAddFilter = DataController.SlotAddFilter.class, onUpdateFilter = DataController.SlotUpdateFilter.class)
public class DataController implements Reconciler<Data>, ErrorStatusHandler<Data> {

private static final Logger log = LoggerFactory.getLogger(DataController.class);
Expand Down
Loading
Loading