From 09d6780b6d3f6ea1a49594e395f64e23ce12eb62 Mon Sep 17 00:00:00 2001 From: Ricardo Zanini Date: Mon, 15 Apr 2024 15:52:38 -0300 Subject: [PATCH 1/2] Add a note about SonataFlowPlatform flow properties Signed-off-by: Ricardo Zanini --- .../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 95bc97b8d..930f99600 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: + secretKeyRef: petstore-credentials + keyName: AUTH_TOKEN + - name: my.petstore.url + valueFrom: + configMapRef: petstore-props + keyName: PETSTORE_URL +---- + +The `valueFrom` attribute derives from the link:{k8s_envvar_url}[EnvVar Kubernetes API]. + == Additional resources * https://quarkus.io/guides/config-reference#profile-aware-files[Quarkus - Profile aware files] From 428374055e2ba76b4c56bc4ebe24386b4058e2e7 Mon Sep 17 00:00:00 2001 From: Ricardo Zanini <1538000+ricardozanini@users.noreply.github.com> Date: Tue, 16 Apr 2024 11:18:20 -0300 Subject: [PATCH 2/2] Incorporate Jakub's review Co-authored-by: Jakub Schwan --- .../ROOT/pages/cloud/operator/configuring-workflows.adoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/serverlessworkflow/modules/ROOT/pages/cloud/operator/configuring-workflows.adoc b/serverlessworkflow/modules/ROOT/pages/cloud/operator/configuring-workflows.adoc index 930f99600..250d87903 100644 --- a/serverlessworkflow/modules/ROOT/pages/cloud/operator/configuring-workflows.adoc +++ b/serverlessworkflow/modules/ROOT/pages/cloud/operator/configuring-workflows.adoc @@ -129,7 +129,7 @@ spec: properties: flow: - name: my.petstore.auth.token - valueFrom: + valueFrom: <1> secretKeyRef: petstore-credentials keyName: AUTH_TOKEN - name: my.petstore.url @@ -138,7 +138,7 @@ spec: keyName: PETSTORE_URL ---- -The `valueFrom` attribute derives from the link:{k8s_envvar_url}[EnvVar Kubernetes API]. +<1> The `valueFrom` attribute derives from the link:{k8s_envvar_url}[EnvVar Kubernetes API]. == Additional resources