From 82b219520c9c62ac642da3d6b155f2681c4b777a Mon Sep 17 00:00:00 2001 From: Steven Kreitzer Date: Fri, 10 Jan 2025 15:42:08 -0600 Subject: [PATCH] feat(flux): convert to cluster/meta folder (#3287) --- .github/workflows/flux-diff.yaml | 6 ++--- .github/workflows/pre-pull-images.yaml | 6 ++--- .../instance/resources/values.yaml | 2 +- .../{config/cluster.yaml => cluster/ks.yaml} | 27 +++---------------- .../flux/{config => meta}/kustomization.yaml | 3 ++- .../repositories/git/kustomization.yaml | 0 .../helm/actions-runner-controller.yaml | 0 .../{ => meta}/repositories/helm/backube.yaml | 0 .../{ => meta}/repositories/helm/bjw-s.yaml | 0 .../{ => meta}/repositories/helm/cilium.yaml | 0 .../repositories/helm/cloudnative-pg.yaml | 0 .../repositories/helm/controlplaneio.yaml | 0 .../{ => meta}/repositories/helm/coredns.yaml | 0 .../repositories/helm/deliveryhero.yaml | 0 .../{ => meta}/repositories/helm/emqx.yaml | 0 .../repositories/helm/external-dns.yaml | 0 .../repositories/helm/external-secrets.yaml | 0 .../repositories/helm/fairwinds.yaml | 0 .../{ => meta}/repositories/helm/grafana.yaml | 0 .../repositories/helm/ingress-nginx.yaml | 0 .../{ => meta}/repositories/helm/intel.yaml | 0 .../repositories/helm/jetstack.yaml | 0 .../helm/kubernetes-sigs-descheduler.yaml | 0 .../repositories/helm/kustomization.yaml | 0 .../{ => meta}/repositories/helm/kyverno.yaml | 0 .../repositories/helm/metrics-server.yaml | 0 .../helm/node-feature-discovery.yaml | 0 .../{ => meta}/repositories/helm/openebs.yaml | 0 .../{ => meta}/repositories/helm/piraeus.yaml | 0 .../helm/prometheus-community.yaml | 0 .../repositories/helm/rook-ceph.yaml | 0 .../{ => meta}/repositories/helm/spegel.yaml | 0 .../repositories/helm/stakater.yaml | 0 .../repositories/helm/stevehipwell.yaml | 0 .../repositories/kustomization.yaml | 0 .../repositories/oci/kustomization.yaml | 0 .../{ => meta}/settings/kustomization.yaml | 0 37 files changed, 13 insertions(+), 31 deletions(-) rename kubernetes/flux/{config/cluster.yaml => cluster/ks.yaml} (74%) rename kubernetes/flux/{config => meta}/kustomization.yaml (69%) rename kubernetes/flux/{ => meta}/repositories/git/kustomization.yaml (100%) rename kubernetes/flux/{ => meta}/repositories/helm/actions-runner-controller.yaml (100%) rename kubernetes/flux/{ => meta}/repositories/helm/backube.yaml (100%) rename kubernetes/flux/{ => meta}/repositories/helm/bjw-s.yaml (100%) rename kubernetes/flux/{ => meta}/repositories/helm/cilium.yaml (100%) rename kubernetes/flux/{ => meta}/repositories/helm/cloudnative-pg.yaml (100%) rename kubernetes/flux/{ => meta}/repositories/helm/controlplaneio.yaml (100%) rename kubernetes/flux/{ => meta}/repositories/helm/coredns.yaml (100%) rename kubernetes/flux/{ => meta}/repositories/helm/deliveryhero.yaml (100%) rename kubernetes/flux/{ => meta}/repositories/helm/emqx.yaml (100%) rename kubernetes/flux/{ => meta}/repositories/helm/external-dns.yaml (100%) rename kubernetes/flux/{ => meta}/repositories/helm/external-secrets.yaml (100%) rename kubernetes/flux/{ => meta}/repositories/helm/fairwinds.yaml (100%) rename kubernetes/flux/{ => meta}/repositories/helm/grafana.yaml (100%) rename kubernetes/flux/{ => meta}/repositories/helm/ingress-nginx.yaml (100%) rename kubernetes/flux/{ => meta}/repositories/helm/intel.yaml (100%) rename kubernetes/flux/{ => meta}/repositories/helm/jetstack.yaml (100%) rename kubernetes/flux/{ => meta}/repositories/helm/kubernetes-sigs-descheduler.yaml (100%) rename kubernetes/flux/{ => meta}/repositories/helm/kustomization.yaml (100%) rename kubernetes/flux/{ => meta}/repositories/helm/kyverno.yaml (100%) rename kubernetes/flux/{ => meta}/repositories/helm/metrics-server.yaml (100%) rename kubernetes/flux/{ => meta}/repositories/helm/node-feature-discovery.yaml (100%) rename kubernetes/flux/{ => meta}/repositories/helm/openebs.yaml (100%) rename kubernetes/flux/{ => meta}/repositories/helm/piraeus.yaml (100%) rename kubernetes/flux/{ => meta}/repositories/helm/prometheus-community.yaml (100%) rename kubernetes/flux/{ => meta}/repositories/helm/rook-ceph.yaml (100%) rename kubernetes/flux/{ => meta}/repositories/helm/spegel.yaml (100%) rename kubernetes/flux/{ => meta}/repositories/helm/stakater.yaml (100%) rename kubernetes/flux/{ => meta}/repositories/helm/stevehipwell.yaml (100%) rename kubernetes/flux/{ => meta}/repositories/kustomization.yaml (100%) rename kubernetes/flux/{ => meta}/repositories/oci/kustomization.yaml (100%) rename kubernetes/flux/{ => meta}/settings/kustomization.yaml (100%) diff --git a/.github/workflows/flux-diff.yaml b/.github/workflows/flux-diff.yaml index 87197c434d..4b8d75fba7 100644 --- a/.github/workflows/flux-diff.yaml +++ b/.github/workflows/flux-diff.yaml @@ -47,8 +47,8 @@ jobs: args: >- diff ${{ matrix.resources }} --unified 6 - --path /github/workspace/pull/kubernetes/flux/config - --path-orig /github/workspace/default/kubernetes/flux/config + --path /github/workspace/pull/kubernetes/flux/cluster + --path-orig /github/workspace/default/kubernetes/flux/cluster --strip-attrs "helm.sh/chart,checksum/config,app.kubernetes.io/version,chart" --limit-bytes 10000 --all-namespaces @@ -89,6 +89,6 @@ jobs: name: Flux Diff Successful runs-on: ubuntu-latest steps: - - if: ${{ !contains(needs.*.result, 'success') }} + - if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} name: Check matrix status run: exit 1 diff --git a/.github/workflows/pre-pull-images.yaml b/.github/workflows/pre-pull-images.yaml index 08bde4f213..6cbcda2f7b 100644 --- a/.github/workflows/pre-pull-images.yaml +++ b/.github/workflows/pre-pull-images.yaml @@ -40,7 +40,7 @@ jobs: with: args: >- get cluster - --path /github/workspace/kubernetes/flux/config + --path /github/workspace/kubernetes/flux/cluster --enable-images --output yaml --output-file images.yaml @@ -92,11 +92,11 @@ jobs: # Summarize matrix https://github.community/t/status-check-for-a-matrix-jobs/127354/7 pre-pull-images-success: - if: ${{ needs.compare-images.outputs.images != '[]' }} + if: ${{ always() }} needs: ["pre-pull-images"] name: Pre-pull Images Successful runs-on: ubuntu-latest steps: - - if: ${{ !contains(needs.*.result, 'success') }} + - if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} name: Check matrix status run: exit 1 diff --git a/kubernetes/apps/flux-system/flux-operator/instance/resources/values.yaml b/kubernetes/apps/flux-system/flux-operator/instance/resources/values.yaml index 7df5c4ca73..f915b39fd6 100644 --- a/kubernetes/apps/flux-system/flux-operator/instance/resources/values.yaml +++ b/kubernetes/apps/flux-system/flux-operator/instance/resources/values.yaml @@ -14,7 +14,7 @@ instance: kind: GitRepository url: ssh://git@github.com/buroa/k8s-gitops ref: refs/heads/master - path: ./kubernetes/flux/config + path: ./kubernetes/flux/cluster pullSecret: github-deploy-key kustomize: patches: diff --git a/kubernetes/flux/config/cluster.yaml b/kubernetes/flux/cluster/ks.yaml similarity index 74% rename from kubernetes/flux/config/cluster.yaml rename to kubernetes/flux/cluster/ks.yaml index b1ac52ad63..7b75fdb294 100644 --- a/kubernetes/flux/config/cluster.yaml +++ b/kubernetes/flux/cluster/ks.yaml @@ -2,30 +2,12 @@ apiVersion: kustomize.toolkit.fluxcd.io/v1 kind: Kustomization metadata: - name: cluster-repositories + name: cluster-meta namespace: flux-system spec: interval: 30m - path: ./kubernetes/flux/repositories - prune: false # revert after - wait: true - sourceRef: - kind: GitRepository - name: flux-system - decryption: - provider: sops - secretRef: - name: sops-age ---- -apiVersion: kustomize.toolkit.fluxcd.io/v1 -kind: Kustomization -metadata: - name: cluster-settings - namespace: flux-system -spec: - interval: 30m - path: ./kubernetes/flux/settings - prune: false # revert after + path: ./kubernetes/flux/meta + prune: true wait: true sourceRef: kind: GitRepository @@ -43,8 +25,7 @@ metadata: spec: interval: 30m dependsOn: - - name: cluster-repositories - - name: cluster-settings + - name: cluster-meta path: ./kubernetes/apps prune: false # revert after sourceRef: diff --git a/kubernetes/flux/config/kustomization.yaml b/kubernetes/flux/meta/kustomization.yaml similarity index 69% rename from kubernetes/flux/config/kustomization.yaml rename to kubernetes/flux/meta/kustomization.yaml index 303f5b43ae..ce2df84df2 100644 --- a/kubernetes/flux/config/kustomization.yaml +++ b/kubernetes/flux/meta/kustomization.yaml @@ -2,4 +2,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - - ./cluster.yaml + - ./repositories + - ./settings diff --git a/kubernetes/flux/repositories/git/kustomization.yaml b/kubernetes/flux/meta/repositories/git/kustomization.yaml similarity index 100% rename from kubernetes/flux/repositories/git/kustomization.yaml rename to kubernetes/flux/meta/repositories/git/kustomization.yaml diff --git a/kubernetes/flux/repositories/helm/actions-runner-controller.yaml b/kubernetes/flux/meta/repositories/helm/actions-runner-controller.yaml similarity index 100% rename from kubernetes/flux/repositories/helm/actions-runner-controller.yaml rename to kubernetes/flux/meta/repositories/helm/actions-runner-controller.yaml diff --git a/kubernetes/flux/repositories/helm/backube.yaml b/kubernetes/flux/meta/repositories/helm/backube.yaml similarity index 100% rename from kubernetes/flux/repositories/helm/backube.yaml rename to kubernetes/flux/meta/repositories/helm/backube.yaml diff --git a/kubernetes/flux/repositories/helm/bjw-s.yaml b/kubernetes/flux/meta/repositories/helm/bjw-s.yaml similarity index 100% rename from kubernetes/flux/repositories/helm/bjw-s.yaml rename to kubernetes/flux/meta/repositories/helm/bjw-s.yaml diff --git a/kubernetes/flux/repositories/helm/cilium.yaml b/kubernetes/flux/meta/repositories/helm/cilium.yaml similarity index 100% rename from kubernetes/flux/repositories/helm/cilium.yaml rename to kubernetes/flux/meta/repositories/helm/cilium.yaml diff --git a/kubernetes/flux/repositories/helm/cloudnative-pg.yaml b/kubernetes/flux/meta/repositories/helm/cloudnative-pg.yaml similarity index 100% rename from kubernetes/flux/repositories/helm/cloudnative-pg.yaml rename to kubernetes/flux/meta/repositories/helm/cloudnative-pg.yaml diff --git a/kubernetes/flux/repositories/helm/controlplaneio.yaml b/kubernetes/flux/meta/repositories/helm/controlplaneio.yaml similarity index 100% rename from kubernetes/flux/repositories/helm/controlplaneio.yaml rename to kubernetes/flux/meta/repositories/helm/controlplaneio.yaml diff --git a/kubernetes/flux/repositories/helm/coredns.yaml b/kubernetes/flux/meta/repositories/helm/coredns.yaml similarity index 100% rename from kubernetes/flux/repositories/helm/coredns.yaml rename to kubernetes/flux/meta/repositories/helm/coredns.yaml diff --git a/kubernetes/flux/repositories/helm/deliveryhero.yaml b/kubernetes/flux/meta/repositories/helm/deliveryhero.yaml similarity index 100% rename from kubernetes/flux/repositories/helm/deliveryhero.yaml rename to kubernetes/flux/meta/repositories/helm/deliveryhero.yaml diff --git a/kubernetes/flux/repositories/helm/emqx.yaml b/kubernetes/flux/meta/repositories/helm/emqx.yaml similarity index 100% rename from kubernetes/flux/repositories/helm/emqx.yaml rename to kubernetes/flux/meta/repositories/helm/emqx.yaml diff --git a/kubernetes/flux/repositories/helm/external-dns.yaml b/kubernetes/flux/meta/repositories/helm/external-dns.yaml similarity index 100% rename from kubernetes/flux/repositories/helm/external-dns.yaml rename to kubernetes/flux/meta/repositories/helm/external-dns.yaml diff --git a/kubernetes/flux/repositories/helm/external-secrets.yaml b/kubernetes/flux/meta/repositories/helm/external-secrets.yaml similarity index 100% rename from kubernetes/flux/repositories/helm/external-secrets.yaml rename to kubernetes/flux/meta/repositories/helm/external-secrets.yaml diff --git a/kubernetes/flux/repositories/helm/fairwinds.yaml b/kubernetes/flux/meta/repositories/helm/fairwinds.yaml similarity index 100% rename from kubernetes/flux/repositories/helm/fairwinds.yaml rename to kubernetes/flux/meta/repositories/helm/fairwinds.yaml diff --git a/kubernetes/flux/repositories/helm/grafana.yaml b/kubernetes/flux/meta/repositories/helm/grafana.yaml similarity index 100% rename from kubernetes/flux/repositories/helm/grafana.yaml rename to kubernetes/flux/meta/repositories/helm/grafana.yaml diff --git a/kubernetes/flux/repositories/helm/ingress-nginx.yaml b/kubernetes/flux/meta/repositories/helm/ingress-nginx.yaml similarity index 100% rename from kubernetes/flux/repositories/helm/ingress-nginx.yaml rename to kubernetes/flux/meta/repositories/helm/ingress-nginx.yaml diff --git a/kubernetes/flux/repositories/helm/intel.yaml b/kubernetes/flux/meta/repositories/helm/intel.yaml similarity index 100% rename from kubernetes/flux/repositories/helm/intel.yaml rename to kubernetes/flux/meta/repositories/helm/intel.yaml diff --git a/kubernetes/flux/repositories/helm/jetstack.yaml b/kubernetes/flux/meta/repositories/helm/jetstack.yaml similarity index 100% rename from kubernetes/flux/repositories/helm/jetstack.yaml rename to kubernetes/flux/meta/repositories/helm/jetstack.yaml diff --git a/kubernetes/flux/repositories/helm/kubernetes-sigs-descheduler.yaml b/kubernetes/flux/meta/repositories/helm/kubernetes-sigs-descheduler.yaml similarity index 100% rename from kubernetes/flux/repositories/helm/kubernetes-sigs-descheduler.yaml rename to kubernetes/flux/meta/repositories/helm/kubernetes-sigs-descheduler.yaml diff --git a/kubernetes/flux/repositories/helm/kustomization.yaml b/kubernetes/flux/meta/repositories/helm/kustomization.yaml similarity index 100% rename from kubernetes/flux/repositories/helm/kustomization.yaml rename to kubernetes/flux/meta/repositories/helm/kustomization.yaml diff --git a/kubernetes/flux/repositories/helm/kyverno.yaml b/kubernetes/flux/meta/repositories/helm/kyverno.yaml similarity index 100% rename from kubernetes/flux/repositories/helm/kyverno.yaml rename to kubernetes/flux/meta/repositories/helm/kyverno.yaml diff --git a/kubernetes/flux/repositories/helm/metrics-server.yaml b/kubernetes/flux/meta/repositories/helm/metrics-server.yaml similarity index 100% rename from kubernetes/flux/repositories/helm/metrics-server.yaml rename to kubernetes/flux/meta/repositories/helm/metrics-server.yaml diff --git a/kubernetes/flux/repositories/helm/node-feature-discovery.yaml b/kubernetes/flux/meta/repositories/helm/node-feature-discovery.yaml similarity index 100% rename from kubernetes/flux/repositories/helm/node-feature-discovery.yaml rename to kubernetes/flux/meta/repositories/helm/node-feature-discovery.yaml diff --git a/kubernetes/flux/repositories/helm/openebs.yaml b/kubernetes/flux/meta/repositories/helm/openebs.yaml similarity index 100% rename from kubernetes/flux/repositories/helm/openebs.yaml rename to kubernetes/flux/meta/repositories/helm/openebs.yaml diff --git a/kubernetes/flux/repositories/helm/piraeus.yaml b/kubernetes/flux/meta/repositories/helm/piraeus.yaml similarity index 100% rename from kubernetes/flux/repositories/helm/piraeus.yaml rename to kubernetes/flux/meta/repositories/helm/piraeus.yaml diff --git a/kubernetes/flux/repositories/helm/prometheus-community.yaml b/kubernetes/flux/meta/repositories/helm/prometheus-community.yaml similarity index 100% rename from kubernetes/flux/repositories/helm/prometheus-community.yaml rename to kubernetes/flux/meta/repositories/helm/prometheus-community.yaml diff --git a/kubernetes/flux/repositories/helm/rook-ceph.yaml b/kubernetes/flux/meta/repositories/helm/rook-ceph.yaml similarity index 100% rename from kubernetes/flux/repositories/helm/rook-ceph.yaml rename to kubernetes/flux/meta/repositories/helm/rook-ceph.yaml diff --git a/kubernetes/flux/repositories/helm/spegel.yaml b/kubernetes/flux/meta/repositories/helm/spegel.yaml similarity index 100% rename from kubernetes/flux/repositories/helm/spegel.yaml rename to kubernetes/flux/meta/repositories/helm/spegel.yaml diff --git a/kubernetes/flux/repositories/helm/stakater.yaml b/kubernetes/flux/meta/repositories/helm/stakater.yaml similarity index 100% rename from kubernetes/flux/repositories/helm/stakater.yaml rename to kubernetes/flux/meta/repositories/helm/stakater.yaml diff --git a/kubernetes/flux/repositories/helm/stevehipwell.yaml b/kubernetes/flux/meta/repositories/helm/stevehipwell.yaml similarity index 100% rename from kubernetes/flux/repositories/helm/stevehipwell.yaml rename to kubernetes/flux/meta/repositories/helm/stevehipwell.yaml diff --git a/kubernetes/flux/repositories/kustomization.yaml b/kubernetes/flux/meta/repositories/kustomization.yaml similarity index 100% rename from kubernetes/flux/repositories/kustomization.yaml rename to kubernetes/flux/meta/repositories/kustomization.yaml diff --git a/kubernetes/flux/repositories/oci/kustomization.yaml b/kubernetes/flux/meta/repositories/oci/kustomization.yaml similarity index 100% rename from kubernetes/flux/repositories/oci/kustomization.yaml rename to kubernetes/flux/meta/repositories/oci/kustomization.yaml diff --git a/kubernetes/flux/settings/kustomization.yaml b/kubernetes/flux/meta/settings/kustomization.yaml similarity index 100% rename from kubernetes/flux/settings/kustomization.yaml rename to kubernetes/flux/meta/settings/kustomization.yaml