|
| 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 | +---- |
0 commit comments