Skip to content

Commit

Permalink
Update charts to version 0.2.8
Browse files Browse the repository at this point in the history
Signed-off-by: Jordi Gil <jgil@redhat.com>
  • Loading branch information
jordigilh committed Mar 26, 2024
1 parent 0804a16 commit 807f1bd
Show file tree
Hide file tree
Showing 18 changed files with 217 additions and 575 deletions.
9 changes: 8 additions & 1 deletion config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -220,5 +220,12 @@ rules:
- patch
- update
- watch

- apiGroups:
- argoproj.io
resources:
- appprojects
verbs:
- get
- create
- list
#+kubebuilder:scaffold:rules
2 changes: 1 addition & 1 deletion helm-charts/orchestrator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.32
version: 0.2.8

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
40 changes: 19 additions & 21 deletions helm-charts/orchestrator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,27 @@ The following table lists the configurable parameters of the Orchestrator chart
| Parameter | Description | Default |
| ------------------------ | ----------------------- | -------------- |
| `sonataFlowOperator.enabled` | whether the operator should be deployed by the chart | `true` |
| `sonataFlowOperator.subscription.namespace` | namespace where the operator should be deployed | `"openshift-operators"` |
| `sonataFlowOperator.subscription.namespace` | namespace where the operator should be deployed | `"openshift-serverless-logic"` |
| `sonataFlowOperator.subscription.channel` | channel of an operator package to subscribe to | `"alpha"` |
| `sonataFlowOperator.subscription.installPlanApproval` | whether the update should be installed automatically | `"Automatic"` |
| `sonataFlowOperator.subscription.pkgName` | name of the operator package | `"sonataflow-operator"` |
| `sonataFlowOperator.subscription.sourceImage` | catalog image of the development build. Unset it for the release build. | `"quay.io/masayag/kogito-serverless-operator-catalog:v999.0.0-snapshot"` |
| `sonataFlowOperator.subscription.sourceNamespace` | namespace of the catalog source | `"openshift-marketplace"` |
| `sonataFlowOperator.subscription.source` | name of the catalog source for the operator | `"sonataflow-operator"` |
| `sonataFlowOperator.subscription.name` | name of the operator package | `"logic-operator-rhel8"` |
| `serverlessOperator.enabled` | whether the operator should be deployed by the chart | `true` |
| `serverlessOperator.subscription.namespace` | namespace where the operator should be deployed | `"openshift-serverless"` |
| `serverlessOperator.subscription.channel` | channel of an operator package to subscribe to | `"stable"` |
| `serverlessOperator.subscription.installPlanApproval` | whether the update should be installed automatically | `"Automatic"` |
| `serverlessOperator.subscription.pkgName` | name of the operator package | `"serverless-operator"` |
| `serverlessOperator.subscription.sourceNamespace` | namespace of the catalog source | `"openshift-marketplace"` |
| `serverlessOperator.subscription.name` | name of the operator package | `"serverless-operator"` |
| `rhdhOperator.enabled` | whether the operator should be deployed by the chart | `true` |
| `rhdhOperator.github.token` | | `""` |
| `rhdhOperator.github.clientId` | | `""` |
| `rhdhOperator.github.clientSecret` | | `""` |
| `rhdhOperator.subscription.namespace` | namespace where the operator should be deployed | `"backstage-system"` |
| `rhdhOperator.subscription.channel` | channel of an operator package to subscribe to | `"alpha"` |
| `rhdhOperator.github.token` | An authentication token as expected by GitHub. Required for importing resource to the catalog, launching software templates and more. | `""` |
| `rhdhOperator.github.clientId` | The client ID that you generated on GitHub, for GitHub authentication (requires GitHub App). | `""` |
| `rhdhOperator.github.clientSecret` | The client secret tied to the generated client ID. | `""` |
| `rhdhOperator.k8s.clusterToken` | Kubernetes API bearer token used for authentication. | `""` |
| `rhdhOperator.k8s.clusterUrl` | API url of the kubernetes cluster | `""` |
| `rhdhOperator.subscription.namespace` | namespace where the operator should be deployed | `"rhdh-operator"` |
| `rhdhOperator.subscription.channel` | channel of an operator package to subscribe to | `"fast"` |
| `rhdhOperator.subscription.installPlanApproval` | whether the update should be installed automatically | `"Automatic"` |
| `rhdhOperator.subscription.pkgName` | name of the operator package | `"backstage-operator"` |
| `rhdhOperator.subscription.sourceImage` | | `"quay.io/janus-idp/operator-catalog:0.1.0"` |
| `rhdhOperator.subscription.sourceNamespace` | namespace of the catalog source | `"openshift-marketplace"` |
| `rhdhOperator.subscription.source` | name of the catalog source for the operator | `"rhdh-operator"` |
| `postgres.serviceName` | The name of the Postgres DB service to be used by dataindex and job service. Cannot be empty. | `"sonataflow-psql-postgresql"` |
| `postgres.serviceNamespace` | The namespace of the Postgres DB service to be used by dataindex and job service. | `"sonataflow-infra"` |
| `rhdhOperator.subscription.name` | name of the operator package | `"rhdh"` |
| `postgres.serviceName` | The name of the Postgres DB service to be used by platform services. Cannot be empty. | `"sonataflow-psql-postgresql"` |
| `postgres.serviceNamespace` | The namespace of the Postgres DB service to be used by platform services. | `"sonataflow-infra"` |
| `postgres.authSecret.name` | name of existing secret to use for PostgreSQL credentials. | `"sonataflow-psql-postgresql"` |
| `postgres.authSecret.userKey` | name of key in existing secret to use for PostgreSQL credentials. | `"postgres-username"` |
| `postgres.authSecret.passwordKey` | name of key in existing secret to use for PostgreSQL credentials. | `"postgres-password"` |
Expand All @@ -49,9 +44,12 @@ The following table lists the configurable parameters of the Orchestrator chart
| `orchestrator.sonataPlatform.resources.requests.cpu` | | `"250m"` |
| `orchestrator.sonataPlatform.resources.limits.memory` | | `"1Gi"` |
| `orchestrator.sonataPlatform.resources.limits.cpu` | | `"500m"` |
| `orchestrator.sonataPlatform.dataIndex.image` | To be removed when stable version is released | `"quay.io/kiegroup/kogito-data-index-postgresql-nightly:latest"` |
| `orchestrator.sonataPlatform.jobService.image` | To be removed when stable version is released | `"quay.io/kiegroup/kogito-jobs-service-postgresql-nightly:latest"` |
| `orchestrator.sonataflows` | workflows to get deployed - this option will be removed once the plugin will interact directly with the data-index | `[{"name": "greeting", "image": "quay.io/orchestrator/serverless-workflow-greeting:latest"}]` |
| `tekton.enabled` | whether to create the Tekton pipeline resources | `false` |
| `argocd.enabled` | whether to install the ArgoCD plugin and create the AppProject | `false` |
| `argocd.url` | | `""` |
| `argocd.namespace` | | `"argocd"` |
| `argocd.username` | | `"admin"` |
| `argocd.password` | | `""` |



