deploy metallb to internal cluster and rebove ingress

This commit is contained in:
2025-08-04 14:04:50 -05:00
parent fabc113c84
commit 79706c90ff
13 changed files with 171 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
---
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: metallb-operator
namespace: openshift-gitops
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
goTemplate: true
goTemplateOptions: ["missingkey=error"]
generators:
# - clusters: {} # Variable is .name
- list: # Variable is .cluster
elements:
- cluster: internal
template:
metadata:
name: '{{.cluster}}-metallb-operator'
annotations:
argocd.argoproj.io/sync-wave: "2"
spec:
destination:
name: '{{.cluster}}'
namespace: metallb-system
project: default
source:
path: cluster/metallb-operator/overlays/{{.cluster}}
repoURL: https://github.com/rblundon/homelab.git
targetRevision: HEAD
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- RespectIgnoreDifferences=true
- CreateNamespace=true
managedNamespaceMetadata:
labels:
argocd.argoproj.io/managed-by: argocd
ignoreDifferences:
- group: apps
kind: Deployment
jsonPointers:
- /spec/replicas

View File

@@ -0,0 +1,11 @@
---
apiVersion: metallb.io/v1beta1
kind: BGPAdvertisement
metadata:
name: bgp-advert
namespace: metallb-system
spec:
aggregationLength: 32
aggregationLengthV6: 128
ipAddressPools:
- bgp-ip-addresspool

View File

@@ -0,0 +1,15 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
commonAnnotations:
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
resources:
# Operator deployment
- namespace.yaml
- subscription.yaml
- operatorgroup.yaml
# Deploy cluster resources
- metallb.yaml
- bgp_advertisement.yaml

View File

@@ -0,0 +1,7 @@
---
apiVersion: metallb.io/v1beta1
kind: MetalLB
metadata:
name: metallb
namespace: metallb-system
spec: {}

View File

@@ -0,0 +1,13 @@
---
apiVersion: v1
kind: Namespace
metadata:
labels:
kubernetes.io/metadata.name: metallb-system
name: metallb-system
argocd.argoproj.io/managed-by: openshift-gitops-operator
openshift.io/cluster-monitoring: 'true'
name: metallb-system
spec:
finalizers:
- kubernetes

View File

@@ -0,0 +1,9 @@
---
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
name: metallb-operator
namespace: metallb-system
#spec:
# targetNamespaces:
# - metallb-system

View File

@@ -0,0 +1,12 @@
---
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: metallb-operator
namespace: metallb-system
spec:
channel: stable
installPlanApproval: Automatic #Manual
name: metallb-operator
source: redhat-operators
sourceNamespace: openshift-marketplace

View File

@@ -0,0 +1,12 @@
---
apiVersion: metallb.io/v1beta2
kind: BGPPeer
metadata:
name: bgp-peer-worlddrive
namespace: metallb-system
spec:
disableMP: false
myASN: 65003
peerASN: 65002
peerAddress: 10.1.71.1
peerPort: 179

View File

@@ -0,0 +1,12 @@
---
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
name: bgp-ip-addresspool
namespace: metallb-system
spec:
addresses:
- 10.1.182.0/24
autoAssign: true
avoidBuggyIPs: false

View File

@@ -0,0 +1,12 @@
---
apiVersion: metallb.io/v1beta2
kind: BGPPeer
metadata:
name: bgp-peer-worlddrive
namespace: metallb-system
spec:
disableMP: false
myASN: 65001
peerASN: 65002
peerAddress: 10.1.71.1
peerPort: 179

View File

@@ -0,0 +1,12 @@
---
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
name: bgp-ip-addresspool
namespace: metallb-system
spec:
addresses:
- 10.1.82.0/24
autoAssign: true
avoidBuggyIPs: false

View File

@@ -0,0 +1,10 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
commonAnnotations:
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
resources:
- ../../base
- bgp_peer.yaml
- ip_addresspool.yaml