Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a note about SonataFlowPlatform flow properties #623

Merged
merged 2 commits into from
May 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

* https://quarkus.io/guides/config-reference#profile-aware-files[Quarkus - Profile aware files]
Expand Down