|
3 | 3 | [id="proc-deploying-workflows-on-a-cluster.adoc_{context}"] |
4 | 4 | = Deploying workflows on a cluster |
5 | 5 |
|
| 6 | +You can now deploy the workflow on a cluster, since the image has been pushed to the image registry and the deployment manifests are available. |
| 7 | + |
6 | 8 | .Prerequisites |
7 | 9 |
|
8 | | -* You have an OpenShift Container Platform (OCP) cluster with the following versions of components installed: |
| 10 | +* You have an {ocp-short} cluster with the following versions of components installed: |
| 11 | + |
| 12 | +* {product} ({product-very-short}) `v1.5` |
| 13 | +* Orchestrator plugins `v1.4` or `v1.5` |
| 14 | +* OpenShift Serverless `v1.35` |
| 15 | +* OpenShift Serverless Logic `v1.35` |
| 16 | + |
| 17 | +For further instructions on installing these components, see {orchestrator-book-link}#con-orchestrator-plugin-components[Orchestrator plugin components on {ocp-short}]. |
| 18 | + |
| 19 | +* You must apply the workflow manifests in a namespace that contains a `SonataflowPlatform` custom resource (CR), which manages the link:https://sonataflow.org/serverlessworkflow/latest/cloud/operator/supporting-services.html[supporting services]. By default, OpenShift Serverless Logic services are installed in the `sonataflow-infra` namespace. |
| 20 | + |
| 21 | +.Procedure |
| 22 | + |
| 23 | +. Use the `kubectl create` command specifying the target namespace to apply the Kubernetes manifests as shown in the following example: |
| 24 | ++ |
| 25 | +[source,bash] |
| 26 | +---- |
| 27 | +kubectl create -n sonataflow-infra -f ./01_basic/manifests/. |
| 28 | +---- |
| 29 | + |
| 30 | +. After deployment, monitor the status of the workflow pods as shown in the following example: |
| 31 | ++ |
| 32 | +[source,yaml] |
| 33 | +---- |
| 34 | +kubectl get pods -n sonataflow-infra -l app=basic |
| 35 | +---- |
| 36 | ++ |
| 37 | +The pod may initially appear in an `Error` state because of missing or incomplete configuration in the Secret or ConfigMap. |
| 38 | + |
| 39 | +. Inspect the pod logs as shown in the following example: |
| 40 | ++ |
| 41 | +[source,yaml] |
| 42 | +---- |
| 43 | +oc logs -n sonataflow-infra basic-f7c6ff455-vwl56 |
| 44 | +---- |
| 45 | ++ |
| 46 | +The following is an example of the output: |
| 47 | ++ |
| 48 | +[source,yaml] |
| 49 | +---- |
| 50 | +SRCFG00040: The config property quarkus.openapi-generator.notifications.auth.BearerToken.bearer-token is defined as the empty String ("") which the following Converter considered to be null: io.smallrye.config.Converters$BuiltInConverter |
| 51 | +java.lang.RuntimeException: Failed to start quarkus |
| 52 | +... |
| 53 | +Caused by: io.quarkus.runtime.configuration.ConfigurationException: Failed to read configuration properties |
| 54 | +---- |
| 55 | ++ |
| 56 | +The error indicates a missing property: `quarkus.openapi-generator.notifications.auth.BearerToken.bearer-token`. |
| 57 | + |
| 58 | +. In such a case where the logs show the `ConfigurationException: Failed to read configuration properties` error or indicate a missing value, complete the following tasks: |
| 59 | ++ |
| 60 | +* Retrieve the ConfigMap as shown in the following example: |
| 61 | ++ |
| 62 | +[source,yaml] |
| 63 | +---- |
| 64 | +oc get -n sonataflow-infra configmaps basic-props -o yaml |
| 65 | +---- |
| 66 | ++ |
| 67 | +The sample output looks as in the following example: |
| 68 | ++ |
| 69 | +[source,yaml] |
| 70 | +---- |
| 71 | +apiVersion: v1 |
| 72 | +data: |
| 73 | + application.properties: | |
| 74 | + # Backstage Notifications service |
| 75 | + quarkus.rest-client.notifications.url=${BACKSTAGE_NOTIFICATIONS_URL} |
| 76 | + quarkus.openapi-generator.notifications.auth.BearerToken.bearer-token=${NOTIFICATIONS_BEARER_TOKEN} |
| 77 | +... |
| 78 | +---- |
| 79 | ++ |
| 80 | +The placeholders must be resolved using values provided using a Secret. |
| 81 | + |
| 82 | +. You must edit the corresponding Secret and provide appropriate base64-encoded values to resolve the placeholders in `application.properties` as shown in the following example: |
| 83 | ++ |
| 84 | +[source,yaml] |
| 85 | +---- |
| 86 | +kubectl edit secrets -n sonataflow-infra basic-secrets |
| 87 | +---- |
| 88 | +. Restart the workflow Pod for Secret changes to take effect in OpenShift Serverless Logic `v1.35`. |
| 89 | + |
| 90 | +.Verification |
| 91 | + |
| 92 | +. Verify the deployment status by checking the pods again as shown in the following example: |
| 93 | ++ |
| 94 | +[source,yaml] |
| 95 | +---- |
| 96 | +oc get pods -n sonataflow-infra -l app=basic |
| 97 | +---- |
| 98 | ++ |
| 99 | +The expected status for a successfully deployed workflow Pod is as shown in the following example: |
| 100 | ++ |
| 101 | +[source,yaml] |
| 102 | +---- |
| 103 | +NAME READY STATUS RESTARTS AGE |
| 104 | +basic-f7c6ff455-grkxd 1/1 Running 0 47s |
| 105 | +---- |
| 106 | + |
| 107 | +. Once the pod is in the `Running` state, the workflow now appears in the Orchestrator plugin inside {product}. |
9 | 108 |
|
10 | | -* {product} ({product-very-short}) v1.5 |
11 | | -* Orchestrator plugins v1.4 or v1.5 |
12 | | -* OpenShift Serverless v1.35 |
13 | | -* OpenShift Serverless Logic v1.35 |
| 109 | +.Next steps |
| 110 | +* Inspect the provided build script to extract the actual steps and implement them in your preferred CI/CD tool for example GitHub Actions, GitLab CI, Jenkins and Tekton. |
0 commit comments