From 51b132e1af2012193b8ae80681887fbf4286c908 Mon Sep 17 00:00:00 2001 From: gabriel-farache Date: Tue, 6 Feb 2024 12:11:16 +0100 Subject: [PATCH] Add subcharts for MTA --- charts/workflows/charts/mta/INSTALL.md | 15 +++++++ .../mta/crds/tackle.konveyor.io_tackles.yaml | 44 +++++++++++++++++++ .../charts/mta/templates/00-mta-operator.yaml | 26 +++++++++++ .../mta/templates/00-tackle-resources.yaml | 9 ++++ .../workflows/charts/mta/templates/NOTES.txt | 19 ++++++++ 5 files changed, 113 insertions(+) create mode 100644 charts/workflows/charts/mta/INSTALL.md create mode 100644 charts/workflows/charts/mta/crds/tackle.konveyor.io_tackles.yaml create mode 100644 charts/workflows/charts/mta/templates/00-mta-operator.yaml create mode 100644 charts/workflows/charts/mta/templates/00-tackle-resources.yaml create mode 100644 charts/workflows/charts/mta/templates/NOTES.txt diff --git a/charts/workflows/charts/mta/INSTALL.md b/charts/workflows/charts/mta/INSTALL.md new file mode 100644 index 00000000..a070e9da --- /dev/null +++ b/charts/workflows/charts/mta/INSTALL.md @@ -0,0 +1,15 @@ +MTA +=========== + +# Installation +From `charts` folder run +```console +helm install mta workflows/mta --namespace=sonataflow-infra +``` + +Then wait for all resources to be up: +```console +oc wait --for=jsonpath='{.status.phase}=Succeeded' -n openshift-mta csv/mta-operator.v6.2.1 --timeout=2m +oc wait --for=condition=Ready=true pods -l "app.kubernetes.io/name=mta-ui" -n openshift-mta --timeout=2m +oc wait -n sonataflow-infra sonataflow/mtaanalysis --for=condition=Running --timeout=2m +``` \ No newline at end of file diff --git a/charts/workflows/charts/mta/crds/tackle.konveyor.io_tackles.yaml b/charts/workflows/charts/mta/crds/tackle.konveyor.io_tackles.yaml new file mode 100644 index 00000000..090a407a --- /dev/null +++ b/charts/workflows/charts/mta/crds/tackle.konveyor.io_tackles.yaml @@ -0,0 +1,44 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + creationTimestamp: null + name: tackles.tackle.konveyor.io +spec: + group: tackle.konveyor.io + names: + kind: Tackle + listKind: TackleList + plural: tackles + singular: tackle + scope: Namespaced + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: Tackle is the Schema for the tackles API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: Spec defines the desired state of Tackle + type: object + x-kubernetes-preserve-unknown-fields: true + status: + description: Status defines the observed state of Tackle + type: object + x-kubernetes-preserve-unknown-fields: true + type: object + served: true + storage: true + subresources: + status: {} \ No newline at end of file diff --git a/charts/workflows/charts/mta/templates/00-mta-operator.yaml b/charts/workflows/charts/mta/templates/00-mta-operator.yaml new file mode 100644 index 00000000..4ce8dd8c --- /dev/null +++ b/charts/workflows/charts/mta/templates/00-mta-operator.yaml @@ -0,0 +1,26 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: openshift-mta +--- +apiVersion: operators.coreos.com/v1 +kind: OperatorGroup +metadata: + name: openshift-mta + namespace: openshift-mta +spec: + targetNamespaces: + - openshift-mta + upgradeStrategy: Default +--- +apiVersion: operators.coreos.com/v1alpha1 +kind: Subscription +metadata: + name: mta-operator + namespace: openshift-mta +spec: + channel: stable-v6.2 + installPlanApproval: Automatic + name: mta-operator + source: redhat-operators + sourceNamespace: openshift-marketplace diff --git a/charts/workflows/charts/mta/templates/00-tackle-resources.yaml b/charts/workflows/charts/mta/templates/00-tackle-resources.yaml new file mode 100644 index 00000000..05260328 --- /dev/null +++ b/charts/workflows/charts/mta/templates/00-tackle-resources.yaml @@ -0,0 +1,9 @@ +kind: Tackle +apiVersion: tackle.konveyor.io/v1alpha1 +metadata: + name: tackle + namespace: openshift-mta +spec: + feature_auth_required: false + hub_database_volume_size: 1Gi + hub_bucket_volume_size: 1Gi \ No newline at end of file diff --git a/charts/workflows/charts/mta/templates/NOTES.txt b/charts/workflows/charts/mta/templates/NOTES.txt new file mode 100644 index 00000000..e17d68f4 --- /dev/null +++ b/charts/workflows/charts/mta/templates/NOTES.txt @@ -0,0 +1,19 @@ +{{/* Empty line */}} +Helm Release {{ .Release.Name }} installed in namespace {{ .Release.Namespace }}. +{{- $yes := "YES" }} +{{- $no := "NO " }} +{{- $mtaOperatorInstalled := $yes }} +{{- $mtaWorkflowInstalled := $yes }} +{{- $timeout := "--timeout=2m" }} + + +Components Installed Namespace +==================================================================== +MTA operator {{ $mtaOperatorInstalled }} openshift-mta +serverless workflow - mta analysis {{ $mtaWorkflowInstalled }} {{ .Release.Namespace }} +{{/* Empty line */}} + +Run the following commands to wait until the mta analysis workflow dependencies and build are done and workflow is running on namespace {{ .Release.Namespace }}: + oc wait --for=jsonpath='{.status.phase}=Succeeded' -n openshift-mta csv/mta-operator.v6.2.1 {{ $timeout }} + oc wait --for=condition=Ready=true pods -l "app.kubernetes.io/name=mta-ui" -n openshift-mta {{ $timeout }} + oc wait -n {{ .Release.Namespace }} sonataflow/mtaanalysis --for=condition=Running {{ $timeout }} \ No newline at end of file