Skip to content

Commit

Permalink
fix(#5097): Remove secondary IntegrationPlatform in favor of using In…
Browse files Browse the repository at this point in the history
…tegrationProfile

- Remove secondary IntegrationPlatform mode
- Reduce logic to a single IntegrationPlatform per operator instance
- IntegrationPlatforms matching the operatorID do have precedence when searching for local platforms
- Introduce IntegrationProfile custom resource definition
- Let user customize a subset of IntegrationPlatform settings in IntegrationProfile
- Load IntegrationProfile settings when integration resource is annotated to select the profile
- Save trait configuration used to build the integration kit on the resource spec for future reference
  • Loading branch information
christophd committed Feb 27, 2024
1 parent 08582b2 commit ee54e63
Show file tree
Hide file tree
Showing 96 changed files with 11,116 additions and 427 deletions.
2 changes: 1 addition & 1 deletion .github/actions/kamel-cleanup/clean-orphan-resources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

set +e

resourcetypes="integrations integrationkits integrationplatforms camelcatalogs kamelets builds pipes kameletbindings"
resourcetypes="integrations integrationkits integrationplatforms integrationprofiles camelcatalogs kamelets builds pipes kameletbindings"

#
# Loop through the resource types
Expand Down
1 change: 1 addition & 0 deletions docs/modules/ROOT/pages/contributing/uninstalling.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ customresourcedefinition.apiextensions.k8s.io/camelcatalogs.camel.apache.org
customresourcedefinition.apiextensions.k8s.io/integrationkits.camel.apache.org 2020-05-28T20:31:39Z
customresourcedefinition.apiextensions.k8s.io/integrationplatforms.camel.apache.org 2020-05-28T20:31:39Z
customresourcedefinition.apiextensions.k8s.io/integrations.camel.apache.org 2020-05-28T20:31:39Z
customresourcedefinition.apiextensions.k8s.io/integrationprofiles.camel.apache.org 2020-05-28T20:31:39Z
----
35 changes: 19 additions & 16 deletions docs/modules/ROOT/pages/installation/advanced/multi.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -49,34 +49,37 @@ operator id:
kubectl annotate integration timer-to-log camel.apache.org/operator.id=operator-2 --overwrite
----

[[advanced-installation-multiple-platforms]]
== Configuring Multiple Integration Platforms
[[advanced-installation-integration-profile]]
== Apply custom IntegrationProfile settings

Any running Camel K integration is associated to a shared IntegrationPlatform resource that contains general configuration options.
The integration platform is located in the integration namespace (or also in the operator namespace, in case of global installation)
and typically only one ("primary", see later) integration platform is allowed to obtain a "Ready" state in a namespace, while others get the "Duplicate" state (i.e. IntegrationPlatform resources
are somewhat "singleton" in a namespace).
The integration platform is located in the operator namespace and typically uses the same name as the operator id that this platform belongs to.
Each Camel K operator uses exactly one single integration platform in a "Ready" state.
IntegrationPlatform resources are somewhat "singleton" in a namespace and belong to a single operator instance.

There's a way to allow two or more integration platforms to get a "Ready" state in a namespace and for them to be used by integrations:
platforms can be marked with the annotation `camel.apache.org/secondary.platform=true`.
That annotation marks the platform as *secondary* so that it will never be used as default platform during the reconciliation of an integration,
unless explicitly selected (any resource belonging to the "camel.apache.org" group can select a particular integration platform).
Secondary platforms are also allowed to reach the "Ready" state without becoming "Duplicate".
There's a way to allow customizations regarding the integration configuration.
Users may add IntegrationProfile resources to an individual namespace.
The profile holds custom integration platform settings for them to be used by integrations.
The IntegrationProfile resource allows only a subset of the IntegrationPlatform settings for customization.

To specify which integration platform should be used to reconcile a specific CR, the CR can be annotated like in the following example:
The custom IntegrationProfile resource uses the operator id as an annotation to bind its reconciliation to an operator instance.
Also, the profile must be explicitly selected by an annotation referencing the integration profile name (any resource belonging to the "camel.apache.org" group can select a particular profile configuration).

To specify which profile should be used for an integration, the resource can be annotated like in the following example:

[source,yaml]
----
kind: Integration
apiVersion: camel.apache.org/v1
metadata:
annotations:
camel.apache.org/platform.id: my-platform-name
camel.apache.org/integration-profile.id: my-profile-name
# ...
----

The value of the `camel.apache.org/platform.id` annotation must match the name of an IntegrationPlatform custom resource, in the annotated resource namespace or
also in the operator namespace.
The value of the `camel.apache.org/integration-profile.id` annotation must match the name of an IntegrationProfile custom resource.
The profile gets automatically resolved from the annotated resource namespace or from the operator namespace.
In case you need to explicitly set the integration profile namespace you can do so with the `camel.apache.org/integration-profile.namespace` annotation.

The selection of a secondary IntegrationPlatform enables new configuration scenarios, for example, sharing global configuration options for groups of integrations, or also
providing per-operator specific configuration options e.g. when you install multiple global operators in the same namespace.
The selection of a IntegrationProfile enables new configuration scenarios, for example, sharing global configuration options for groups of integrations, or also
providing per-operator specific configuration options e.g. when you install multiple global operators in the cluster.
Loading

0 comments on commit ee54e63

Please sign in to comment.