From 6cdfd6240143ccd4f84e87df0e068613b7d78c1e Mon Sep 17 00:00:00 2001 From: Ryan Cavicchioni Date: Thu, 23 Jan 2025 14:22:09 -0600 Subject: [PATCH] install metallb first --- clusters/k8s-cluster/infrastructure.yaml | 36 ++++++++++++++----- clusters/my-cluster/infrastructure.yaml | 36 ++++++++++++++----- .../metallb-system/kustomization.yaml | 5 --- .../metallb-system}/ip-address-pool.yaml | 0 .../metallb-system}/kustomization.yaml | 2 ++ .../metallb-system}/l2-advertisement.yaml | 0 .../metallb-system/metallb-native.yaml | 0 7 files changed, 56 insertions(+), 23 deletions(-) delete mode 100644 infrastructure/controllers/metallb-system/kustomization.yaml rename infrastructure/{configs => loadbalancer/metallb-system}/ip-address-pool.yaml (100%) rename infrastructure/{configs => loadbalancer/metallb-system}/kustomization.yaml (81%) rename infrastructure/{configs => loadbalancer/metallb-system}/l2-advertisement.yaml (100%) rename infrastructure/{controllers => loadbalancer}/metallb-system/metallb-native.yaml (100%) diff --git a/clusters/k8s-cluster/infrastructure.yaml b/clusters/k8s-cluster/infrastructure.yaml index 1a920b1..71c9617 100644 --- a/clusters/k8s-cluster/infrastructure.yaml +++ b/clusters/k8s-cluster/infrastructure.yaml @@ -1,10 +1,37 @@ --- apiVersion: kustomize.toolkit.fluxcd.io/v1 kind: Kustomization +metadata: + name: infra-loadbalancer + namespace: flux-system +spec: + interval: 1h + retryInterval: 1m + timeout: 5m + sourceRef: + kind: GitRepository + name: flux-system + path: ./infrastructure/loadbalancer + prune: true + wait: true + patches: + - patch: | + - op: replace + path: /spec/addresses + value: + - 10.100.100.220-10.100.100.229 + target: + kind: IPAddressPool + name: first-pool +--- +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization metadata: name: infra-controllers namespace: flux-system spec: + dependsOn: + - name: infra-loadbalancer interval: 1h retryInterval: 1m timeout: 5m @@ -31,12 +58,3 @@ spec: 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/infrastructure.yaml b/clusters/my-cluster/infrastructure.yaml index ad93698..a63e431 100644 --- a/clusters/my-cluster/infrastructure.yaml +++ b/clusters/my-cluster/infrastructure.yaml @@ -1,10 +1,37 @@ --- apiVersion: kustomize.toolkit.fluxcd.io/v1 kind: Kustomization +metadata: + name: infra-loadbalancer + namespace: flux-system +spec: + interval: 1h + retryInterval: 1m + timeout: 5m + sourceRef: + kind: GitRepository + name: flux-system + path: ./infrastructure/loadbalancer + prune: true + wait: true + patches: + - patch: | + - op: replace + path: /spec/addresses + value: + - 10.100.100.210-10.100.100.219 + target: + kind: IPAddressPool + name: first-pool +--- +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization metadata: name: infra-controllers namespace: flux-system spec: + dependsOn: + - name: infra-loadbalancer interval: 1h retryInterval: 1m timeout: 5m @@ -31,12 +58,3 @@ spec: 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/infrastructure/controllers/metallb-system/kustomization.yaml b/infrastructure/controllers/metallb-system/kustomization.yaml deleted file mode 100644 index d865844..0000000 --- a/infrastructure/controllers/metallb-system/kustomization.yaml +++ /dev/null @@ -1,5 +0,0 @@ ---- -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -resources: - - metallb-native.yaml diff --git a/infrastructure/configs/ip-address-pool.yaml b/infrastructure/loadbalancer/metallb-system/ip-address-pool.yaml similarity index 100% rename from infrastructure/configs/ip-address-pool.yaml rename to infrastructure/loadbalancer/metallb-system/ip-address-pool.yaml diff --git a/infrastructure/configs/kustomization.yaml b/infrastructure/loadbalancer/metallb-system/kustomization.yaml similarity index 81% rename from infrastructure/configs/kustomization.yaml rename to infrastructure/loadbalancer/metallb-system/kustomization.yaml index 89fbc1f..9bb68de 100644 --- a/infrastructure/configs/kustomization.yaml +++ b/infrastructure/loadbalancer/metallb-system/kustomization.yaml @@ -1,5 +1,7 @@ +--- apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: + - metallb-native.yaml - ip-address-pool.yaml - l2-advertisement.yaml diff --git a/infrastructure/configs/l2-advertisement.yaml b/infrastructure/loadbalancer/metallb-system/l2-advertisement.yaml similarity index 100% rename from infrastructure/configs/l2-advertisement.yaml rename to infrastructure/loadbalancer/metallb-system/l2-advertisement.yaml diff --git a/infrastructure/controllers/metallb-system/metallb-native.yaml b/infrastructure/loadbalancer/metallb-system/metallb-native.yaml similarity index 100% rename from infrastructure/controllers/metallb-system/metallb-native.yaml rename to infrastructure/loadbalancer/metallb-system/metallb-native.yaml