You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kie.apache.org by "jordigilh (via GitHub)" <gi...@apache.org> on 2024/02/06 16:47:47 UTC

[PR] [KOGITO-9982] Add persistence to SonataFlow CRD [incubator-kie-kogito-docs]

jordigilh opened a new pull request, #529:
URL: https://github.com/apache/incubator-kie-kogito-docs/pull/529

   Adds documentation with examples on how to configure a `SonataFlow` CR with persistence using its own dedicated `persistence` field or leveraging on the `SonataFlowPlatform` CR persistence configuration.
   
   @ricardozanini @wmedvede @caponetto PTAL.


-- 
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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [KOGITO-9982] Add persistence to SonataFlow CRD [incubator-kie-kogito-docs]

Posted by "ricardozanini (via GitHub)" <gi...@apache.org>.
ricardozanini commented on PR #529:
URL: https://github.com/apache/incubator-kie-kogito-docs/pull/529#issuecomment-1988338735

   @jordigilh can you please rebase?


-- 
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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [KOGITO-9982] Add persistence to SonataFlow CRD [incubator-kie-kogito-docs]

Posted by "domhanak (via GitHub)" <gi...@apache.org>.
domhanak commented on code in PR #529:
URL: https://github.com/apache/incubator-kie-kogito-docs/pull/529#discussion_r1519298900


