From e9cacb2ae2ae41a595f8eba6b87619a9002c5463 Mon Sep 17 00:00:00 2001 From: Ryan Cavicchioni Date: Wed, 22 Jan 2025 15:00:58 -0600 Subject: [PATCH] restructure repository --- clusters/k8s-cluster/infrastructure.yaml | 42 +++++++++++++++++++ clusters/my-cluster/apps.yaml | 2 + clusters/my-cluster/infrastructure.yaml | 42 +++++++++++++++++++ .../configs}/ip-address-pool.yaml | 0 infrastructure/configs/kustomization.yaml | 5 +++ .../configs}/l2-advertisement.yaml | 0 .../controllers}/flagger/kustomization.yaml | 0 .../controllers}/flagger/namespace.yaml | 0 .../controllers}/flagger/release.yaml | 0 .../controllers}/flagger/repository.yaml | 0 .../ingress-nginx/kustomization.yaml | 0 .../controllers}/ingress-nginx/namespace.yaml | 0 .../controllers}/ingress-nginx/release.yaml | 0 .../ingress-nginx/repository.yaml | 0 .../metallb-system/kustomization.yaml | 0 .../metallb-system/metallb-native.yaml | 0 .../controllers}/reloader/kustomization.yaml | 0 .../controllers}/reloader/namespace.yaml | 0 .../controllers}/reloader/release.yaml | 0 .../controllers}/reloader/repository.yaml | 0 .../sealedsecrets/kustomization.yaml | 0 .../controllers}/traefik/kustomization.yaml | 0 .../controllers}/traefik/namespace.yaml | 0 .../controllers}/traefik/release.yaml | 0 .../controllers}/traefik/repository.yaml | 0 25 files changed, 91 insertions(+) create mode 100644 clusters/k8s-cluster/infrastructure.yaml create mode 100644 clusters/my-cluster/infrastructure.yaml rename {clusters/my-cluster/metallb-system => infrastructure/configs}/ip-address-pool.yaml (100%) create mode 100644 infrastructure/configs/kustomization.yaml rename {clusters/my-cluster/metallb-system => infrastructure/configs}/l2-advertisement.yaml (100%) rename {apps => infrastructure/controllers}/flagger/kustomization.yaml (100%) rename {apps => infrastructure/controllers}/flagger/namespace.yaml (100%) rename {apps => infrastructure/controllers}/flagger/release.yaml (100%) rename {apps => infrastructure/controllers}/flagger/repository.yaml (100%) rename {apps => infrastructure/controllers}/ingress-nginx/kustomization.yaml (100%) rename {apps => infrastructure/controllers}/ingress-nginx/namespace.yaml (100%) rename {apps => infrastructure/controllers}/ingress-nginx/release.yaml (100%) rename {apps => infrastructure/controllers}/ingress-nginx/repository.yaml (100%) rename {apps => infrastructure/controllers}/metallb-system/kustomization.yaml (100%) rename {apps => infrastructure/controllers}/metallb-system/metallb-native.yaml (100%) rename {apps => infrastructure/controllers}/reloader/kustomization.yaml (100%) rename {apps => infrastructure/controllers}/reloader/namespace.yaml (100%) rename {apps => infrastructure/controllers}/reloader/release.yaml (100%) rename {apps => infrastructure/controllers}/reloader/repository.yaml (100%) rename {apps => infrastructure/controllers}/sealedsecrets/kustomization.yaml (100%) rename {apps => infrastructure/controllers}/traefik/kustomization.yaml (100%) rename {apps => infrastructure/controllers}/traefik/namespace.yaml (100%) rename {apps => infrastructure/controllers}/traefik/release.yaml (100%) rename {apps => infrastructure/controllers}/traefik/repository.yaml (100%) diff --git a/clusters/k8s-cluster/infrastructure.yaml b/clusters/k8s-cluster/infrastructure.yaml new file mode 100644 index 0000000..1a920b1 --- /dev/null +++ b/clusters/k8s-cluster/infrastructure.yaml @@ -0,0 +1,42 @@ +--- +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: infra-controllers + namespace: flux-system +spec: + interval: 1h + retryInterval: 1m + timeout: 5m + sourceRef: + kind: GitRepository + name: flux-system + path: ./infrastructure/controllers + prune: true + wait: true +--- +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: infra-configs + namespace: flux-system +spec: + dependsOn: + - name: infra-controllers + interval: 1h + retryInterval: 1m + timeout: 5m + sourceRef: + kind: GitRepository + name: flux-system + path: ./infrastructure/configs + prune: true + patches: + - patch: | + - op: replace + path: /spec/addresses + value: + - 10.100.100.220-10.100.100.229 + target: + kind: IPAddressPool + name: first-pool diff --git a/clusters/my-cluster/apps.yaml b/clusters/my-cluster/apps.yaml index 34c6e98..d3e6fdf 100644 --- a/clusters/my-cluster/apps.yaml +++ b/clusters/my-cluster/apps.yaml @@ -6,6 +6,8 @@ metadata: namespace: flux-system spec: interval: 10m0s + dependsOn: + - name: infra-configs sourceRef: kind: GitRepository name: flux-system diff --git a/clusters/my-cluster/infrastructure.yaml b/clusters/my-cluster/infrastructure.yaml new file mode 100644 index 0000000..ad93698 --- /dev/null +++ b/clusters/my-cluster/infrastructure.yaml @@ -0,0 +1,42 @@ +--- +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: infra-controllers + namespace: flux-system +spec: + interval: 1h + retryInterval: 1m + timeout: 5m + sourceRef: + kind: GitRepository + name: flux-system + path: ./infrastructure/controllers + prune: true + wait: true +--- +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: infra-configs + namespace: flux-system +spec: + dependsOn: + - name: infra-controllers + interval: 1h + retryInterval: 1m + timeout: 5m + sourceRef: + kind: GitRepository + name: flux-system + path: ./infrastructure/configs + prune: true + patches: + - patch: | + - op: replace + path: /spec/addresses + value: + - 10.100.100.210-10.100.100.219 + target: + kind: IPAddressPool + name: first-pool diff --git a/clusters/my-cluster/metallb-system/ip-address-pool.yaml b/infrastructure/configs/ip-address-pool.yaml similarity index 100% rename from clusters/my-cluster/metallb-system/ip-address-pool.yaml rename to infrastructure/configs/ip-address-pool.yaml diff --git a/infrastructure/configs/kustomization.yaml b/infrastructure/configs/kustomization.yaml new file mode 100644 index 0000000..89fbc1f --- /dev/null +++ b/infrastructure/configs/kustomization.yaml @@ -0,0 +1,5 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - ip-address-pool.yaml + - l2-advertisement.yaml diff --git a/clusters/my-cluster/metallb-system/l2-advertisement.yaml b/infrastructure/configs/l2-advertisement.yaml similarity index 100% rename from clusters/my-cluster/metallb-system/l2-advertisement.yaml rename to infrastructure/configs/l2-advertisement.yaml diff --git a/apps/flagger/kustomization.yaml b/infrastructure/controllers/flagger/kustomization.yaml similarity index 100% rename from apps/flagger/kustomization.yaml rename to infrastructure/controllers/flagger/kustomization.yaml diff --git a/apps/flagger/namespace.yaml b/infrastructure/controllers/flagger/namespace.yaml similarity index 100% rename from apps/flagger/namespace.yaml rename to infrastructure/controllers/flagger/namespace.yaml diff --git a/apps/flagger/release.yaml b/infrastructure/controllers/flagger/release.yaml similarity index 100% rename from apps/flagger/release.yaml rename to infrastructure/controllers/flagger/release.yaml diff --git a/apps/flagger/repository.yaml b/infrastructure/controllers/flagger/repository.yaml similarity index 100% rename from apps/flagger/repository.yaml rename to infrastructure/controllers/flagger/repository.yaml diff --git a/apps/ingress-nginx/kustomization.yaml b/infrastructure/controllers/ingress-nginx/kustomization.yaml similarity index 100% rename from apps/ingress-nginx/kustomization.yaml rename to infrastructure/controllers/ingress-nginx/kustomization.yaml diff --git a/apps/ingress-nginx/namespace.yaml b/infrastructure/controllers/ingress-nginx/namespace.yaml similarity index 100% rename from apps/ingress-nginx/namespace.yaml rename to infrastructure/controllers/ingress-nginx/namespace.yaml diff --git a/apps/ingress-nginx/release.yaml b/infrastructure/controllers/ingress-nginx/release.yaml similarity index 100% rename from apps/ingress-nginx/release.yaml rename to infrastructure/controllers/ingress-nginx/release.yaml diff --git a/apps/ingress-nginx/repository.yaml b/infrastructure/controllers/ingress-nginx/repository.yaml similarity index 100% rename from apps/ingress-nginx/repository.yaml rename to infrastructure/controllers/ingress-nginx/repository.yaml diff --git a/apps/metallb-system/kustomization.yaml b/infrastructure/controllers/metallb-system/kustomization.yaml similarity index 100% rename from apps/metallb-system/kustomization.yaml rename to infrastructure/controllers/metallb-system/kustomization.yaml diff --git a/apps/metallb-system/metallb-native.yaml b/infrastructure/controllers/metallb-system/metallb-native.yaml similarity index 100% rename from apps/metallb-system/metallb-native.yaml rename to infrastructure/controllers/metallb-system/metallb-native.yaml diff --git a/apps/reloader/kustomization.yaml b/infrastructure/controllers/reloader/kustomization.yaml similarity index 100% rename from apps/reloader/kustomization.yaml rename to infrastructure/controllers/reloader/kustomization.yaml diff --git a/apps/reloader/namespace.yaml b/infrastructure/controllers/reloader/namespace.yaml similarity index 100% rename from apps/reloader/namespace.yaml rename to infrastructure/controllers/reloader/namespace.yaml diff --git a/apps/reloader/release.yaml b/infrastructure/controllers/reloader/release.yaml similarity index 100% rename from apps/reloader/release.yaml rename to infrastructure/controllers/reloader/release.yaml diff --git a/apps/reloader/repository.yaml b/infrastructure/controllers/reloader/repository.yaml similarity index 100% rename from apps/reloader/repository.yaml rename to infrastructure/controllers/reloader/repository.yaml diff --git a/apps/sealedsecrets/kustomization.yaml b/infrastructure/controllers/sealedsecrets/kustomization.yaml similarity index 100% rename from apps/sealedsecrets/kustomization.yaml rename to infrastructure/controllers/sealedsecrets/kustomization.yaml diff --git a/apps/traefik/kustomization.yaml b/infrastructure/controllers/traefik/kustomization.yaml similarity index 100% rename from apps/traefik/kustomization.yaml rename to infrastructure/controllers/traefik/kustomization.yaml diff --git a/apps/traefik/namespace.yaml b/infrastructure/controllers/traefik/namespace.yaml similarity index 100% rename from apps/traefik/namespace.yaml rename to infrastructure/controllers/traefik/namespace.yaml diff --git a/apps/traefik/release.yaml b/infrastructure/controllers/traefik/release.yaml similarity index 100% rename from apps/traefik/release.yaml rename to infrastructure/controllers/traefik/release.yaml diff --git a/apps/traefik/repository.yaml b/infrastructure/controllers/traefik/repository.yaml similarity index 100% rename from apps/traefik/repository.yaml rename to infrastructure/controllers/traefik/repository.yaml