Supporting Services

By default, workflows use an embedded version of Data Index. This document describes how to deploy supporting services, like Data Index, on a cluster using the Serverless Logic Operator.

Serverless Logic Operator is under active development with features yet to be implemented. Please see Serverless Logic Operator Known Issues, Limitations and Roadmap.

Prerequisites

Deploy supporting services

Data Index

You can deploy Data Index via SonataFlowPlatform configuration. The operator will then configure all new workflows, with the "prod" profile, to use that Data Index.

Following is a basic configuration. It will deploy an ephemeral Data Index to the same namespace as the SonataFlowPlatform.

Example of a SonataFlowPlatform instance with an ephemeral Data Index deployment
apiVersion: sonataflow.org/v1alpha08
kind: SonataFlowPlatform
metadata:
  name: sonataflow-platform
spec:
  services:
    dataIndex: {}

If you require Data Index persistence, this can be done with a postgresql database. Unresolved include directive in modules/serverless-logic/pages/cloud/operator/supporting-services.adoc - include::../../../../pages/_common-content/downstream-project-setup-instructions.adoc[]

Following is a services configuration with the persistence option enabled. You’ll first need to create a secret with your database credentials.

Create a Secret for datasource authentication.
kubectl create secret generic <creds-secret> --from-literal=POSTGRESQL_USER=<user> --from-literal=POSTGRESQL_PASSWORD=<password> -n workflows
Example of a SonataFlowPlatform instance with a Data Index deployment persisted to a postgresql database
apiVersion: sonataflow.org/v1alpha08
kind: SonataFlowPlatform
metadata:
  name: sonataflow-platform
spec:
  services:
    dataIndex:
      persistence:
        postgresql:
          secretRef:
            name: <creds-secret> (1)
          serviceRef:
            name: <postgresql-service> (2)
1 Name of your postgresql credentials secret
2 Name of your postgresql k8s service
Example of a SonataFlowPlatform instance with a persisted Data Index deployment and custom pod configuration
apiVersion: sonataflow.org/v1alpha08
kind: SonataFlowPlatform
metadata:
  name: sonataflow-platform
spec:
  services:
    dataIndex:
      enabled: false (1)
      persistence:
        postgresql:
          secretRef:
            name: <creds-secret>
            userKey: <secret-user-key> (2)
          jdbcUrl: "jdbc:postgresql://host:port/database?currentSchema=data-index-service" (3)
      podTemplate:
        replicas: 1 (4)
        container:
          image: <image:tag> (5)
1 Determines whether "prod" profile workflows should be configured to use this service, defaults to true
2 Secret key of your postgresql credentials user, defaults to POSTGRESQL_USER
3 PostgreSql JDBC URL
4 Number of Data Index pods, defaults to 1
5 Custom Data Index container image name

Cluster-Wide Supporting Services

The SonataFlowClusterPlatform CR is optionally used to specify a cluster-wide set of supporting services for workflow consumption. This is done by referencing an existing, namespaced SonataFlowPlatform resource.

Following is a basic configuration. It will allow workflows cluster-wide to leverage whatever supporting services are configured in the chosen "central" namespace.

Example of a basic SonataFlowClusterPlatform CR
apiVersion: sonataflow.org/v1alpha08
kind: SonataFlowClusterPlatform
metadata:
  name: cluster-platform
spec:
  platformRef:
    name: sonataflow-platform
    namespace: <central namespace>

These cluster-wide services can be overridden in any namespace, by configuring that namespace’s SonataFlowPlatform.spec.services.

Found an issue?

If you find an issue or any misleading information, please feel free to report it here. We really appreciate it!