Expand Down
9 changes: 6 additions & 3 deletions helm-charts/orchestrator/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ SonataFlow Operator {{ $sonataFlowOperatorInstalled }} {{ .Value
SonataFlowPlatform {{ $sonataFlowPlatformInstalled }} {{ .Values.orchestrator.namespace }}
Data Index Service {{ $sonataFlowPlatformInstalled }} {{ .Values.orchestrator.namespace }}
Job Service {{ $sonataFlowPlatformInstalled }} {{ .Values.orchestrator.namespace }}
Tekton pipeline {{ $tektonPipelineInstalled }} {{ .Values.orchestrator.namespace }}
Tekton task {{ $tektonTaskInstalled }} {{ .Values.orchestrator.namespace }}
Tekton pipeline {{ $tektonPipelineInstalled }} {{ .Values.argocd.namespace }}
Tekton task {{ $tektonTaskInstalled }} {{ .Values.argocd.namespace }}
ArgoCD project {{ $argocdInstalled }} {{ .Values.argocd.namespace }}
{{/* Empty line */}}
====================================================================
Expand Down Expand Up @@ -94,7 +94,7 @@ Run the following commands to wait until the services are ready:
oc wait -n knative-serving knativeserving/knative-serving --for=condition=Ready {{ $timeout }}
{{- end }}
{{- if eq $sonataFlowOperatorInstalled $yes }}
oc wait -n {{ .Values.sonataFlowOperator.subscription.namespace }} deploy/sonataflow-operator-controller-manager --for=condition=Available {{ $timeout }}
oc wait -n {{ .Values.sonataFlowOperator.subscription.namespace }} deploy/logic-operator-rhel8-controller-manager --for=condition=Available {{ $timeout }}
{{- end }}
{{- if eq $sonataFlowPlatformInstalled $yes }}
oc wait -n {{ .Values.orchestrator.namespace }} sonataflowplatform/sonataflow-platform --for=condition=Succeed {{ $timeout }}
Expand All @@ -112,3 +112,6 @@ Run the following commands to wait until the services are ready:
oc wait -n {{ .Values.rhdhOperator.subscription.namespace }} backstage backstage --for=condition=Deployed=True
oc wait -n {{ .Values.rhdhOperator.subscription.namespace }} deploy/backstage-backstage --for=condition=Available {{ $timeout }}
{{- end }}

In case of a CR deployment failure, check the logs of the pods created by the corresponding job to deploy the failed CRs instance. The jobs are always
deleted after the deployment of the chart is completed.
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{{- if .Values.sonataFlowOperator.enabled }}
{{- define "delete-cr-on-uninstall" }}
{{ $resourceAPIGroup := printf "%s.%s" .kind .apiGroup }}
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ .Release.Name }}-sonataflow-hook-cleanup
namespace: {{ .Release.Namespace }}
name: {{ printf "%s-%s-cleanup" .releaseName .kind }}
namespace: {{ .releaseNamespace }}
annotations:
"helm.sh/hook": pre-delete
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded,hook-failed
Expand All @@ -12,100 +14,101 @@ metadata:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ .Release.Name }}-sonataflow-hook-cleanup
name: {{ printf "%s-%s-cleanup" .releaseName .kind }}
annotations:
"helm.sh/hook": pre-delete
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded,hook-failed
"helm.sh/hook-weight": "0"
rules:
- apiGroups:
- apiGroups:
- apiextensions.k8s.io
resources:
- customresourcedefinitions
verbs:
- get
- apiGroups:
- sonataflow.org
{{- if not (hasKey . "targetNamespace") }}
- apiGroups: # Tackling cluster scoped resources such as sonataflowclusterplatform
- {{ .apiGroup }}
resources:
- sonataflowclusterplatforms
- {{ .kind }}
verbs:
- get
- list
- delete
{{- end }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ .Release.Name }}-sonataflow-hook-cleanup
name: {{ printf "%s-%s-cleanup" .releaseName .kind }}
annotations:
"helm.sh/hook": pre-delete
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded,hook-failed
"helm.sh/hook-weight": "0"
subjects:
- kind: ServiceAccount
name: {{ .Release.Name }}-sonataflow-hook-cleanup
namespace: {{ .Release.Namespace }}
name: {{ printf "%s-%s-cleanup" .releaseName .kind }}
namespace: {{ .releaseNamespace }}
roleRef:
kind: ClusterRole
name: {{ .Release.Name }}-sonataflow-hook-cleanup
apiGroup: rbac.authorization.k8s.io
name: {{ printf "%s-%s-cleanup" .releaseName .kind }}
apiGroup: rbac.authorization.k8s.io
---
{{- if (hasKey . "targetNamespace") }}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ .Release.Name }}-sonataflow-hook-cleanup
namespace: {{ .Values.orchestrator.namespace }}
name: {{ printf "%s-%s-cleanup" .releaseName .kind }}
namespace: {{ .targetNamespace }}
annotations:
"helm.sh/hook": pre-delete
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded,hook-failed
"helm.sh/hook-weight": "0"
rules:
- apiGroups:
- sonataflow.org
- {{ .apiGroup }}
resources:
- sonataflowplatforms
verbs:
- delete
{{- if .Values.orchestrator.devmode }}
- apiGroups:
- ""
resources:
- namespaces
- {{ .kind}}
verbs:
- get
- list
- delete
{{- end }}
- patch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ .Release.Name }}-sonataflow-hook-cleanup
namespace: {{ .Values.orchestrator.namespace }}
name: {{ printf "%s-%s-cleanup" .releaseName .kind }}
namespace: {{ .targetNamespace }}
annotations:
"helm.sh/hook": pre-delete
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded,hook-failed
"helm.sh/hook-weight": "0"
subjects:
- kind: ServiceAccount
name: {{ .Release.Name }}-sonataflow-hook-cleanup
namespace: {{ .Release.Namespace }}
name: {{ printf "%s-%s-cleanup" .releaseName .kind }}
namespace: {{ .releaseNamespace }}
roleRef:
kind: Role
name: {{ .Release.Name }}-sonataflow-hook-cleanup
name: {{ printf "%s-%s-cleanup" .releaseName .kind }}
apiGroup: rbac.authorization.k8s.io
{{- end }}
---
apiVersion: batch/v1
kind: Job
metadata:
name: {{ .Release.Name }}-sonataflow-hook-cleanup
namespace: {{ .Release.Namespace }}
name: {{ printf "%s-%s-cleanup" .releaseName .kind }}
namespace: {{ .releaseNamespace }}
annotations:
"helm.sh/hook": pre-delete
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded,hook-failed
"helm.sh/hook-weight": "1"
"helm.sh/hook-weight": "1"
spec:
template:
metadata:
name: {{ .Release.Name }}-sonataflow-hook-cleanup
name: {{ printf "%s-%s-cleanup" .releaseName .kind }}
spec:
serviceAccountName: {{ .Release.Name }}-sonataflow-hook-cleanup
serviceAccountName: {{ printf "%s-%s-cleanup" .releaseName .kind }}
containers:
- name: cleanup
image: registry.redhat.io/openshift4/ose-cli:latest
Expand All @@ -114,17 +117,14 @@ spec:
- "-c"
args:
- |
kubectl get crd sonataflowplatforms.sonataflow.org
echo "Cleanup Job for CR {{ .kind }} of {{ $resourceAPIGroup }} started"
kubectl get crd {{ $resourceAPIGroup }}
if [ $? -eq 0 ]; then
kubectl delete -n {{ .Values.orchestrator.namespace }} sonataflowplatforms.sonataflow.org sonataflow-platform
kubectl get {{ if (hasKey . "targetNamespace") }} -n {{ .targetNamespace }} {{ end }} {{ $resourceAPIGroup }} {{ .resourceName }}
if [ $? -eq 0 ]; then
kubectl delete {{ if (hasKey . "targetNamespace") }} -n {{ .targetNamespace }} {{ end }} {{ $resourceAPIGroup }} {{ .resourceName }}
fi
fi
kubectl get crd sonataflowclusterplatforms.sonataflow.org
if [ $? -eq 0 ]; then
kubectl delete sonataflowclusterplatforms.sonataflow.org cluster-platform
fi
{{- if .Values.orchestrator.devmode }}
kubectl delete namespace {{ .Values.orchestrator.namespace }}
{{- end }}
echo "Job finished"
restartPolicy: Never
{{- end }}
echo "Cleanup Job finished"
restartPolicy: Never
{{- end }}
33 changes: 0 additions & 33 deletions helm-charts/orchestrator/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -36,39 +36,6 @@
{{- end -}}
{{- end -}}

