Skip to content

Commit ce5ecef

Browse files
authored
Merge pull request #93224 from openshift-cherrypick-robot/cherry-pick-91221-to-serverless-docs-1.36
2 parents 4cbd16e + 8067fe4 commit ce5ecef

5 files changed

+229
-0
lines changed

_topic_maps/_topic_map.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,8 @@ Topics:
401401
File: serverless-logic-data-index
402402
- Name: Managing supporting services
403403
File: serverless-logic-managing-supporting-services
404+
- Name: Configuring workflow services
405+
File: serverless-logic-configuring-workflow-services
404406
- Name: Managing workflow persistence
405407
File: serverless-logic-managing-persistence
406408
- Name: Workflow eventing system
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
// Module included in the following assemblies:
2+
// * serverless-logic/serverless-logic-configuring-workflow-services
3+
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="serverless-logic-defining-global-managed-properties_{context}"]
7+
= Defining global-managed-properties
8+
9+
You can define custom global managed properties for all workflows in a specific namespace by editing the `SonataFlowPlatform` resource. These properties are defined under the `.spec.properties.flow` attribute and are automatically applied to every workflow service in the same namespace.
10+
11+
.Prerequisites
12+
13+
* You have {ServerlessLogicOperatorName} installed on your cluster.
14+
* You have created your {ServerlessLogicProductName} project.
15+
* You have access to a {ServerlessLogicProductName} project with the appropriate roles and permissions to create applications and other workloads in {ocp-product-title}.
16+
* You have installed the OpenShift CLI (`oc`).
17+
18+
.Procedure
19+
20+
. Locate the `SonataFlowPlatform` resource in the same namespace as your workflow services.
21+
+
22+
This is where you will define global managed properties.
23+
24+
. Open the `SonataFlowPlatform` resource in your default editor by executing the following command:
25+
+
26+
[source,terminal]
27+
----
28+
$ oc edit sonataflowplatform sonataflow-platform-example
29+
----
30+
31+
. Define custom global managed properties.
32+
+
33+
In the editor, navigate to the `spec.properties.flow` section and define your desired properties as shown in the following example:
34+
35+
+
36+
.Example of a SonataFlowPlatform with flow properties
37+
38+
[source,yaml]
39+
----
40+
apiVersion: sonataflow.org/v1alpha08
41+
kind: SonataFlowPlatform
42+
metadata:
43+
name: sonataflow-platform-example
44+
spec:
45+
properties:
46+
flow: <1>
47+
- name: quarkus.log.category <2>
48+
value: INFO <3>
49+
----
50+
+
51+
<1> Attribute to define a list of custom global managed properties.
52+
<2> The property key.
53+
<3> The property value to apply globally.
54+
+
55+
This configuration adds the `quarkus.log.category=INFO` property to the managed properties of every workflow service in the namespace.
56+
57+
. Optional: Use external `ConfigMaps` or `Secrets`.
58+
+
59+
You can also reference values from existing `ConfigMap` or `Secret` resources using the `valueFrom` attribute as shown in the following example:
60+
61+
+
62+
.Example of a SonataFlowPlatform properties from ConfigMap and Secret
63+
64+
[source,yaml]
65+
----
66+
apiVersion: sonataflow.org/v1alpha08
67+
kind: SonataFlowPlatform
68+
metadata:
69+
name: sonataflow-platform-example
70+
spec:
71+
properties:
72+
flow:
73+
- name: my.petstore.auth.token
74+
valueFrom: <1>
75+
secretKeyRef: petstore-credentials <2>
76+
keyName: AUTH_TOKEN
77+
- name: my.petstore.url
78+
valueFrom:
79+
configMapRef: petstore-props <3>
80+
keyName: PETSTORE_URL
81+
----
82+
83+
+
84+
<1> The `valueFrom` attribute is derived from the Kubernetes `EnvVar` API and works similarly to how environment variables reference external sources.
85+
<2> `valueFrom.secretKeyRef` pulls the value from a key named `AUTH_TOKEN` in the `petstore-credentials` secret.
86+
<3> `valueFrom.configMapRef` pulls the value from a key named `PETSTORE_URL` in the `petstore-props` ConfigMap.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// Module included in the following assemblies:
2+
// * serverless-logic/serverless-logic-configuring-workflow-services
3+
4+
5+
:_mod-docs-content-type: REFERENCE
6+
[id="serverless-logic-modifying-managed-properties-workflow-services_{context}"]
7+
= Managed properties in workflow services
8+
9+
The {ServerlessLogicOperatorName} uses managed properties to control essential runtime behavior. These values are stored separately and override user-defined properties during each reconciliation cycle. You can also apply custom managed properties globally by updating the `SonataFlowPlatform` resource within the same namespace.
10+
11+
Some properties used by the {ServerlessLogicOperatorName} are managed properties and cannot be changed through the standard user configuration. These properties are stored in a dedicated `ConfigMap`, typically named `<workflow-name>-managed-props`. If you try to modify any managed property directly, the Operator will automatically revert it to its default value, but it will preserve your other user-defined changes.
12+
13+
[NOTE]
14+
====
15+
You cannot override the default managed properties set by the Operator using global managed properties. These defaults are always enforced during reconciliation.
16+
====
17+
18+
The following table lists some core managed properties as an example:
19+
20+
.Managed properties overview
21+
[cols="2,1,1",options="header"]
22+
|====
23+
|Property Key
24+
|Immutable Value
25+
|Profile
26+
27+
|`quarkus.http.port`
28+
|`8080`
29+
|`all`
30+
31+
|`kogito.service.url`
32+
|`http://greeting.example-namespace`
33+
|`all`
34+
35+
|`org.kie.kogito.addons.knative.eventing.health-enabled`
36+
|`false`
37+
|`dev`
38+
39+
|====
40+
41+
Other managed properties include Kubernetes service discovery settings, Data Index location properties, Job Service location properties, and Knative Eventing system configurations.
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
// Module included in the following assemblies:
2+
// * serverless-logic/serverless-logic-configuring-workflow-services
3+
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="serverless-logic-modifying-workflow-configuration_{context}"]
7+
= Modifying workflow configuration
8+
9+
The {ServerlessLogicOperatorName} decides the workflow configuration based on two `ConfigMaps` for each workflow: a workflow for `user-defined` properties and a workflow for Operator `managed-properties`:
10+
11+
* *User-defined properties:* if your workflow requires particular configurations, ensure that you create a `ConfigMap` named `<workflow-name>-props` that includes all the configurations before workflow deployment. For example, if your workflow name is `greeting`, the `ConfigMap` name is `greeting-managed-props`. If such `ConfigMap` does not exists, the Operator creates the workflow to have empty or default content.
12+
13+
* *Managed properties:* automatically generated by the Operator and stored in a `ConfigMap` named `<workflow-name>-managed-props`. These properties are typically related to configurations for the workflow. The properties connect to supporting services, the eventing system, and so on.
14+
15+
[NOTE]
16+
====
17+
Managed properties always override user-defined properties with the same key. These managed properties are read-only and reset by the Operator during each reconciliation cycle.
18+
====
19+
20+
.Prerequisites
21+
22+
* You have {ServerlessLogicOperatorName} installed on your cluster.
23+
* You have created your {ServerlessLogicProductName} project.
24+
* You have access to a {ServerlessLogicProductName} project with the appropriate roles and permissions to create applications and other workloads in {ocp-product-title}.
25+
* You have installed the OpenShift CLI (`oc`).
26+
* You have previously created the workflow `user-defined` properties `ConfigMap`, or the Operator has created it.
27+
28+
.Procedure
29+
30+
. Open your terminal and access the {ServerlessLogicProductName} project. Ensure that you are working within the correct project, `namespace`, where your workflow service is deployed.
31+
+
32+
[source,terminal]
33+
----
34+
$ oc project <your-project-name>
35+
----
36+
37+
. Identify the name of the workflow you want to configure.
38+
+
39+
For example, if your workflow is named `greeting`, the user-defined properties are stored in a `ConfigMap` named `greeting-props`.
40+
41+
. Edit the workflow `ConfigMap` by executing the following example command:
42+
+
43+
[source,terminal]
44+
----
45+
$ oc edit configmap greeting-props
46+
----
47+
+
48+
Replace `greeting` with the actual name of your workflow.
49+
50+
. Modify the `application.properties` section.
51+
+
52+
Locate the `data` section and update the `application.properties` field with your desired configuration.
53+
+
54+
.Example of `ConfigMap`
55+
56+
[source,yaml]
57+
----
58+
apiVersion: v1
59+
kind: ConfigMap
60+
metadata:
61+
labels:
62+
app: greeting
63+
name: greeting-props
64+
namespace: default
65+
data:
66+
application.properties: |
67+
my.properties.key = any-value
68+
...
69+
----
70+
71+
. After updating the properties, save the file and exit the editor. The updated configuration will be applied automatically.
72+
73+
[NOTE]
74+
====
75+
The workflow runtime is based on Quarkus, so all the keys under `application.properties` must follow Quarkus property syntax. If the format is invalid, the {ServerlessLogicOperatorName} might overwrite your changes with default values during the next reconciliation cycle.
76+
====
77+
78+
.Verification
79+
80+
* To confirm that your changes are applied successfully, execute the following example command:
81+
+
82+
[source,terminal]
83+
----
84+
$ oc get configmap greeting-props -o yaml
85+
----
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
:_mod-docs-content-type: ASSEMBLY
2+
[id="serverless-logic-configuring-workflow-services"]
3+
= Configuring workflow services
4+
:context: serverless-logic-configuring-workflow-services
5+
include::_attributes/common-attributes.adoc[]
6+
7+
toc::[]
8+
9+
This section describes how to configure a workflow service by using the {ServerlessLogicOperatorName}. The section outlines key concepts and configuration options that you can reference for customizing your workflow service according to your environment and use case. You can edit workflow configurations, manage specific properties, and define global managed properties to ensure consistent and efficient execution of your workflows.
10+
11+
include::modules/serverless-logic-modifying-workflow-configuration.adoc[leveloffset=+1]
12+
13+
include::modules/serverless-logic-modifying-managed-properties-workflow-services.adoc[leveloffset=+1]
14+
15+
include::modules/serverless-logic-defining-global-managed-properties.adoc[leveloffset=+1]

0 commit comments

Comments
 (0)