jordigilh commented on code in PR #529: URL: https://github.com/apache/incubator-kie-kogito-docs/pull/529#discussion_r1508113272
########## serverlessworkflow/modules/ROOT/pages/cloud/operator/using-persistence.adoc: ########## @@ -0,0 +1,107 @@ += Building a Custom Development Image +:compat-mode!: +// Metadata: +:description: Using persistence in the workflow instance to store its context +:keywords: sonataflow, workflow, serverless, operator, kubernetes, persistence + + +This document describes how to configure a SonataFlow instance to use persistence to store the flow's context in a relational database. + +== Configuring the SonataFlow CR to use persistence + +Kubernetes's pods are stateless by definition. In some scenarios this can be a challenge for workloads that require to maintain the status of +the application regardless of the pod's lifecycle. In the case of SonataFlow, the context of the workflow is lost when the pod restarts. +If your workflow requires to recover from such scenarios, you need to make these additions to your Workflow CR: +Use the `persistence` field in the `SonataFlow` workflow spec to define the database service located in the same cluster. +There are 2 ways to accomplish this: + +* Using the Platform CR's defined persistence +When the Platform CR is deployed with its persistence spec populated it enables workflows to leverage on its configuration to populate the persistence +properties in the workflows. + +[source,yaml,subs="attributes+"] +---- +apiVersion: sonataflow.org/v1alpha08 +kind: SonataFlowPlatform +metadata: + name: sonataflow-platform +spec: + persistence: + postgresql: + secretRef: + name: postgres-secrets + userKey: POSTGRES_USER + passwordKey: POSTGRES_PASSWORD + serviceRef: + name: postgres + port: 5432 + databaseName: sonataflow + databaseSchema: shared + build: + config: + strategyOptions: + KanikoBuildCacheEnabled: "true" +--- + +The values of `POSTGRES_USER` and `POSTGRES_PASSWORD` are the keys in the secret that contains the credentials to connect to the postgreSQL instance. Review Comment: I'm not sure because this change conveys that the keys are a secret, when in fact the keys are not a secret but are stored in an object of kind `secret`. It's a kubernetes [terminology](https://kubernetes.io/docs/concepts/configuration/secret/). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
