This is an automated email from the ASF dual-hosted git repository.
ricardozanini pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-kie-kogito-docs.git
The following commit(s) were added to refs/heads/main by this push:
new 70426a52a Add a note about Knative deployment model in the operator
(#624)
70426a52a is described below
commit 70426a52a379528e29291da4042bc1d465e5e1f2
Author: Ricardo Zanini <[email protected]>
AuthorDate: Thu May 9 12:51:10 2024 -0300
Add a note about Knative deployment model in the operator (#624)
---
.../pages/cloud/operator/customize-podspec.adoc | 58 +++++++++++++++++++++-
.../ROOT/pages/cloud/operator/known-issues.adoc | 11 ----
2 files changed, 57 insertions(+), 12 deletions(-)
diff --git
a/serverlessworkflow/modules/ROOT/pages/cloud/operator/customize-podspec.adoc
b/serverlessworkflow/modules/ROOT/pages/cloud/operator/customize-podspec.adoc
index 7ec73c4b3..3fd4dd3eb 100644
---
a/serverlessworkflow/modules/ROOT/pages/cloud/operator/customize-podspec.adoc
+++
b/serverlessworkflow/modules/ROOT/pages/cloud/operator/customize-podspec.adoc
@@ -7,8 +7,11 @@
:k8s_resources_limits_url:
https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
:k8s_podspec_api_url:
https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.26/#podspec-v1-core
+:knative_serving_service_url:
https://github.com/knative/specs/blob/main/specs/serving/knative-api-specification-1.0.md#service
+:knative_serving_initcontainer:
https://knative.dev/docs/serving/configuration/feature-flags/#kubernetes-init-containers
+:kubernetes_init_containers:
https://kubernetes.io/docs/concepts/workloads/pods/init-containers/
-This document describes how to customize the pod specification definition in
thew `SonataFlow` custom resource.
+This document describes how to customize the pod specification definition in
the `SonataFlow` custom resource.
Sometimes you may have a specific requirement to deploy containers on
Kubernetes or OpenShift such as setting
link:{k8s_resources_limits_url}[Resource Limits].
@@ -49,6 +52,51 @@ The `.spec.podTemplate` attribute has the majority of fields
defined in the defa
The `.spec.podTemplate.container` is a special attribute that you won't find
in the default Kubernetes API. The reason is to avoid misconfiguration when
users require to change the specific container where the workflow application
is deployed.
+== Deployment Model
+
+By default, the {operator_name} deploys a `SonataFlow` instance in a regular
Kubernetes Deployment object. Although it's possible to change this behavior
and deploy the workflow instance as a
link:{knative_serving_service_url}[Knative Serving Service] instead.
+
+To change the deployment to Knative, set the
`.spec.podTemplate.deploymentModel` attribute to `knative`. For example:
+
+.Setting PodSpec Resources Limits example
+[source,yaml,subs="attributes+"]
+----
+apiVersion: sonataflow.org/v1alpha08
+kind: SonataFlow
+metadata:
+ name: simple
+ annotations:
+ sonataflow.org/description: Simple example on k8s!
+ sonataflow.org/version: 0.0.1
+ sonataflow.org/version: preview
+spec:
+ podTemplate:
+ deploymentModel: knative <1>
+ flow:
+ start: HelloWorld
+ states:
+ - name: HelloWorld
+ type: inject
+ data:
+ message: Hello World
+ end: true
+----
+
+<1> The `deploymentModel` attribute
+
+After changing the deployment model to `knative`, the `SonataFlow` instance
will be deployed as a Knative Serving Service.
+
+[IMPORTANT]
+====
+It's not possible to deploy a `SonataFlow` instance as a Knative Service in
dev profile. In this profile, this attribute is ignored by the operator.
+====
+
+Note that not every use case leverage a Knative deployment. Long-running
workflow instances, for example, that calls services that might take too long
to respond, might not be an ideal deployment model. Opt to use Knative
deployments for workflows that won't take too long to run.
+
+The exception are workflows that have callback states. In this case, you must
configure xref:cloud/operator/using-persistence.adoc[persistence]. This is
required because once the workflow waits for the event to resume the execution,
Knative will kill the pod. Since the workflow has persistence, it will resume
the execution once it receives the callback event.
+
+Knative **does not support**
link:{kubernetes_init_containers}[`initContainers`] by default. If your
workflow requires it, you must first enable the extension in the Knative
installation. See more information on the
link:{knative_serving_initcontainer}[Knative documentation].
+
== Customization Exceptions
Besides customizing the default container, you can add more `containers`,
`initContainers`, or `volumes` to the pod. There are a few exceptions listed
below:
@@ -167,3 +215,11 @@ It's advised that the SonataFlow `.spec.flow` definition
and the workflow built
====
xref:cloud/operator/known-issues.adoc[It's on the roadmap] to add integrity
check to the built images provided to the operator by customizing the default
container.
====
+
+== Additional resources
+
+* xref:cloud/operator/developing-workflows.adoc[]
+* xref:cloud/operator/build-and-deploy-workflows.adoc[]
+* xref:cloud/operator/building-custom-images.adoc[]
+
+include::../../../pages/_common-content/report-issue.adoc[]
\ No newline at end of file
diff --git
a/serverlessworkflow/modules/ROOT/pages/cloud/operator/known-issues.adoc
b/serverlessworkflow/modules/ROOT/pages/cloud/operator/known-issues.adoc
index b25a5efe0..b61c0e61f 100644
--- a/serverlessworkflow/modules/ROOT/pages/cloud/operator/known-issues.adoc
+++ b/serverlessworkflow/modules/ROOT/pages/cloud/operator/known-issues.adoc
@@ -20,29 +20,18 @@ The following issues are currently being prioritized:
=== Workflow Productization Profile
-- link:https://issues.redhat.com/browse/KOGITO-8524[Enable toggle Workflow CR
from devmode to production mode and vice-versa]
-- link:https://issues.redhat.com/browse/KOGITO-8792[Review build failures and
signal the reasoning in the Events API]
- link:https://issues.redhat.com/browse/KOGITO-8806[Evaluate internal registry
integration on OpenShift, Kubernetes and Minikube]
=== Knative Integration
- link:https://issues.redhat.com/browse/KOGITO-9812[SonataFlow Operator
integration with Knative Eventing]
-- link:https://issues.redhat.com/browse/KOGITO-8496[Knative Serving Extension
for Serverless Workflow specification]
-
-=== Kubernetes and OpenShift Integration
-
-- link:https://issues.redhat.com/browse/KOGITO-8493[Implement Serverless
Workflow custom function for OpenShift]
-- link:https://issues.redhat.com/browse/KOGITO-8492[Implement Serverless
Workflow custom function for Kubernetes]
=== Supporting Services
-- link:https://issues.redhat.com/browse/KOGITO-9740[Support Data Index
Deployment on Kubernetes]
-- link:https://issues.redhat.com/browse/KOGITO-9742[Support Jobs Service
Deployment on Kubernetes]
- link:https://issues.redhat.com/browse/KOGITO-9277[SonataFlow Operator and
Kubesmarts integration]
=== GitOps
-- link:https://issues.redhat.com/browse/KOGITO-9084[Enable Workflows
Deployment GitOps]
- link:https://issues.redhat.com/browse/KOGITO-9527[Extend the SonataFlow
Operator with Jib builder]
- link:https://issues.redhat.com/browse/KOGITO-9833[Add external built image
integrity validation]
- link:https://issues.redhat.com/browse/KOGITO-9845[Add .spec.resources mount
to a built image]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]