You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kie.apache.org by ri...@apache.org on 2024/05/23 15:01:38 UTC

(incubator-kie-kogito-docs) branch main updated: Add a note about SonataFlowPlatform flow properties (#623)

This is an automated email from the ASF dual-hosted git repository.

ricardozanini pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-kie-kogito-docs.git


The following commit(s) were added to refs/heads/main by this push:
     new eb6feb1ea Add a note about SonataFlowPlatform flow properties (#623)
eb6feb1ea is described below

commit eb6feb1ea1cca2e556ba72103c09e9a3f5e49855
Author: Ricardo Zanini <15...@users.noreply.github.com>
AuthorDate: Thu May 23 12:01:33 2024 -0300

    Add a note about SonataFlowPlatform flow properties (#623)
    
    * Add a note about SonataFlowPlatform flow properties
    
    Signed-off-by: Ricardo Zanini <za...@redhat.com>
    
    * Incorporate Jakub's review
    
    Co-authored-by: Jakub Schwan <js...@redhat.com>
    
    ---------
    
    Signed-off-by: Ricardo Zanini <za...@redhat.com>
    Co-authored-by: Jakub Schwan <js...@redhat.com>
---
 .../cloud/operator/configuring-workflows.adoc      | 57 ++++++++++++++++++++++
 1 file changed, 57 insertions(+)

diff --git a/serverlessworkflow/modules/ROOT/pages/cloud/operator/configuring-workflows.adoc b/serverlessworkflow/modules/ROOT/pages/cloud/operator/configuring-workflows.adoc
index b4f57ef5f..6f88b4106 100644
--- a/serverlessworkflow/modules/ROOT/pages/cloud/operator/configuring-workflows.adoc
+++ b/serverlessworkflow/modules/ROOT/pages/cloud/operator/configuring-workflows.adoc
@@ -4,6 +4,8 @@
 :description: Configuration of Workflow Services deployed by the operator
 :keywords: kogito, sonataflow, workflow, serverless, operator, kubernetes, minikube, config, openshift, containers
 
+:k8s_envvar_url: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#envvar-v1-core
+
 This document describes how to configure a Workflow service with the {operator_name}.
 
 == Editing the Workflow Configuration
@@ -83,6 +85,61 @@ Other managed properties include:
 
 If you try to change any of them, the operator will override them with the default, but preserving your changes in other property keys.
 
+=== Defining Global Managed Properties
+
+It's possible to set custom global managed properties for your workflows by defining them in the `SonataFlowPlatform` resource in the same namespace.
+
+Edit the `SonataFlowPlatform` instance and add the required properties to the `.spec.properties.flow` attribute. For example:
+
+.Example of a SonataFlowPlatform with flow properties
+[source,yaml,subs="attributes+"]
+----
+apiVersion: sonataflow.org/v1alpha08
+kind: SonataFlowPlatform
+metadata:
+  name: sonataflow-platform
+spec:
+    properties:
+        flow: <1>
+         - name: quarkus.log.category <2>
+           value: INFO <3>
+----
+
+<1> Attribute to set the array of custom global managed properties
+<2> The property key
+<3> The property value
+
+Every workflow in this `SonataFlowPlatform` instance's namespace will have the property `quarkus.log.category: INFO` added to its managed properties.
+
+[IMPORTANT]
+====
+You can't override the default managed properties set by the operator using this feature.
+====
+
+You can add properties from other `ConfigMap` or `Secret` from the same namespace. For example:
+
+.Example of a SonataFlowPlatform properties from ConfigMap and Secret
+[source,yaml,subs="attributes+"]
+----
+apiVersion: sonataflow.org/v1alpha08
+kind: SonataFlowPlatform
+metadata:
+  name: sonataflow-platform
+spec:
+    properties:
+        flow:
+         - name: my.petstore.auth.token
+           valueFrom: <1>
+                secretKeyRef: petstore-credentials
+                    keyName: AUTH_TOKEN
+         - name: my.petstore.url
+           valueFrom:
+                configMapRef: petstore-props
+                    keyName: PETSTORE_URL
+----
+
+<1> The `valueFrom` attribute derives from the link:{k8s_envvar_url}[EnvVar Kubernetes API].
+
 == Additional resources
 
 * link:https://quarkus.io/guides/config-reference#profile-aware-files[Quarkus Configuration Reference Guide - Profile aware files]


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org