Skip to content

Commit 49fbc58

Browse files
web-flowclaude
andcommitted
fix(gitops): add Flux Kustomization dependency for MetalLB IPAddressPool
MetalLB IPAddressPool requires MetalLB CRDs to exist first. Without dependency ordering, Flux dry-run fails with: "no matches for kind IPAddressPool in version metallb.io/v1beta1" Changes: - Add flux-kustomization.yaml with dependsOn: flux-system - Move address-pool.yaml to resources/ subdirectory - Health check waits for MetalLB HelmRelease to be ready This follows the same pattern as cert-manager-config. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 49124d7 commit 49fbc58

5 files changed

Lines changed: 33 additions & 2 deletions

File tree

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
# Flux Kustomization for MetalLB CRD-dependent resources (IPAddressPool, L2Advertisement)
3+
# This waits for MetalLB HelmRelease to be ready before applying
4+
apiVersion: kustomize.toolkit.fluxcd.io/v1
5+
kind: Kustomization
6+
metadata:
7+
name: metallb-config
8+
namespace: flux-system
9+
spec:
10+
interval: 10m
11+
path: ./gitops/clusters/homelab/infrastructure-config/metallb-config/resources
12+
prune: true
13+
sourceRef:
14+
kind: GitRepository
15+
name: flux-system
16+
# Wait for MetalLB HelmRelease to be ready (CRDs installed)
17+
dependsOn:
18+
- name: flux-system # Main kustomization deploys MetalLB HelmRelease
19+
# Health checks to ensure MetalLB is actually ready
20+
healthChecks:
21+
- apiVersion: helm.toolkit.fluxcd.io/v2
22+
kind: HelmRelease
23+
name: metallb
24+
namespace: metallb-system

gitops/clusters/homelab/infrastructure-config/metallb-config/kustomization.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,7 @@
22
apiVersion: kustomize.config.k8s.io/v1beta1
33
kind: Kustomization
44
resources:
5-
- address-pool.yaml
5+
# The Flux Kustomization that applies resources/ with dependency on MetalLB HelmRelease
6+
- flux-kustomization.yaml
7+
# NOTE: address-pool.yaml moved to resources/ and applied by the Flux Kustomization above
8+
# This ensures MetalLB CRDs exist before IPAddressPool is applied

gitops/clusters/homelab/infrastructure-config/metallb-config/address-pool.yaml renamed to gitops/clusters/homelab/infrastructure-config/metallb-config/resources/address-pool.yaml

File renamed without changes.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
resources:
4+
- address-pool.yaml

gitops/clusters/homelab/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ resources:
1313
- infrastructure/cert-manager #(LetsEncrypt DNS-01 certs - HelmRelease)
1414
- infrastructure/cert-manager-config #(ClusterIssuer, Certs - depends on CRDs)
1515
- infrastructure/traefik-config #(TLSStore, HA IngressRoute - depends on certs)
16-
- infrastructure-config/metallb-config #(address-pool)
16+
- infrastructure-config/metallb-config #(Flux Kustomization that applies IPAddressPool after MetalLB CRDs ready)
1717
# Crossplane-managed Proxmox instances (VMs/LXCs)
1818
# NOTE: Requires crossplane-system secret first - see scripts/crossplane/create-proxmox-secret.sh
1919
- instances # K3s VMs, LXC containers managed by Crossplane

0 commit comments

Comments
 (0)