From bf745d018c86c25c66a350cee19eb0dd1fdba1ec Mon Sep 17 00:00:00 2001 From: Sean Eagan Date: Fri, 18 Jun 2021 11:21:56 -0500 Subject: [PATCH] Deploy helm-chart-collator to sub-clusters - Deploy the helm-chart-collator service and HelmRepository to sub-clusters so that HelmReleases there can use it - Integrate flux helm composite replacements [0]. - Move lma services to sub-directory of the workload to be able to set their namespace independent of the rest of the workload, currently helm-chart-collator. [0]: https://review.opendev.org/c/airship/airshipctl/+/790791 Relates-To: #162 Signed-off-by: Sean Eagan Change-Id: Ib9f3add70a84ab75bfb0b1b6b7083048e469a24f --- .../lma/workload/kustomization.yaml | 21 ++---------------- .../workload/replacements/kustomization.yaml | 6 ++--- .../lma/workload/services/kustomization.yaml | 22 +++++++++++++++++++ .../patches/elasticsearch-data.yaml | 0 .../patches/elasticsearch-ingest.yaml | 0 .../{ => services}/patches/kibana.yaml | 0 .../services/replacements/kustomization.yaml | 5 +++++ .../replacements/lma-service-ports.yaml | 0 .../workload/replacements/kustomization.yaml | 2 ++ .../sub-cluster/initinfra/kustomization.yaml | 1 + .../initinfra/replacements/kustomization.yaml | 4 ++-- .../sub-cluster/workload/kustomization.yaml | 5 ++--- .../workload/replacements/kustomization.yaml | 2 ++ 13 files changed, 40 insertions(+), 28 deletions(-) create mode 100644 manifests/type/multi-tenant/sub-clusters/lma/workload/services/kustomization.yaml rename manifests/type/multi-tenant/sub-clusters/lma/workload/{ => services}/patches/elasticsearch-data.yaml (100%) rename manifests/type/multi-tenant/sub-clusters/lma/workload/{ => services}/patches/elasticsearch-ingest.yaml (100%) rename manifests/type/multi-tenant/sub-clusters/lma/workload/{ => services}/patches/kibana.yaml (100%) create mode 100644 manifests/type/multi-tenant/sub-clusters/lma/workload/services/replacements/kustomization.yaml rename manifests/type/multi-tenant/sub-clusters/lma/workload/{ => services}/replacements/lma-service-ports.yaml (100%) create mode 100644 manifests/type/multi-tenant/sub-clusters/wordpress/workload/replacements/kustomization.yaml create mode 100644 manifests/type/sub-cluster/workload/replacements/kustomization.yaml diff --git a/manifests/type/multi-tenant/sub-clusters/lma/workload/kustomization.yaml b/manifests/type/multi-tenant/sub-clusters/lma/workload/kustomization.yaml index c41abd5a1..a7123ddce 100644 --- a/manifests/type/multi-tenant/sub-clusters/lma/workload/kustomization.yaml +++ b/manifests/type/multi-tenant/sub-clusters/lma/workload/kustomization.yaml @@ -1,20 +1,3 @@ resources: - - ../../../../../composite/lma-infra - - ../../../../../composite/elastic-stack - - ../../../../../composite/monitoring-stack - -namespace: lma - -patches: - - path: patches/elasticsearch-ingest.yaml - target: - kind: HelmRelease - name: elasticsearch-ingest - - path: patches/elasticsearch-data.yaml - target: - kind: HelmRelease - name: elasticsearch-data - - path: patches/kibana.yaml - target: - kind: HelmRelease - name: kibana + - ../../../../sub-cluster/workload + - services diff --git a/manifests/type/multi-tenant/sub-clusters/lma/workload/replacements/kustomization.yaml b/manifests/type/multi-tenant/sub-clusters/lma/workload/replacements/kustomization.yaml index 84a5652ac..025c8025f 100644 --- a/manifests/type/multi-tenant/sub-clusters/lma/workload/replacements/kustomization.yaml +++ b/manifests/type/multi-tenant/sub-clusters/lma/workload/replacements/kustomization.yaml @@ -1,5 +1,3 @@ resources: - - ../../../../../../composite/lma-infra/replacements - - ../../../../../../composite/elastic-stack/replacements - - ../../../../../../composite/monitoring-stack/replacements - - lma-service-ports.yaml + - ../../../../../sub-cluster/workload/replacements + - ../services/replacements diff --git a/manifests/type/multi-tenant/sub-clusters/lma/workload/services/kustomization.yaml b/manifests/type/multi-tenant/sub-clusters/lma/workload/services/kustomization.yaml new file mode 100644 index 000000000..fd0dccdd9 --- /dev/null +++ b/manifests/type/multi-tenant/sub-clusters/lma/workload/services/kustomization.yaml @@ -0,0 +1,22 @@ +resources: + - ../../../../../../composite/lma-infra + - ../../../../../../composite/elastic-stack + - ../../../../../../composite/monitoring-stack + +# This kustomization exists be able to set the namespace here without +# affecting the namespaces of anything else in the parent directory +namespace: lma + +patches: + - path: patches/elasticsearch-ingest.yaml + target: + kind: HelmRelease + name: elasticsearch-ingest + - path: patches/elasticsearch-data.yaml + target: + kind: HelmRelease + name: elasticsearch-data + - path: patches/kibana.yaml + target: + kind: HelmRelease + name: kibana diff --git a/manifests/type/multi-tenant/sub-clusters/lma/workload/patches/elasticsearch-data.yaml b/manifests/type/multi-tenant/sub-clusters/lma/workload/services/patches/elasticsearch-data.yaml similarity index 100% rename from manifests/type/multi-tenant/sub-clusters/lma/workload/patches/elasticsearch-data.yaml rename to manifests/type/multi-tenant/sub-clusters/lma/workload/services/patches/elasticsearch-data.yaml diff --git a/manifests/type/multi-tenant/sub-clusters/lma/workload/patches/elasticsearch-ingest.yaml b/manifests/type/multi-tenant/sub-clusters/lma/workload/services/patches/elasticsearch-ingest.yaml similarity index 100% rename from manifests/type/multi-tenant/sub-clusters/lma/workload/patches/elasticsearch-ingest.yaml rename to manifests/type/multi-tenant/sub-clusters/lma/workload/services/patches/elasticsearch-ingest.yaml diff --git a/manifests/type/multi-tenant/sub-clusters/lma/workload/patches/kibana.yaml b/manifests/type/multi-tenant/sub-clusters/lma/workload/services/patches/kibana.yaml similarity index 100% rename from manifests/type/multi-tenant/sub-clusters/lma/workload/patches/kibana.yaml rename to manifests/type/multi-tenant/sub-clusters/lma/workload/services/patches/kibana.yaml diff --git a/manifests/type/multi-tenant/sub-clusters/lma/workload/services/replacements/kustomization.yaml b/manifests/type/multi-tenant/sub-clusters/lma/workload/services/replacements/kustomization.yaml new file mode 100644 index 000000000..3adcd3f88 --- /dev/null +++ b/manifests/type/multi-tenant/sub-clusters/lma/workload/services/replacements/kustomization.yaml @@ -0,0 +1,5 @@ +resources: + - ../../../../../../../composite/lma-infra/replacements + - ../../../../../../../composite/elastic-stack/replacements + - ../../../../../../../composite/monitoring-stack/replacements + - lma-service-ports.yaml diff --git a/manifests/type/multi-tenant/sub-clusters/lma/workload/replacements/lma-service-ports.yaml b/manifests/type/multi-tenant/sub-clusters/lma/workload/services/replacements/lma-service-ports.yaml similarity index 100% rename from manifests/type/multi-tenant/sub-clusters/lma/workload/replacements/lma-service-ports.yaml rename to manifests/type/multi-tenant/sub-clusters/lma/workload/services/replacements/lma-service-ports.yaml diff --git a/manifests/type/multi-tenant/sub-clusters/wordpress/workload/replacements/kustomization.yaml b/manifests/type/multi-tenant/sub-clusters/wordpress/workload/replacements/kustomization.yaml new file mode 100644 index 000000000..936df6adc --- /dev/null +++ b/manifests/type/multi-tenant/sub-clusters/wordpress/workload/replacements/kustomization.yaml @@ -0,0 +1,2 @@ +resources: + - ../../../../../sub-cluster/workload/replacements diff --git a/manifests/type/sub-cluster/initinfra/kustomization.yaml b/manifests/type/sub-cluster/initinfra/kustomization.yaml index c36d675f3..dfd79c898 100644 --- a/manifests/type/sub-cluster/initinfra/kustomization.yaml +++ b/manifests/type/sub-cluster/initinfra/kustomization.yaml @@ -1,2 +1,3 @@ resources: - ../../../../../airshipctl/manifests/composite/flux-helm/ + - ../../../function/helm-chart-collator/ diff --git a/manifests/type/sub-cluster/initinfra/replacements/kustomization.yaml b/manifests/type/sub-cluster/initinfra/replacements/kustomization.yaml index 48e1e3ea6..9a6cace59 100644 --- a/manifests/type/sub-cluster/initinfra/replacements/kustomization.yaml +++ b/manifests/type/sub-cluster/initinfra/replacements/kustomization.yaml @@ -1,3 +1,3 @@ resources: - - ../../../../../../airshipctl/manifests/function/flux/source-controller/replacements - - ../../../../../../airshipctl/manifests/function/flux/helm-controller/replacements + - ../../../../../../airshipctl/manifests/composite/flux-helm/replacements + - ../../../../function/helm-chart-collator/replacements diff --git a/manifests/type/sub-cluster/workload/kustomization.yaml b/manifests/type/sub-cluster/workload/kustomization.yaml index 58901d1d6..68c2f6d4d 100644 --- a/manifests/type/sub-cluster/workload/kustomization.yaml +++ b/manifests/type/sub-cluster/workload/kustomization.yaml @@ -1,3 +1,2 @@ -# NOTE: This directory should not be inherited; it should be redefined within the -# type that defines the actual sub-cluster. -resources: [] +resources: +- ../../../function/helm-chart-repository \ No newline at end of file diff --git a/manifests/type/sub-cluster/workload/replacements/kustomization.yaml b/manifests/type/sub-cluster/workload/replacements/kustomization.yaml new file mode 100644 index 000000000..f5ea41a6c --- /dev/null +++ b/manifests/type/sub-cluster/workload/replacements/kustomization.yaml @@ -0,0 +1,2 @@ +resources: +- ../../../../function/helm-chart-repository/replacements \ No newline at end of file