Uploaded image for project: 'Serverless logic'
  1. Serverless logic
  2. SRVLOGIC-227

KIE Tools - Fix resources generation prefix order


      We were mistakenly generating the CRs in an order that could spam two pods when deploying from kn workflow cli


      Given a workflow that uses schemas and resources, when we execute
      kn deploy --namespace cli

      We can see that the CLI produces the following command executions:

      đź›  Deploying your SonataFlow project in namespace cli
      configmap/01-multiplication-wf-resources created
      1) - ✅ Manifest 01-configmap_01-multiplication-wf-resources.yaml successfully deployed in namespace cli
      sonataflow.sonataflow.org/multiplication-wf created GOOD
      2) - ✅ Manifest 01-sonataflow_multiplication-wf.yaml successfully deployed in namespace cli
      configmap/02-multiplication-wf-resources created NOT GOOD
      3) - ✅ Manifest 02-configmap_02-multiplication-wf-resources.yaml successfully deployed in namespace cli
      configmap/multiplication-wf-props configured NOT GOOD
      4) - ✅ Manifest 03-configmap_multiplication-wf-props.yaml successfully deployed in namespace cli NOT GOOD

      The workflow is deployed and works, however, in the k8s management console we can see that two pods are created with their corresponding ReplicaSet.

      After investigation, we can see that the workflow is being deployed before, some of the required resources. In particular, note that 03-configmap_multiplication-wf-props.yaml, which defines the workflow user properties is deployed last. Not good.

      See explanation in the attached image.

      The fix consists of applying the same resources, but, first all the config maps, and lastly the workflow.
      note: the wf is undeployed, we must do in the reverse order, wf first, and configmaps after.

      For the record, the issue can be reproduced if you generate the manifests, executing
      kn gen-manifest --namespace cli



            wmedvede@redhat.com Walter Medvedeo
            wmedvede@redhat.com Walter Medvedeo
            Dominik Hanak Dominik Hanak
            0 Vote for this issue
            2 Start watching this issue