Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[KOGITO-9218] - Update SonataFlowPlatform struct #427

Merged
merged 5 commits into from
Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions serverlessworkflow/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
*** xref:cloud/operator/build-and-deploy-workflows.adoc[Building and Deploying Workflow Images]
*** xref:cloud/operator/workflow-status-conditions.adoc[Custom Resource Status]
*** xref:cloud/operator/known-issues.adoc[Known Issues]
*** xref:cloud/operator/migration-guide.adoc[]
** Quarkus
*** xref:cloud/quarkus/build-workflow-image-with-quarkus-cli.adoc[Building Workflow Images]
*** xref:cloud/quarkus/deploying-on-minikube.adoc[Deploying on Minikube]
Expand Down
10 changes: 9 additions & 1 deletion serverlessworkflow/modules/ROOT/pages/cloud/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ xref:cloud/operator/known-issues.adoc[]
Learn about the known issues and feature roadmap of the {operator_name}
--

[.card]
--
[.card-title]
xref:cloud/operator/migration-guide.adoc[]
[.card-description]
Migration guides
--

[.card-section]
== Kubernetes with Quarkus

Expand Down Expand Up @@ -120,4 +128,4 @@ Learn how to deploy your workflow application on Minikube for local tests and de
xref:cloud/quarkus/deploying-on-kubernetes.adoc[Deploying your {product_name} application on Kubernetes]
[.card-description]
Learn how to deploy your workflow application on Kubernetes
--
--
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ By default, the operator will use the image distributed upstream to run the work
[source,bash,subs="attributes+"]
----
# use `kubectl get sonataflowplatform` to get the SonataFlowPlatform name
kubectl patch sonataflowplatform <name> --patch 'spec:\n plaform:\n baseImage: <your new image full name with tag>' -n <your_namespace>
kubectl patch sonataflowplatform <name> --patch 'spec:\n build:\n config:\n baseImage: <your new image full name with tag>' -n <your_namespace>
----

=== Customize the base build Dockerfile
Expand Down Expand Up @@ -93,13 +93,14 @@ metadata:
name: sonataflow-platform
spec:
build:
resources:
requests:
memory: "64Mi"
cpu: "250m"
limits:
memory: "128Mi"
cpu: "500m"
template:
resources:
requests:
memory: "64Mi"
cpu: "250m"
limits:
memory: "128Mi"
cpu: "500m"
----

Every build process will reuse this configuration and start new instances based on it from now on.
Expand All @@ -120,10 +121,10 @@ metadata:
name: my-workflow
spec:
resources:
requests:
requests:
memory: "64Mi"
cpu: "250m"
limits:
limits:
memory: "128Mi"
cpu: "500m"
----
Expand Down Expand Up @@ -197,12 +198,13 @@ kind: SonataFlowPlatform
metadata:
name: sonataflow-platform
spec:
platform:
buildStrategyOptions:
KanikoBuildCacheEnabled: "true"
registry:
address: quay.io/kiegroup <1>
secret: regcred <2>
build:
config:
strategyOptions:
KanikoBuildCacheEnabled: "true"
registry:
address: quay.io/kiegroup <1>
secret: regcred <2>
----

<1> Your registry address
Expand All @@ -218,14 +220,15 @@ kind: SonataFlowPlatform
metadata:
name: sonataflow-platform
spec:
platform:
buildStrategyOptions:
KanikoBuildCacheEnabled: "true"
build:
config:
strategyOptions:
KanikoBuildCacheEnabled: "true"
----

[TIP]
====
The `spec.platform.buildStrategyOptions.KanikoBuildCacheEnabled` enables the internal Kaniko process to cache builder images to try to speed up the bulding execution.
The `spec.build.config.strategyOptions.KanikoBuildCacheEnabled` enables the internal Kaniko process to cache builder images to try to speed up the building execution.
====

You can save this file locally and run the following command:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ By default, the operator will use the image distributed upstream to run the work
[source,bash,subs="attributes+"]
----
# use `kubectl get sonataflowplatform` to get the SonataFlowPlatform name
kubectl patch sonataflowplatform <name> --patch 'spec:\n devBaseImage: <your new image full name with tag>' -n <your_namespace>
kubectl patch sonataflowplatform <name> --patch 'spec:\n devMode:\n baseImage: <your new image full name with tag>' -n <your_namespace>
----

From now on, every deployment in the development profile will use this image to run the workflow.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# Migration Guide

## Version 1.43.0

When migrating to version 1.43.0, you must review the `SonataFlowPlatform` instances.

.Procedure

1. Change the `.spec.platform` to `.spec.build.config`. For example, given that you have:
+
[source,yaml,subs="attributes+"]
----
apiVersion: sonataflow.org/v1alpha08
kind: SonataFlowPlatform
metadata:
name: sonataflow-platform
spec:
platform:
registry:
address: quay.io/kiegroup
secret: regcred
----
+
You should change it to:
+
[source,yaml,subs="attributes+"]
----
apiVersion: sonataflow.org/v1alpha08
kind: SonataFlowPlatform
metadata:
name: sonataflow-platform
spec:
build:
config:
registry:
address: quay.io/kiegroup
secret: regcred
----

2. Change the `.spec.build` to `.spec.build.template`. For example, given that you have:
+
[source,yaml,subs="attributes+"]
----
apiVersion: sonataflow.org/v1alpha08
kind: SonataFlowPlatform
metadata:
name: sonataflow-platform
spec:
build:
resources:
requests:
memory: "64Mi"
cpu: "250m"
limits:
memory: "128Mi"
cpu: "500m"
----
+
You should change it to:
+
[source,yaml,subs="attributes+"]
----
apiVersion: sonataflow.org/v1alpha08
kind: SonataFlowPlatform
metadata:
name: sonataflow-platform
spec:
build:
template:
resources:
requests:
memory: "64Mi"
cpu: "250m"
limits:
memory: "128Mi"
cpu: "500m"
----

3. Change the `.spec.devModeBaseImage` to `spec.devMode.baseImage`. For example, given that you have:
+
[source,yaml,subs="attributes+"]
----
apiVersion: sonataflow.org/v1alpha08
kind: SonataFlowPlatform
metadata:
name: sonataflow-platform
spec:
devModeBaseImage: quay.io/johndoe/myworkflow:latest
----
+
You should change it to:
+
[source,yaml,subs="attributes+"]
----
apiVersion: sonataflow.org/v1alpha08
kind: SonataFlowPlatform
metadata:
name: sonataflow-platform
spec:
devMode:
baseImage: quay.io/johndoe/myworkflow:latest
----