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