From d8086217bee3d8cc56a0991fc54545fe34ce2b56 Mon Sep 17 00:00:00 2001 From: Diego Alejandro Torres Fuerte Date: Thu, 6 Jun 2024 08:14:10 -0600 Subject: [PATCH] parasol insurance dev --- .../parasol-insurance-dev/kustomization.yml | 43 +++++++++++++ .../parasol-insurance-dev/kustomization.yaml | 45 +++++++++++++ .../patch-application-manual-sync.yaml | 2 + .../patch-application-repo-revision.yaml | 6 ++ .../patch-applicationset-manual-sync.yaml | 2 + .../apps/base/tenants-applicationset.yaml | 2 +- .../parasol-insurance-dev/kustomization.yaml | 27 ++++++++ .../patch-cluster-config-app-of-apps.yaml | 7 ++ .../patch-configs-list.yaml | 13 ++++ .../patch-operators-list.yaml | 64 +++++++++++++++++++ .../patch-tenants-applicationset.yaml | 3 + .../namespaces/base/kustomization.yaml | 5 ++ .../namespaces/base/parasol-insurance.yaml | 8 +++ .../parasol-insurance-dev/kustomization.yaml | 5 ++ 14 files changed, 231 insertions(+), 1 deletion(-) create mode 100644 bootstrap/overlays/parasol-insurance-dev/kustomization.yml create mode 100644 clusters/overlays/parasol-insurance-dev/kustomization.yaml create mode 100644 clusters/overlays/parasol-insurance-dev/patch-application-manual-sync.yaml create mode 100644 clusters/overlays/parasol-insurance-dev/patch-application-repo-revision.yaml create mode 100644 clusters/overlays/parasol-insurance-dev/patch-applicationset-manual-sync.yaml create mode 100644 components/argocd/apps/overlays/parasol-insurance-dev/kustomization.yaml create mode 100644 components/argocd/apps/overlays/parasol-insurance-dev/patch-cluster-config-app-of-apps.yaml create mode 100644 components/argocd/apps/overlays/parasol-insurance-dev/patch-configs-list.yaml create mode 100644 components/argocd/apps/overlays/parasol-insurance-dev/patch-operators-list.yaml create mode 100644 components/argocd/apps/overlays/parasol-insurance-dev/patch-tenants-applicationset.yaml create mode 100644 tenants/parasol-insurance/namespaces/base/kustomization.yaml create mode 100644 tenants/parasol-insurance/namespaces/base/parasol-insurance.yaml create mode 100644 tenants/parasol-insurance/namespaces/overlays/parasol-insurance-dev/kustomization.yaml diff --git a/bootstrap/overlays/parasol-insurance-dev/kustomization.yml b/bootstrap/overlays/parasol-insurance-dev/kustomization.yml new file mode 100644 index 00000000..4974a9ff --- /dev/null +++ b/bootstrap/overlays/parasol-insurance-dev/kustomization.yml @@ -0,0 +1,43 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +namespace: openshift-gitops + +resources: + - ../../base + - ../../../components/argocd/apps/overlays/parasol-insurance-dev + +patches: + # set the repo and branch for applications + - path: patch-application-repo-revision.yaml + target: + group: argoproj.io + kind: Application + +replacements: + - source: + kind: Application + fieldPath: spec.source.repoURL + targets: + - select: + kind: ApplicationSet + fieldPaths: + - spec.template.spec.source.repoURL + - select: + kind: ApplicationSet + name: tenants + fieldPaths: + - spec.generators.*.git.repoURL + - source: + kind: Application + fieldPath: spec.source.targetRevision + targets: + - select: + kind: ApplicationSet + fieldPaths: + - spec.template.spec.source.targetRevision + - select: + kind: ApplicationSet + name: tenants + fieldPaths: + - spec.generators.*.git.revision \ No newline at end of file diff --git a/clusters/overlays/parasol-insurance-dev/kustomization.yaml b/clusters/overlays/parasol-insurance-dev/kustomization.yaml new file mode 100644 index 00000000..5fe0ea2b --- /dev/null +++ b/clusters/overlays/parasol-insurance-dev/kustomization.yaml @@ -0,0 +1,45 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +namespace: openshift-gitops + +resources: + - ../../base + - ../../../components/argocd/apps/overlays/parasol-insurance-dev + +patches: + # set the repo and branch for applications + - path: patch-application-repo-revision.yaml + target: + group: argoproj.io + kind: Application + +replacements: + # copy the repo from the application to the applicationsets + - source: + kind: Application + fieldPath: spec.source.repoURL + targets: + - select: + kind: ApplicationSet + fieldPaths: + - spec.template.spec.source.repoURL + - select: + kind: ApplicationSet + name: tenants + fieldPaths: + - spec.generators.*.git.repoURL + # copy the branch from the application to the applicationsets + - source: + kind: Application + fieldPath: spec.source.targetRevision + targets: + - select: + kind: ApplicationSet + fieldPaths: + - spec.template.spec.source.targetRevision + - select: + kind: ApplicationSet + name: tenants + fieldPaths: + - spec.generators.*.git.revision diff --git a/clusters/overlays/parasol-insurance-dev/patch-application-manual-sync.yaml b/clusters/overlays/parasol-insurance-dev/patch-application-manual-sync.yaml new file mode 100644 index 00000000..d289dd4a --- /dev/null +++ b/clusters/overlays/parasol-insurance-dev/patch-application-manual-sync.yaml @@ -0,0 +1,2 @@ +- op: remove + path: /spec/syncPolicy diff --git a/clusters/overlays/parasol-insurance-dev/patch-application-repo-revision.yaml b/clusters/overlays/parasol-insurance-dev/patch-application-repo-revision.yaml new file mode 100644 index 00000000..31e3a2d1 --- /dev/null +++ b/clusters/overlays/parasol-insurance-dev/patch-application-repo-revision.yaml @@ -0,0 +1,6 @@ +- op: replace + path: /spec/source/repoURL + value: 'https://github.com/diego-torres/ai-accelerator.git' +- op: replace + path: /spec/source/targetRevision + value: main diff --git a/clusters/overlays/parasol-insurance-dev/patch-applicationset-manual-sync.yaml b/clusters/overlays/parasol-insurance-dev/patch-applicationset-manual-sync.yaml new file mode 100644 index 00000000..a60ffc01 --- /dev/null +++ b/clusters/overlays/parasol-insurance-dev/patch-applicationset-manual-sync.yaml @@ -0,0 +1,2 @@ +- op: remove + path: /spec/template/spec/syncPolicy diff --git a/components/argocd/apps/base/tenants-applicationset.yaml b/components/argocd/apps/base/tenants-applicationset.yaml index 19af8ff2..f78197c7 100644 --- a/components/argocd/apps/base/tenants-applicationset.yaml +++ b/components/argocd/apps/base/tenants-applicationset.yaml @@ -9,7 +9,7 @@ metadata: spec: generators: - git: - repoURL: 'https://github.com/redhat-ai-services/ai-accelerator.git' + repoURL: 'https://github.com/diego-torres/ai-accelerator.git' revision: main directories: - path: tenants/*/*/overlays/patch-me-see-overlay diff --git a/components/argocd/apps/overlays/parasol-insurance-dev/kustomization.yaml b/components/argocd/apps/overlays/parasol-insurance-dev/kustomization.yaml new file mode 100644 index 00000000..b0f44e17 --- /dev/null +++ b/components/argocd/apps/overlays/parasol-insurance-dev/kustomization.yaml @@ -0,0 +1,27 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - ../../base + +patches: + - path: patch-cluster-config-app-of-apps.yaml + target: + kind: Application + name: cluster-config-app-of-apps + - path: patch-operators-list.yaml + target: + kind: ApplicationSet + name: cluster-operators + - path: patch-configs-list.yaml + target: + kind: ApplicationSet + name: cluster-configs + - path: patch-tenants-applicationset.yaml + target: + kind: ApplicationSet + name: tenants + - path: patch-tenants-applicationset.yaml + target: + kind: ApplicationSet + name: tenants diff --git a/components/argocd/apps/overlays/parasol-insurance-dev/patch-cluster-config-app-of-apps.yaml b/components/argocd/apps/overlays/parasol-insurance-dev/patch-cluster-config-app-of-apps.yaml new file mode 100644 index 00000000..0b147995 --- /dev/null +++ b/components/argocd/apps/overlays/parasol-insurance-dev/patch-cluster-config-app-of-apps.yaml @@ -0,0 +1,7 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: cluster-config-app-of-apps +spec: + source: + path: clusters/overlays/parasol-insurance-dev diff --git a/components/argocd/apps/overlays/parasol-insurance-dev/patch-configs-list.yaml b/components/argocd/apps/overlays/parasol-insurance-dev/patch-configs-list.yaml new file mode 100644 index 00000000..cb8d4f9c --- /dev/null +++ b/components/argocd/apps/overlays/parasol-insurance-dev/patch-configs-list.yaml @@ -0,0 +1,13 @@ +apiVersion: argoproj.io/v1alpha1 +kind: ApplicationSet +metadata: + name: cluster-configs +spec: + generators: + - list: + elements: + - cluster: local + url: https://kubernetes.default.svc + values: + name: user-workload-monitoring + path: components/cluster-configs/user-workload-monitoring/overlays/default diff --git a/components/argocd/apps/overlays/parasol-insurance-dev/patch-operators-list.yaml b/components/argocd/apps/overlays/parasol-insurance-dev/patch-operators-list.yaml new file mode 100644 index 00000000..7f800f38 --- /dev/null +++ b/components/argocd/apps/overlays/parasol-insurance-dev/patch-operators-list.yaml @@ -0,0 +1,64 @@ +apiVersion: argoproj.io/v1alpha1 +kind: ApplicationSet +metadata: + name: cluster-operators +spec: + generators: + - list: + elements: + - cluster: local + url: https://kubernetes.default.svc + values: + name: authorino-operator + path: components/operators/authorino-operator/operator/overlays/managed-services + - cluster: local + url: https://kubernetes.default.svc + values: + name: jaeger-operator + path: components/operators/jaeger/operator/overlays/stable + - cluster: local + url: https://kubernetes.default.svc + values: + name: kiali-operator + path: components/operators/kiali/operator/overlays/stable + - cluster: local + url: https://kubernetes.default.svc + values: + name: openshift-ai-operator + path: components/operators/openshift-ai/aggregate/overlays/fast + - cluster: local + url: https://kubernetes.default.svc + values: + name: openshift-elasticsearch-operator + path: components/operators/openshift-elasticsearch/operator/overlays/stable + - cluster: local + url: https://kubernetes.default.svc + values: + name: openshift-gitops-operator + path: components/operators/openshift-gitops/aggregate/overlays/rhdp + - cluster: local + url: https://kubernetes.default.svc + values: + name: openshift-pipelines-operator + path: components/operators/openshift-pipelines/operator/overlays/latest + - cluster: local + url: https://kubernetes.default.svc + values: + name: openshift-serverless-operator + path: components/operators/openshift-serverless/operator/overlays/stable + - cluster: local + url: https://kubernetes.default.svc + values: + name: openshift-servicemesh-operator + path: components/operators/openshift-servicemesh/operator/overlays/stable + + # - cluster: local + # url: https://kubernetes.default.svc + # values: + # name: openshift-logging-operator + # path: components/operators/openshift-logging/aggregate/overlays/default + # - cluster: local + # url: https://kubernetes.default.svc + # values: + # name: web-terminal-operator + # path: components/operators/web-terminal-operator/operator/overlays/fast diff --git a/components/argocd/apps/overlays/parasol-insurance-dev/patch-tenants-applicationset.yaml b/components/argocd/apps/overlays/parasol-insurance-dev/patch-tenants-applicationset.yaml new file mode 100644 index 00000000..d8e0a67e --- /dev/null +++ b/components/argocd/apps/overlays/parasol-insurance-dev/patch-tenants-applicationset.yaml @@ -0,0 +1,3 @@ +- op: replace + path: /spec/generators/0/git/directories/0/path + value: tenants/*/*/overlays/parasol-insurance-dev diff --git a/tenants/parasol-insurance/namespaces/base/kustomization.yaml b/tenants/parasol-insurance/namespaces/base/kustomization.yaml new file mode 100644 index 00000000..9ddf0c01 --- /dev/null +++ b/tenants/parasol-insurance/namespaces/base/kustomization.yaml @@ -0,0 +1,5 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - parasol-insurance.yaml diff --git a/tenants/parasol-insurance/namespaces/base/parasol-insurance.yaml b/tenants/parasol-insurance/namespaces/base/parasol-insurance.yaml new file mode 100644 index 00000000..278d34b1 --- /dev/null +++ b/tenants/parasol-insurance/namespaces/base/parasol-insurance.yaml @@ -0,0 +1,8 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: parasol-insurance +labels: +- includeSelectors: false + pairs: + opendatahub.io/dashboard: "true" diff --git a/tenants/parasol-insurance/namespaces/overlays/parasol-insurance-dev/kustomization.yaml b/tenants/parasol-insurance/namespaces/overlays/parasol-insurance-dev/kustomization.yaml new file mode 100644 index 00000000..774a422d --- /dev/null +++ b/tenants/parasol-insurance/namespaces/overlays/parasol-insurance-dev/kustomization.yaml @@ -0,0 +1,5 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - ../../base