Install the SonataFlow Operator
This guide describes how to install the SonataFlow Operator in a Kubernetes or OpenShift cluster. The operator is in an early development stage (community only) and has been tested on OpenShift 4.11+, Kubernetes 1.22+, and Minikube.
- 
A Kubernetes or OpenShift cluster with admin privileges. Alternatively, you can use Minikube or KIND. 
- 
kubectlcommand-line tool is installed. Otherwise, Minikube provides it.
SonataFlow Operator OpenShift installation
To install the operator on OpenShift refer to the "Adding Operators to a cluster" from the OpenShift’s documentation.
When searching for the operator in the Filter by keyword field, use the word sonataflow. If you’re installing from the CLI, the operator’s catalog name is sonataflow-operator.
Uninstall
To remove the operator on OpenShift refer to the "Deleting Operators from a cluster" from the OpenShift’s documentation.
SonataFlow Operator Kubernetes installation
To install the operator on Kubernetes refer to the "How to install an Operator from OperatorHub.io" from the OperatorHub’s documentation.
When searching for the operator in the Search OperatorHub field, use the word sonataflow.
Uninstall
To remove the operator on Kubernetes follow the document "Uninstall your operator" from the OLM’s documentation.
When searching for the subscription to remove, use the word my-sonataflow-operator.
SonataFlow Operator Manual Installation
| If you’re running on Kubernetes or OpenShift, it is highly recommended to install the operator from the OperatorHub or OpenShift Console instead since the installation is managed by OLM. Use this method only if you need a snapshot version or you’re running locally on Minikube or KIND. | 
Prepare a Minikube instance
| You can safely skip this section if you’re not using Minikube. | 
- 
A machine with at least 8GB memory and a CPU with 8 cores 
- 
Docker or Podman installed 
Run the following command to create a new instance capable of installing the operator and deploy workflows:
minikube start --cpus 4 --memory 4096 --addons registry --addons metrics-server --insecure-registry "10.0.0.0/24" --insecure-registry "localhost:5000"| To speed up the build time, you can increase CPUs and memory options so that your minikube instance will have more resources. For example, use  | 
If it does not work with the default driver, also known as docker, you can try to start with the podman driver as follows:
minikube start [...] --driver podmanInstall
In order to have an up-and-running instance of the SonataFlow Operator you can use the following command:
kubectl create -f https://raw.githubusercontent.com/kiegroup/kogito-serverless-operator/v1.40.0/operator.yamlYou can follow the deployment of the SonataFlow Operator:
kubectl get pod -n sonataflow-operator-system --watchA successful installation should have an output like this:
NAME                                                     READY   STATUS              RESTARTS   AGE
sonataflow-operator-controller-manager-948547ffd-sr2j2   0/2     ContainerCreating   0          6s
sonataflow-operator-controller-manager-948547ffd-sr2j2   1/2     Running             0          7s
sonataflow-operator-controller-manager-948547ffd-sr2j2   2/2     Running             0          20sYou can also follow the operator’s log:
kubectl logs deployment/sonataflow-operator-controller-manager -n sonataflow-operator-system -fOnce the operator is running, it will watch for new custom resources (CR) so that you can prepare your environment to be ready to create a new SonataFlow application based on the definitions you will send to the operator.
Uninstall
To uninstall the SonataFlow Operator, first you should remove all the object instances managed by it. Then, you can delete every object created during the installation.
To delete every object instance managed by the workflow in your cluster, you can run these series of commands:
kubectl delete --all workflow --all-namespaces
kubectl delete --all sonataflowbuild --all-namespaces
kubectl delete --all sonataflowplatform --all-namespacesAlternatively, if you created everything under the same namespace, deleting the given namespace has the same outcome.
To uninstall the correct version of the operator, first you must get the current version by running:
kubectl get deployment sonataflow-operator-controller-manager -n sonataflow-operator-system -o jsonpath="{.spec.template.spec.containers[?(@.name=='manager')].image}"
quay.io/kiegroup/kogito-serverless-operator-nightly:1.41.0The operator manager image reflects the current operator’s version. Replace the major and minor version names in the command below. For example, if the image version is 1.41.0 use 1.41 in the placeholder:
kubectl delete -f https://raw.githubusercontent.com/kiegroup/kogito-serverless-operator/<version>.x/operator.yaml| If you’re running a snapshot version, use this URL instead  | 
Found an issue?
If you find an issue or any misleading information, please feel free to report it here. We really appreciate it!