This commit is contained in:
azykov@mail.ru
2026-07-21 21:49:41 +03:00
parent 0d0510f548
commit 7fe208ec88
8 changed files with 107 additions and 0 deletions
+58
View File
@@ -0,0 +1,58 @@
# a general pool for everything but mqtt and public IP facing ingress controller
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
name: default-pool
namespace: metallb-system
spec:
addresses:
- 10.0.64.5-10.0.64.6
# exclude 10.0.64.7, its in dmz-pool
# exclude 10.0.64.8, its in mqtt-pool
- 10.0.64.9-10.0.64.19
autoAssign: true
serviceAllocation:
serviceSelectors:
- matchLabels:
loadBalancerPool: default
---
# DMZ (not really, just for clarity) ip, will have ports forwarded from WAN router
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
name: dmz-pool
namespace: metallb-system
spec:
addresses:
- 10.0.64.7/32
autoAssign: true
serviceAllocation:
serviceSelectors:
- matchLabels:
loadBalancerPool: dmz
---
# reserve 10.0.64.8 (for historical reasons) for mqtt
# ! do not forget to label the mqtt service with "loadBalancerPool: mqtt" !
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
name: mqtt-pool
namespace: metallb-system
spec:
addresses:
- 10.0.64.8/32
serviceAllocation:
serviceSelectors:
- matchLabels:
loadBalancerPool: mqtt
---
apiVersion: metallb.io/v1beta1
kind: L2Advertisement
metadata:
name: default
namespace: metallb-system
spec:
ipAddressPools:
- default-pool
- dmz-pool
- mqtt-pool
@@ -0,0 +1,15 @@
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: metallb
namespace: metallb-system
spec:
interval: 10m
chart:
spec:
chart: metallb
version: "0.16.1"
sourceRef:
kind: HelmRepository
name: metallb
namespace: metallb-system
@@ -0,0 +1,8 @@
apiVersion: source.toolkit.fluxcd.io/v1
kind: HelmRepository
metadata:
name: metallb
namespace: metallb-system
spec:
interval: 1h
url: https://metallb.github.io/metallb
@@ -0,0 +1,6 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- helmrepository.yaml
- helmrelease.yaml
- config.yaml
@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: metallb-system
+1
View File
@@ -4,3 +4,4 @@ resources:
- longhorn/longhorn-system.yaml
- longhorn/storage-classes.yaml
- cert-manager/certificate-issuers.yaml
- metallb.yaml
+14
View File
@@ -0,0 +1,14 @@
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: metallb
namespace: flux-system
spec:
interval: 10m
sourceRef:
kind: GitRepository
name: flux-system
path: ./clusters/base/infra/metallb
prune: true
wait: true
retryInterval: 5s
@@ -6,3 +6,4 @@ resources:
- ../../base/namespaces/pim.yaml
- ../../base/namespaces/longhorn-system.yaml
- ../../base/namespaces/auth.yaml
- ../../base/namespaces/metallb-system.yaml