{{- define "get-default-catalogsource-name" -}}
{{- if .Capabilities.APIVersions.Has "route.openshift.io/v1" -}}
{{- "community-operators" -}}
{{- else -}}
{{- "operatorhubio-catalog" -}}
{{- end -}}
{{- end -}}

{{- define "get-default-catalogsource-namespace" -}}
{{- if .Capabilities.APIVersions.Has "route.openshift.io/v1" -}}
{{- "openshift-marketplace" -}}
{{- else -}}
{{- "olm" -}}
{{- end -}}
{{- end -}}

{{- define "get-default-operator-namespace" -}}
{{- if .Capabilities.APIVersions.Has "route.openshift.io/v1" -}}
{{- "openshift-operators" -}}
{{- else -}}
{{- "operators" -}}
{{- end -}}
{{- end -}}

{{- define "operator-group-exists" -}}
{{- $namespace := index . 0 -}}
{{- $existingOperatorGroup := lookup "operators.coreos.com/v1" "OperatorGroup" $namespace "" -}}
{{- if empty $existingOperatorGroup -}}
{{- "false" -}}
{{- else }}
{{- "true" -}}
{{- end -}}
{{- end -}}

{{- define "cluster.domain" -}}
{{- if .Capabilities.APIVersions.Has "config.openshift.io/v1/Ingress" -}}
Expand Down
Loading

0 comments on commit 807f1bd

Please sign in to comment.