From 4c292c6bbc53ee5ba41cfdb093b2fe738151341a Mon Sep 17 00:00:00 2001 From: Steven Fitzpatrick Date: Thu, 3 Jun 2021 03:45:14 +0000 Subject: [PATCH] Add LMA to multi-tenant type and reference site This change introduces LMA components to the multi-tenant type: - Deploy lma-infra, elastic-stack and monitoring stack in lma/workload phase - Added lma config to lma/workload-config for local-subcluster logging - Added Node Ports for Elasticsearch & Kibana services in the lma subcluster - Spec Elasticsearch resources for subcluster hosts To deploy this in the reference-multi-tenant site, various phase entrypoints have been added to the sub-clusters/lma directory Relates-To: #150 Change-Id: I4d3b0d6ed9643e702c92760c1849e10320196ff8 --- .../lma/catalogues/kustomization.yaml | 11 +++++++ .../lma/controlplane/kustomization.yaml | 6 ++++ .../initinfra-networking/kustomization.yaml | 2 ++ .../lma/initinfra/kustomization.yaml | 6 ++++ .../lma/provide-infra/kustomization.yaml | 6 ++++ .../lma/workers/kustomization.yaml | 7 +++++ .../lma/workers/metal3machinetemplate.yaml | 10 +++++++ .../lma/workload-config/kustomization.yaml | 3 ++ .../lma/workload/kustomization.yaml | 6 ++++ .../catalogues/subcluster-networking.yaml | 4 +++ .../lma/lma-configs/kustomization.yaml | 4 --- .../lma/phases/kustomization.yaml | 1 - .../sub-clusters/lma/phases/lma_phases.yaml | 12 -------- .../sub-clusters/lma/phases/phases_patch.yaml | 8 +++++ .../lma/workload-config/kustomization.yaml | 8 +++++ .../workload-config/patches/cluster-flow.yaml | 6 ++++ .../lma/workload/kustomization.yaml | 17 +++++++++-- .../workload/patches/elasticsearch-data.yaml | 21 ++++++++++++++ .../patches/elasticsearch-ingest.yaml | 23 +++++++++++++++ .../lma/workload/patches/kibana.yaml | 8 +++++ .../lma/workload/patches/minio.yaml | 17 ----------- .../workload/replacements/kustomization.yaml | 4 ++- .../replacements/lma-service-ports.yaml | 29 +++++++++++++++++++ manifests/type/sub-cluster/phases/phases.yaml | 12 ++++++++ .../workload-config/kustomization.yaml | 3 ++ 25 files changed, 196 insertions(+), 38 deletions(-) create mode 100644 manifests/site/reference-multi-tenant/sub-clusters/lma/catalogues/kustomization.yaml create mode 100644 manifests/site/reference-multi-tenant/sub-clusters/lma/controlplane/kustomization.yaml create mode 100644 manifests/site/reference-multi-tenant/sub-clusters/lma/initinfra-networking/kustomization.yaml create mode 100644 manifests/site/reference-multi-tenant/sub-clusters/lma/initinfra/kustomization.yaml create mode 100644 manifests/site/reference-multi-tenant/sub-clusters/lma/provide-infra/kustomization.yaml create mode 100644 manifests/site/reference-multi-tenant/sub-clusters/lma/workers/kustomization.yaml create mode 100644 manifests/site/reference-multi-tenant/sub-clusters/lma/workers/metal3machinetemplate.yaml create mode 100644 manifests/site/reference-multi-tenant/sub-clusters/lma/workload-config/kustomization.yaml create mode 100644 manifests/site/reference-multi-tenant/sub-clusters/lma/workload/kustomization.yaml delete mode 100644 manifests/type/multi-tenant/sub-clusters/lma/lma-configs/kustomization.yaml delete mode 100644 manifests/type/multi-tenant/sub-clusters/lma/phases/lma_phases.yaml create mode 100644 manifests/type/multi-tenant/sub-clusters/lma/workload-config/kustomization.yaml create mode 100644 manifests/type/multi-tenant/sub-clusters/lma/workload-config/patches/cluster-flow.yaml create mode 100644 manifests/type/multi-tenant/sub-clusters/lma/workload/patches/elasticsearch-data.yaml create mode 100644 manifests/type/multi-tenant/sub-clusters/lma/workload/patches/elasticsearch-ingest.yaml create mode 100644 manifests/type/multi-tenant/sub-clusters/lma/workload/patches/kibana.yaml delete mode 100644 manifests/type/multi-tenant/sub-clusters/lma/workload/patches/minio.yaml create mode 100644 manifests/type/multi-tenant/sub-clusters/lma/workload/replacements/lma-service-ports.yaml create mode 100644 manifests/type/sub-cluster/workload-config/kustomization.yaml diff --git a/manifests/site/reference-multi-tenant/sub-clusters/lma/catalogues/kustomization.yaml b/manifests/site/reference-multi-tenant/sub-clusters/lma/catalogues/kustomization.yaml new file mode 100644 index 000000000..79ee69253 --- /dev/null +++ b/manifests/site/reference-multi-tenant/sub-clusters/lma/catalogues/kustomization.yaml @@ -0,0 +1,11 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + # This pulls in general site catalog information which is valid across clusters + # It also pulls in undercloud-specific values, which will be replaced below + - ../../../target/catalogues/ + +transformers: + # This replaces lma-specific network data from the lma stanza + # of the subcluster-networking catalogue into the standard networking catalogue + - ../../../../../type/multi-tenant/sub-clusters/lma/catalogue-replacements \ No newline at end of file diff --git a/manifests/site/reference-multi-tenant/sub-clusters/lma/controlplane/kustomization.yaml b/manifests/site/reference-multi-tenant/sub-clusters/lma/controlplane/kustomization.yaml new file mode 100644 index 000000000..31997043a --- /dev/null +++ b/manifests/site/reference-multi-tenant/sub-clusters/lma/controlplane/kustomization.yaml @@ -0,0 +1,6 @@ +resources: + - ../../../../../type/multi-tenant/sub-clusters/lma/controlplane + - ../catalogues + +transformers: + - ../../../../../type/multi-tenant/sub-clusters/lma/controlplane/replacements diff --git a/manifests/site/reference-multi-tenant/sub-clusters/lma/initinfra-networking/kustomization.yaml b/manifests/site/reference-multi-tenant/sub-clusters/lma/initinfra-networking/kustomization.yaml new file mode 100644 index 000000000..d00946d49 --- /dev/null +++ b/manifests/site/reference-multi-tenant/sub-clusters/lma/initinfra-networking/kustomization.yaml @@ -0,0 +1,2 @@ +resources: + - ../../../../../type/multi-tenant/sub-clusters/lma/initinfra-networking diff --git a/manifests/site/reference-multi-tenant/sub-clusters/lma/initinfra/kustomization.yaml b/manifests/site/reference-multi-tenant/sub-clusters/lma/initinfra/kustomization.yaml new file mode 100644 index 000000000..adbc579c2 --- /dev/null +++ b/manifests/site/reference-multi-tenant/sub-clusters/lma/initinfra/kustomization.yaml @@ -0,0 +1,6 @@ +resources: + - ../../../../../type/multi-tenant/sub-clusters/lma/initinfra + - ../catalogues + +transformers: + - ../../../../../type/multi-tenant/sub-clusters/lma/initinfra/replacements diff --git a/manifests/site/reference-multi-tenant/sub-clusters/lma/provide-infra/kustomization.yaml b/manifests/site/reference-multi-tenant/sub-clusters/lma/provide-infra/kustomization.yaml new file mode 100644 index 000000000..1020b650a --- /dev/null +++ b/manifests/site/reference-multi-tenant/sub-clusters/lma/provide-infra/kustomization.yaml @@ -0,0 +1,6 @@ +resources: + - ../../../../../type/multi-tenant/sub-clusters/lma/provide-infra + - ../catalogues + +transformers: + - ../../../../../type/multi-tenant/sub-clusters/lma/provide-infra/replacements diff --git a/manifests/site/reference-multi-tenant/sub-clusters/lma/workers/kustomization.yaml b/manifests/site/reference-multi-tenant/sub-clusters/lma/workers/kustomization.yaml new file mode 100644 index 000000000..4e7e9fe76 --- /dev/null +++ b/manifests/site/reference-multi-tenant/sub-clusters/lma/workers/kustomization.yaml @@ -0,0 +1,7 @@ +resources: + - ../../../../../type/multi-tenant/sub-clusters/lma/workers + - ../catalogues + - metal3machinetemplate.yaml + +transformers: + - ../../../../../type/multi-tenant/sub-clusters/lma/workers/replacements diff --git a/manifests/site/reference-multi-tenant/sub-clusters/lma/workers/metal3machinetemplate.yaml b/manifests/site/reference-multi-tenant/sub-clusters/lma/workers/metal3machinetemplate.yaml new file mode 100644 index 000000000..f4405f62a --- /dev/null +++ b/manifests/site/reference-multi-tenant/sub-clusters/lma/workers/metal3machinetemplate.yaml @@ -0,0 +1,10 @@ +apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 +kind: Metal3MachineTemplate +metadata: + name: worker-1 +spec: + template: + spec: + image: + url: http://10.23.24.102:80/images/data-plane.qcow2 + checksum: http://10.23.24.102:80/images/data-plane.qcow2.md5sum diff --git a/manifests/site/reference-multi-tenant/sub-clusters/lma/workload-config/kustomization.yaml b/manifests/site/reference-multi-tenant/sub-clusters/lma/workload-config/kustomization.yaml new file mode 100644 index 000000000..4fdd9c4c0 --- /dev/null +++ b/manifests/site/reference-multi-tenant/sub-clusters/lma/workload-config/kustomization.yaml @@ -0,0 +1,3 @@ +resources: + - ../../../../../type/multi-tenant/sub-clusters/lma/workload-config + - ../catalogues diff --git a/manifests/site/reference-multi-tenant/sub-clusters/lma/workload/kustomization.yaml b/manifests/site/reference-multi-tenant/sub-clusters/lma/workload/kustomization.yaml new file mode 100644 index 000000000..842262c03 --- /dev/null +++ b/manifests/site/reference-multi-tenant/sub-clusters/lma/workload/kustomization.yaml @@ -0,0 +1,6 @@ +resources: + - ../../../../../type/multi-tenant/sub-clusters/lma/workload + - ../catalogues + +transformers: + - ../../../../../type/multi-tenant/sub-clusters/lma/workload/replacements diff --git a/manifests/type/multi-tenant/shared/catalogues/subcluster-networking.yaml b/manifests/type/multi-tenant/shared/catalogues/subcluster-networking.yaml index 5c13f4c6f..982ce76c4 100644 --- a/manifests/type/multi-tenant/shared/catalogues/subcluster-networking.yaml +++ b/manifests/type/multi-tenant/shared/catalogues/subcluster-networking.yaml @@ -32,6 +32,10 @@ spec: nodePort: 30001 - name: loadBalancerControlPlane nodePort: 30002 + - name: elasticsearch-ingest + nodePort: 30003 + - name: kibana + nodePort: 30004 # Potential ports that can be used by sub-cluster services. - name: loadBalancerWorker nodePortRange: diff --git a/manifests/type/multi-tenant/sub-clusters/lma/lma-configs/kustomization.yaml b/manifests/type/multi-tenant/sub-clusters/lma/lma-configs/kustomization.yaml deleted file mode 100644 index b2f50edcd..000000000 --- a/manifests/type/multi-tenant/sub-clusters/lma/lma-configs/kustomization.yaml +++ /dev/null @@ -1,4 +0,0 @@ -resources: - - ../../../../../function/lma-configs - -namespace: lma diff --git a/manifests/type/multi-tenant/sub-clusters/lma/phases/kustomization.yaml b/manifests/type/multi-tenant/sub-clusters/lma/phases/kustomization.yaml index 41c0085f3..c4203bac5 100644 --- a/manifests/type/multi-tenant/sub-clusters/lma/phases/kustomization.yaml +++ b/manifests/type/multi-tenant/sub-clusters/lma/phases/kustomization.yaml @@ -7,7 +7,6 @@ nameSuffix: "-lma" resources: - ../../../../sub-cluster/phases - - lma_phases.yaml patchesStrategicMerge: - phases_patch.yaml diff --git a/manifests/type/multi-tenant/sub-clusters/lma/phases/lma_phases.yaml b/manifests/type/multi-tenant/sub-clusters/lma/phases/lma_phases.yaml deleted file mode 100644 index 5a32f29bb..000000000 --- a/manifests/type/multi-tenant/sub-clusters/lma/phases/lma_phases.yaml +++ /dev/null @@ -1,12 +0,0 @@ ---- -apiVersion: airshipit.org/v1alpha1 -kind: Phase -metadata: - name: lma-configs - clusterName: lma -config: - executorRef: - apiVersion: airshipit.org/v1alpha1 - kind: KubernetesApply - name: kubernetes-apply - documentEntryPoint: sub-clusters/lma/lma-configs diff --git a/manifests/type/multi-tenant/sub-clusters/lma/phases/phases_patch.yaml b/manifests/type/multi-tenant/sub-clusters/lma/phases/phases_patch.yaml index eb61a10b5..17586b4a9 100644 --- a/manifests/type/multi-tenant/sub-clusters/lma/phases/phases_patch.yaml +++ b/manifests/type/multi-tenant/sub-clusters/lma/phases/phases_patch.yaml @@ -45,3 +45,11 @@ metadata: clusterName: lma config: documentEntryPoint: sub-clusters/lma/workload +--- +apiVersion: airshipit.org/v1alpha1 +kind: Phase +metadata: + name: workload-config + clusterName: lma +config: + documentEntryPoint: sub-clusters/lma/workload-config \ No newline at end of file diff --git a/manifests/type/multi-tenant/sub-clusters/lma/workload-config/kustomization.yaml b/manifests/type/multi-tenant/sub-clusters/lma/workload-config/kustomization.yaml new file mode 100644 index 000000000..a327714bc --- /dev/null +++ b/manifests/type/multi-tenant/sub-clusters/lma/workload-config/kustomization.yaml @@ -0,0 +1,8 @@ +resources: + - ../../../../../function/lma-configs + +patches: + - path: patches/cluster-flow.yaml + target: + kind: ClusterFlow + name: all-pods diff --git a/manifests/type/multi-tenant/sub-clusters/lma/workload-config/patches/cluster-flow.yaml b/manifests/type/multi-tenant/sub-clusters/lma/workload-config/patches/cluster-flow.yaml new file mode 100644 index 000000000..cda63b906 --- /dev/null +++ b/manifests/type/multi-tenant/sub-clusters/lma/workload-config/patches/cluster-flow.yaml @@ -0,0 +1,6 @@ +- op: add + path: /spec/filters/- + value: + record_modifier: + records: + - airship-cluster: lma 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 8381c721a..c41abd5a1 100644 --- a/manifests/type/multi-tenant/sub-clusters/lma/workload/kustomization.yaml +++ b/manifests/type/multi-tenant/sub-clusters/lma/workload/kustomization.yaml @@ -1,9 +1,20 @@ resources: - - ../../../../sub-cluster/workload + - ../../../../../composite/lma-infra + - ../../../../../composite/elastic-stack - ../../../../../composite/monitoring-stack - - ../../../../../function/minio namespace: lma patches: - - path: patches/minio.yaml + - 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/patches/elasticsearch-data.yaml new file mode 100644 index 000000000..42501956a --- /dev/null +++ b/manifests/type/multi-tenant/sub-clusters/lma/workload/patches/elasticsearch-data.yaml @@ -0,0 +1,21 @@ +apiVersion: helm.toolkit.fluxcd.io/v2beta1 +kind: HelmRelease +metadata: + name: elasticsearch-data +spec: + values: + persistence: + enabled: true + replicas: 3 + resources: + requests: + cpu: "4000m" + memory: "16Gi" + limits: + cpu: "8000m" + memory: "32Gi" + volumeClaimTemplate: + resouces: + requests: + storage: 20Ti + storageclass: block-storage-sc diff --git a/manifests/type/multi-tenant/sub-clusters/lma/workload/patches/elasticsearch-ingest.yaml b/manifests/type/multi-tenant/sub-clusters/lma/workload/patches/elasticsearch-ingest.yaml new file mode 100644 index 000000000..e1aa0a565 --- /dev/null +++ b/manifests/type/multi-tenant/sub-clusters/lma/workload/patches/elasticsearch-ingest.yaml @@ -0,0 +1,23 @@ +apiVersion: helm.toolkit.fluxcd.io/v2beta1 +kind: HelmRelease +metadata: + name: elasticsearch-ingest +spec: + values: + persistence: + enabled: true + replicas: 3 + resources: + requests: + cpu: "4000m" + memory: "16Gi" + limits: + cpu: "8000m" + memory: "24Gi" + volumeClaimTemplate: + resouces: + requests: + storage: 10Gi + storageclass: block-storage-sc + service: + type: NodePort diff --git a/manifests/type/multi-tenant/sub-clusters/lma/workload/patches/kibana.yaml b/manifests/type/multi-tenant/sub-clusters/lma/workload/patches/kibana.yaml new file mode 100644 index 000000000..7665661ce --- /dev/null +++ b/manifests/type/multi-tenant/sub-clusters/lma/workload/patches/kibana.yaml @@ -0,0 +1,8 @@ +apiVersion: "helm.toolkit.fluxcd.io/v2beta1" +kind: HelmRelease +metadata: + name: kibana +spec: + values: + service: + type: NodePort diff --git a/manifests/type/multi-tenant/sub-clusters/lma/workload/patches/minio.yaml b/manifests/type/multi-tenant/sub-clusters/lma/workload/patches/minio.yaml deleted file mode 100644 index 97f0631ae..000000000 --- a/manifests/type/multi-tenant/sub-clusters/lma/workload/patches/minio.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: "helm.toolkit.fluxcd.io/v2beta1" -kind: HelmRelease -metadata: - name: minio -spec: - values: - replicas: 1 - persistence: - enabled: false - existingSecret: minio-admin-secret - buckets: - - name: logs - policy: none - purge: false - - name: metrics - policy: none - purge: false 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 1960ee18c..84a5652ac 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,3 +1,5 @@ resources: + - ../../../../../../composite/lma-infra/replacements + - ../../../../../../composite/elastic-stack/replacements - ../../../../../../composite/monitoring-stack/replacements - - ../../../../../../function/minio/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/replacements/lma-service-ports.yaml new file mode 100644 index 000000000..202643310 --- /dev/null +++ b/manifests/type/multi-tenant/sub-clusters/lma/workload/replacements/lma-service-ports.yaml @@ -0,0 +1,29 @@ +apiVersion: airshipit.org/v1alpha1 +kind: ReplacementTransformer +metadata: + name: lma-service-ports + annotations: + config.kubernetes.io/function: |- + container: + image: quay.io/airshipit/replacement-transformer:v2 +replacements: +- source: + objref: + kind: VariableCatalogue + name: subcluster-networking + fieldref: "{.spec.lma.exposed_services[(@.name == 'elasticsearch-ingest')].nodePort}" + target: + objref: + kind: HelmRepository + name: elasticsearch-ingest + fieldrefs: ["{.spec.values.service.nodePort}"] +- source: + objref: + kind: VariableCatalogue + name: subcluster-networking + fieldref: "{.spec.lma.exposed_services[(@.name == 'kibana')].nodePort}" + target: + objref: + kind: HelmRepository + name: kibana + fieldrefs: ["{.spec.values.service.nodePort}"] diff --git a/manifests/type/sub-cluster/phases/phases.yaml b/manifests/type/sub-cluster/phases/phases.yaml index deb14de2a..04523c1cd 100644 --- a/manifests/type/sub-cluster/phases/phases.yaml +++ b/manifests/type/sub-cluster/phases/phases.yaml @@ -72,3 +72,15 @@ config: kind: KubernetesApply name: kubernetes-apply documentEntryPoint: sub-clusters/sub-cluster/workload +--- +apiVersion: airshipit.org/v1alpha1 +kind: Phase +metadata: + name: workload-config + clusterName: sub-cluster +config: + executorRef: + apiVersion: airshipit.org/v1alpha1 + kind: KubernetesApply + name: kubernetes-apply + documentEntryPoint: sub-clusters/sub-cluster/workload-config diff --git a/manifests/type/sub-cluster/workload-config/kustomization.yaml b/manifests/type/sub-cluster/workload-config/kustomization.yaml new file mode 100644 index 000000000..58901d1d6 --- /dev/null +++ b/manifests/type/sub-cluster/workload-config/kustomization.yaml @@ -0,0 +1,3 @@ +# NOTE: This directory should not be inherited; it should be redefined within the +# type that defines the actual sub-cluster. +resources: []