7.2. Configuring persistence using the SonataFlow CR


The SonataFlow custom resource (CR) enables workflow-specific persistence configuration. You can use this configuration independently, even if SonataFlowPlatform persistence is already set up in the current namespace.

Procedure

  • Configure persistence by using the persistence field in the SonataFlow CR specification as shown in the following example:
apiVersion: sonataflow.org/v1alpha08
kind: SonataFlow
metadata:
  name: example-workflow
  annotations:
    sonataflow.org/description: Example Workflow
    sonataflow.org/version: 0.0.1
spec:
  persistence:
    postgresql:
      serviceRef:
        name: postgres-example 
1

        namespace: postgres-example-namespace 
2

        databaseName: example-database 
3

        databaseSchema: example-schema 
4

        port: 1234 
5

      secretRef:
        name: postgres-secrets-example 
6

        userKey: POSTGRESQL_USER 
7

        passwordKey: POSTGRESQL_PASSWORD 
8

  flow:
1
Name of the Kubernetes Service that connects to the PostgreSQL database server.
2
Optional: Namespace containing the PostgreSQL Service. Defaults to the workflow namespace.
3
Name of the PostgreSQL database where workflow data is stored.
4
Optional: Name of the database schema for workflow data. Defaults to the workflow name.
5
Optional: Port to connect to the PostgreSQL Service. Defaults to 5432.
6
Name of the Kubernetes Secret containing database credentials.
7
Key in the Secret object containing the database username.
8
Key in the Secret object containing the database password.

This configuration informs the OpenShift Serverless Logic Operator that the workflow must connect to the specified PostgreSQL database server when deployed. The OpenShift Serverless Logic Operator adds the relevant JDBC connection parameters as environment variables to the workflow container.

참고

PostgreSQL is currently the only supported database for persistence.

For SonataFlow CR deployments using the preview profile, the OpenShift Serverless Logic build system includes the required Quarkus extensions to enable persistence automatically.

Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 문서 정보

Legal Notice

Theme

© 2026 Red Hat
맨 위로 이동