Skip to content

Commit

Permalink
[KOGITO-9218] - Update SonataFlowPlatform struct (#427)
Browse files Browse the repository at this point in the history
* [KOGITO-9218] - Update SonataFlowPlatform struct

Signed-off-by: Ricardo Zanini <zanini@redhat.com>

* Adding migration guide for 1.43.0

Signed-off-by: Ricardo Zanini <zanini@redhat.com>

* Update serverlessworkflow/modules/ROOT/pages/cloud/operator/build-and-deploy-workflows.adoc

Co-authored-by: Kalyani Desai <43639538+kaldesai@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Kalyani Desai <43639538+kaldesai@users.noreply.github.com>

* Update index.adoc

---------

Signed-off-by: Ricardo Zanini <zanini@redhat.com>
Co-authored-by: Tristan Radisson <tristan.radisson@gmail.com>
Co-authored-by: Kalyani Desai <43639538+kaldesai@users.noreply.github.com>
  • Loading branch information
3 people committed Aug 11, 2023
1 parent e2a45e9 commit 96ff36c
Show file tree
Hide file tree
Showing 5 changed files with 136 additions and 22 deletions.
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 @@ -221,7 +221,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
----

0 comments on commit 96ff36c

Please sign in to comment.