Set recommended kubernetes labels on services and workflows (#482)

Motivation:
There's a need to select efficiently workflows and their respective
services. Having the common kubernetes labels allow a single selector:

   podSelector:
     matchExpressions:
       - { key: app.kubernetes.io/component, operator: In, values:
         ["data-index-service", "jobs-service", "serverless-workflow"] }

Modification:
Make the v1.Deployment for services and the deployment or knative
services to contain at common labels

Result:
A workflow deployment or knative serving labels:
    app.kubernetes.io/name: ${workflow name}
    app.kubernetes.io/component: serverless-workflow
    app.kubernetes.io/part-of: ${platform url set by status}
    app.kubernetes.io/managed-by: sonataflow-operator

Data index or Jobs services Deployment.v1 labels:

    app.kubernetes.io/name: ${service name}
    app.kubernetes.io/component: data-index-service|jobs-service
    app.kubernetes.io/part-of: ${platform name}
    app.kubernetes.io/managed-by: sonataflow-operator

Reference: https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/#labels

Signed-off-by: Roy Golan <rgolan@redhat.com>
16 files changed
tree: 4bcd361205c20a895358574fe82ea73178ddccc6
  1. .ci/
  2. .github/
  3. api/
  4. bddframework/
  5. bundle/
  6. config/
  7. container-builder/
  8. controllers/
  9. docs/
  10. hack/
  11. images/
  12. log/
  13. tekton/
  14. test/
  15. testbdd/
  16. utils/
  17. version/
  18. workflowproj/
  19. .asf.yaml
  20. .gitignore
  21. go.mod
  22. go.sum
  23. go.work
  24. go.work.sum
  25. LICENSE
  26. main.go
  27. Makefile
  28. operator.yaml
  29. PROJECT
  30. README.md
README.md

SonataFlow Operator

The SonataFlow Operator defines a set of Kubernetes Custom Resources to help users to deploy SonataFlow projects on Kubernetes and OpenShift.

Please visit our official documentation to know more.

Available modules for integrations

If you're a developer, and you are interested in integrating your project or application with the SonataFlow Operator ecosystem, this repository provides a few Go Modules described below.

SonataFlow Operator Types (api)

Every custom resource managed by the operator is exported in the module api. You can use it to programmatically create any custom type managed by the operator. To use it, simply run:

go get github.com/kiegroup/kogito-serverless-workflow/api

Then you can create any type programmatically, for example:

workflow := &v1alpha08.SonataFlow{
ObjectMeta: metav1.ObjectMeta{Name: w.name, Namespace: w.namespace},
Spec:       v1alpha08.SonataFlowSpec{Flow: *myWorkflowDef>}
}

You can use the Kubernetes client-go library to manipulate these objects in the cluster.

You might need to register our schemes:

    s := scheme.Scheme
utilruntime.Must(v1alpha08.AddToScheme(s))

Container Builder (container-builder)

Please see the module's README file.

Workflow Project Handler (workflowproj)

Please see the module's README file.

Development and Contributions

Contributing is easy, just take a look at our contributors'guide.

Productization notes

In order to productize the Red Hat OpenShift Serverless Logic Operator read the notes into the productization'section.