Install the SonataFlow Operator
This guide describes how to install the SonataFlow Operator in a Kubernetes cluster. The operator is in an early development stage (community only) and has been tested on Kubernetes 1.22+, and Minikube.
-
A Kubernetes cluster with admin privileges. Alternatively, you can use Minikube or KIND.
-
kubectl
command-line tool is installed. Otherwise, Minikube provides it.
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 the CPUs and memory options so that your Minikube instance will have more resources. For example, use |
If Minikube 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 podman
Install the Kogito Serverless Workflow Operator
To install the Kogito Serverless Workflow Operator, you can use the following command:
kubectl create -f https://raw.githubusercontent.com/kiegroup/kogito-serverless-operator/v1.41.0/operator.yaml
You can follow the deployment of the Kogito Serverless Workflow Operator:
kubectl get pod -n sonataflow-operator-system --watch
A 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 20s
You can also follow the operator’s log:
kubectl logs deployment/sonataflow-operator-controller-manager -n sonataflow-operator-system -f
Once the operator is running, it will watch for instances of the Kogito Serverless Workflow Custom Resources (CR). Using CRs, you can configure your Kogito Serverless Workflow environment and define Workflows and builds to be handled by the operator.
For the operator to correctly manage the CR instances, you must first install the Kogito Serverless Workflow Custom Resource Definitions (CRDs). To check if the CRDs are correctly installed, try running:
kubectl get crds | grep sonataflow
sonataflowbuilds.sonataflow.org 2023-03-08T18:31:15Z
sonataflowplatforms.sonataflow.org 2023-03-08T18:31:15Z
sonataflows.sonataflow.org 2023-03-08T18:31:15Z
Uninstall the Operator
To uninstall the SonataFlow Operator, first, you must delete all the Kogito Serverless Workflow Custom Resources (CR) instances managed by it. Once the CRs are deleted, you can then delete all resources created during the operator installation.
To delete every CR managed by the operator 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-namespaces
Alternatively, 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.0
The 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!