##########
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:
   imho we can add the link:
   `...are the keys in the [secret](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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [KOGITO-9982] Add persistence to SonataFlow CRD [incubator-kie-kogito-docs]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #529:
URL: https://github.com/apache/incubator-kie-kogito-docs/pull/529#issuecomment-1988496617

   🎊 PR Preview cca23820255a0d2a31d22ad053782e2aaada1fe0 has been successfully built and deployed. See the documentation preview: https://sonataflow-docs-preview-pr-529.surge.sh
   <!-- Sticky Pull Request Comment -->
   <!-- Sticky Pull Request Comment -->


-- 
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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [KOGITO-9982] Add persistence to SonataFlow CRD [incubator-kie-kogito-docs]

Posted by "kaldesai (via GitHub)" <gi...@apache.org>.
kaldesai commented on code in PR #529:
URL: https://github.com/apache/incubator-kie-kogito-docs/pull/529#discussion_r1480941275


##########
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 

Review Comment:
   ```suggestion
   Kubernetes's pods are stateless by definition. In some scenarios, this can be a challenge for workloads that require maintaining the status of 
   ```



-- 
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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [KOGITO-9982] Add persistence to SonataFlow CRD [incubator-kie-kogito-docs]

Posted by "kaldesai (via GitHub)" <gi...@apache.org>.
kaldesai commented on code in PR #529:
URL: https://github.com/apache/incubator-kie-kogito-docs/pull/529#discussion_r1480944081


##########
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:
   ```suggestion
   The values of `POSTGRES_USER` and `POSTGRES_PASSWORD` are the secret keys containing the credentials to connect to the PostgreSQL instance. 
   ```



-- 
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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [KOGITO-9982] Add persistence to SonataFlow CRD [incubator-kie-kogito-docs]

Posted by "ricardozanini (via GitHub)" <gi...@apache.org>.
ricardozanini merged PR #529:
URL: https://github.com/apache/incubator-kie-kogito-docs/pull/529


-- 
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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [KOGITO-9982] Add persistence to SonataFlow CRD [incubator-kie-kogito-docs]

Posted by "kaldesai (via GitHub)" <gi...@apache.org>.
kaldesai commented on code in PR #529:
URL: https://github.com/apache/incubator-kie-kogito-docs/pull/529#discussion_r1480944743


##########
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. 
+The SonataFlow Workflow CR 
+is defined with its `Persistence` field defined as empty.
+
+[source,yaml,subs="attributes+"]
+apiVersion: sonataflow.org/v1alpha08
+kind: SonataFlow
+metadata:
+  name: callbackstatetimeouts
+  annotations:
+    sonataflow.org/description: Callback State Timeouts Example k8s
+    sonataflow.org/version: 0.0.1
+spec:
+  persistence: {}
+  ...
+---
+
+This configuration signals the operator that the workflow requires persistence and that it expects its configuration to be populated accordingly. 
+The operator will add the revelant JDBC properties in the `application.properties` 
+generated and as part of the pod´s environment so that it can connect to the persistence service defined in the `Platform` CR.
+
+Note that currently only PostgreSQL is the only persistence supported.
+
+* Using the custom defined persistence in the SonataFlow CR
+
+Alternatively you can define a dedicated configuration in the SonataFlow CR instance using the same schema format found in the Platform CRD:

Review Comment:
   ```suggestion
   Alternatively, you can define a dedicated configuration in the SonataFlow CR instance using the same schema format found in the Platform CRD:
   ```



-- 
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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [KOGITO-9982] Add persistence to SonataFlow CRD [incubator-kie-kogito-docs]

Posted by "ricardozanini (via GitHub)" <gi...@apache.org>.
ricardozanini commented on code in PR #529:
URL: https://github.com/apache/incubator-kie-kogito-docs/pull/529#discussion_r1519774184


##########
serverlessworkflow/modules/ROOT/pages/cloud/operator/using-persistence.adoc:
##########
@@ -0,0 +1,107 @@
+= Using persistence in the SonataFlow Workflow CR
+: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 maintaining 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 recovery from such scenarios, you must 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 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. 
+The SonataFlow Workflow CR 
+is defined with its `Persistence` field defined as empty.
+
+[source,yaml,subs="attributes+"]
+apiVersion: sonataflow.org/v1alpha08
+kind: SonataFlow
+metadata:
+  name: callbackstatetimeouts
+  annotations:
+    sonataflow.org/description: Callback State Timeouts Example k8s
+    sonataflow.org/version: 0.0.1
+spec:
+  persistence: {}
+  ...
+---
+
+This configuration signals the operator that the workflow requires persistence and that it expects its configuration to be populated accordingly. 
+The operator will add the relevant JDBC properties in the `application.properties`
+generated and as part of the pod´s environment so that it can connect to the persistence service defined in the `Platform` CR.
+
+Note that currently only PostgreSQL is the only persistence supported.
+
+* Using the custom defined persistence in the SonataFlow CR

Review Comment:
   ```suggestion
   * Using the custom defined persistence in the `SonataFlow` CR
   ```



##########
serverlessworkflow/modules/ROOT/pages/cloud/operator/using-persistence.adoc:
##########
@@ -0,0 +1,107 @@
+= Using persistence in the SonataFlow Workflow CR
+: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 maintaining 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 recovery from such scenarios, you must 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 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. 
+The SonataFlow Workflow CR 
+is defined with its `Persistence` field defined as empty.
+
+[source,yaml,subs="attributes+"]
+apiVersion: sonataflow.org/v1alpha08
+kind: SonataFlow
+metadata:
+  name: callbackstatetimeouts
+  annotations:
+    sonataflow.org/description: Callback State Timeouts Example k8s
+    sonataflow.org/version: 0.0.1
+spec:
+  persistence: {}
+  ...
+---
+
+This configuration signals the operator that the workflow requires persistence and that it expects its configuration to be populated accordingly. 
+The operator will add the relevant JDBC properties in the `application.properties`
+generated and as part of the pod´s environment so that it can connect to the persistence service defined in the `Platform` CR.
+
+Note that currently only PostgreSQL is the only persistence supported.

Review Comment:
   ```suggestion
   [NOTE]
   ====
   Currently, PostgreSQL is the only persistence supported.
   ====
   ```



##########
serverlessworkflow/modules/ROOT/pages/cloud/operator/using-persistence.adoc:
##########
@@ -0,0 +1,107 @@
+= Using persistence in the SonataFlow Workflow CR
+: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 maintaining 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.

Review Comment:
   ```suggestion
   the application regardless of the pod's lifecycle. In the case of {product_name}, the context of the workflow is lost when the pod restarts.
   ```



##########
serverlessworkflow/modules/ROOT/pages/cloud/operator/using-persistence.adoc:
##########
@@ -0,0 +1,107 @@
+= Using persistence in the SonataFlow Workflow CR
+: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 maintaining 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 recovery from such scenarios, you must 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 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. 
+The SonataFlow Workflow CR 
+is defined with its `Persistence` field defined as empty.
+
+[source,yaml,subs="attributes+"]
+apiVersion: sonataflow.org/v1alpha08
+kind: SonataFlow
+metadata:
+  name: callbackstatetimeouts
+  annotations:
+    sonataflow.org/description: Callback State Timeouts Example k8s
+    sonataflow.org/version: 0.0.1
+spec:
+  persistence: {}
+  ...
+---
+
+This configuration signals the operator that the workflow requires persistence and that it expects its configuration to be populated accordingly. 
+The operator will add the relevant JDBC properties in the `application.properties`
+generated and as part of the pod´s environment so that it can connect to the persistence service defined in the `Platform` CR.
+
+Note that currently only PostgreSQL is the only persistence supported.
+
+* Using the custom defined persistence in the SonataFlow CR
+
+Alternatively, you can define a dedicated configuration in the SonataFlow CR instance using the same schema format found in the Platform CRD:

Review Comment:
   ```suggestion
   Alternatively, you can define a dedicated configuration in the `SonataFlow` CR instance using the same schema format found in the Platform CRD:
   ```



##########
serverlessworkflow/modules/ROOT/pages/cloud/operator/using-persistence.adoc:
##########
@@ -0,0 +1,107 @@
+= Using persistence in the SonataFlow Workflow CR
+: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 maintaining 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 recovery from such scenarios, you must 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 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:
   ```suggestion
   The values of `POSTGRES_USER` and `POSTGRES_PASSWORD` are the keys in the [Kubernetes secret](https://kubernetes.io/docs/concepts/configuration/secret/) that contains the credentials to connect to the postgreSQL instance. 
   ```



-- 
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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [KOGITO-9982] Add persistence to SonataFlow CRD [incubator-kie-kogito-docs]

Posted by "jordigilh (via GitHub)" <gi...@apache.org>.
jordigilh commented on PR #529:
URL: https://github.com/apache/incubator-kie-kogito-docs/pull/529#issuecomment-1988524808

   @ricardozanini thanks for the suggestions! I've merged them to this PR.


-- 
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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [KOGITO-9982] Add persistence to SonataFlow CRD [incubator-kie-kogito-docs]

Posted by "kaldesai (via GitHub)" <gi...@apache.org>.
kaldesai commented on code in PR #529:
URL: https://github.com/apache/incubator-kie-kogito-docs/pull/529#discussion_r1480942680


##########
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

Review Comment:
   ```suggestion
   When the Platform CR is deployed with its persistence spec populated it enables workflows to leverage its configuration to populate the persistence
   ```



-- 
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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [KOGITO-9982] Add persistence to SonataFlow CRD [incubator-kie-kogito-docs]

Posted by "kaldesai (via GitHub)" <gi...@apache.org>.
kaldesai commented on code in PR #529:
URL: https://github.com/apache/incubator-kie-kogito-docs/pull/529#discussion_r1480941931


##########
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:

Review Comment:
   ```suggestion
   If your workflow requires recovery from such scenarios, you must make these additions to your workflow CR:
   ```



-- 
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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [KOGITO-9982] Add persistence to SonataFlow CRD [incubator-kie-kogito-docs]

Posted by "jordigilh (via GitHub)" <gi...@apache.org>.
jordigilh commented on PR #529:
URL: https://github.com/apache/incubator-kie-kogito-docs/pull/529#issuecomment-1988494919

   > @jordigilh can you please rebase?
   
   Done


-- 
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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [KOGITO-9982] Add persistence to SonataFlow CRD [incubator-kie-kogito-docs]

Posted by "ricardozanini (via GitHub)" <gi...@apache.org>.
ricardozanini commented on PR #529:
URL: https://github.com/apache/incubator-kie-kogito-docs/pull/529#issuecomment-1930456963

   @kaldesai can you please review?


-- 
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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [KOGITO-9982] Add persistence to SonataFlow CRD [incubator-kie-kogito-docs]

Posted by "kaldesai (via GitHub)" <gi...@apache.org>.
kaldesai commented on code in PR #529:
URL: https://github.com/apache/incubator-kie-kogito-docs/pull/529#discussion_r1480944491


##########
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. 
+The SonataFlow Workflow CR 
+is defined with its `Persistence` field defined as empty.
+
+[source,yaml,subs="attributes+"]
+apiVersion: sonataflow.org/v1alpha08
+kind: SonataFlow
+metadata:
+  name: callbackstatetimeouts
+  annotations:
+    sonataflow.org/description: Callback State Timeouts Example k8s
+    sonataflow.org/version: 0.0.1
+spec:
+  persistence: {}
+  ...
+---
+
+This configuration signals the operator that the workflow requires persistence and that it expects its configuration to be populated accordingly. 
+The operator will add the revelant JDBC properties in the `application.properties` 

Review Comment:
   ```suggestion
   The operator will add the relevant JDBC properties in the `application.properties` 
   ```



-- 
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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [KOGITO-9982] Add persistence to SonataFlow CRD [incubator-kie-kogito-docs]

Posted by "jordigilh (via GitHub)" <gi...@apache.org>.
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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [KOGITO-9982] Add persistence to SonataFlow CRD [incubator-kie-kogito-docs]

Posted by "domhanak (via GitHub)" <gi...@apache.org>.
domhanak commented on PR #529:
URL: https://github.com/apache/incubator-kie-kogito-docs/pull/529#issuecomment-1956345675

   @jordigilh you are missing `nav.adoc` reference:
   `*** xref:cloud/operator/using-persistence.adoc[]`


-- 
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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [KOGITO-9982] Add persistence to SonataFlow CRD [incubator-kie-kogito-docs]

Posted by "jordigilh (via GitHub)" <gi...@apache.org>.
jordigilh commented on PR #529:
URL: https://github.com/apache/incubator-kie-kogito-docs/pull/529#issuecomment-1931648232

   I'll hold the PR until the development PR is merged.


-- 
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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [KOGITO-9982] Add persistence to SonataFlow CRD [incubator-kie-kogito-docs]

Posted by "kaldesai (via GitHub)" <gi...@apache.org>.
kaldesai commented on code in PR #529:
URL: https://github.com/apache/incubator-kie-kogito-docs/pull/529#discussion_r1480942680


##########
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

Review Comment:
   Here, is spec mean specification? 
   
   ```suggestion
   When the Platform CR is deployed with its persistence spec populated it enables workflows to leverage its configuration to populate the persistence
   ```



-- 
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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [KOGITO-9982] Add persistence to SonataFlow CRD [incubator-kie-kogito-docs]

Posted by "kaldesai (via GitHub)" <gi...@apache.org>.
kaldesai commented on code in PR #529:
URL: https://github.com/apache/incubator-kie-kogito-docs/pull/529#discussion_r1480941931


##########
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:

Review Comment:
   ```suggestion
   If your workflow requires recovery from such scenarios, you must make these additions to your Workflow CR:
   ```



-- 
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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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