Moves setup files into embedded package.
This commit is contained in:
0
internal/setup/cluster-services/metallb/README.md
Normal file
0
internal/setup/cluster-services/metallb/README.md
Normal file
56
internal/setup/cluster-services/metallb/install.sh
Executable file
56
internal/setup/cluster-services/metallb/install.sh
Executable file
@@ -0,0 +1,56 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
# Ensure WILD_INSTANCE is set
|
||||
if [ -z "${WILD_INSTANCE}" ]; then
|
||||
echo "❌ ERROR: WILD_INSTANCE is not set"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Ensure WILD_CENTRAL_DATA is set
|
||||
if [ -z "${WILD_CENTRAL_DATA}" ]; then
|
||||
echo "❌ ERROR: WILD_CENTRAL_DATA is not set"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Ensure KUBECONFIG is set
|
||||
if [ -z "${KUBECONFIG}" ]; then
|
||||
echo "❌ ERROR: KUBECONFIG is not set"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
INSTANCE_DIR="${WILD_CENTRAL_DATA}/instances/${WILD_INSTANCE}"
|
||||
CLUSTER_SETUP_DIR="${INSTANCE_DIR}/setup/cluster-services"
|
||||
METALLB_DIR="${CLUSTER_SETUP_DIR}/metallb"
|
||||
|
||||
echo "🔧 === Setting up MetalLB ==="
|
||||
echo ""
|
||||
|
||||
# Templates should already be compiled
|
||||
echo "📦 Using pre-compiled MetalLB templates..."
|
||||
if [ ! -d "${METALLB_DIR}/kustomize" ]; then
|
||||
echo "❌ ERROR: Compiled templates not found at ${METALLB_DIR}/kustomize"
|
||||
echo "Templates should be compiled before deployment."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "🚀 Deploying MetalLB installation..."
|
||||
kubectl apply -k ${METALLB_DIR}/kustomize/installation
|
||||
|
||||
echo "⏳ Waiting for MetalLB controller to be ready..."
|
||||
kubectl wait --for=condition=Available deployment/controller -n metallb-system --timeout=60s
|
||||
echo "⏳ Extra buffer for webhook initialization..."
|
||||
sleep 10
|
||||
|
||||
echo "⚙️ Applying MetalLB configuration..."
|
||||
kubectl apply -k ${METALLB_DIR}/kustomize/configuration
|
||||
|
||||
echo ""
|
||||
echo "✅ MetalLB installed and configured successfully"
|
||||
echo ""
|
||||
echo "💡 To verify the installation:"
|
||||
echo " kubectl get pods -n metallb-system"
|
||||
echo " kubectl get ipaddresspools.metallb.io -n metallb-system"
|
||||
echo ""
|
||||
echo "🌐 MetalLB will now provide LoadBalancer IPs for your services"
|
||||
@@ -0,0 +1,3 @@
|
||||
namespace: metallb-system
|
||||
resources:
|
||||
- pool.yaml
|
||||
@@ -0,0 +1,19 @@
|
||||
---
|
||||
apiVersion: metallb.io/v1beta1
|
||||
kind: IPAddressPool
|
||||
metadata:
|
||||
name: first-pool
|
||||
namespace: metallb-system
|
||||
spec:
|
||||
addresses:
|
||||
- {{ .cluster.ipAddressPool }}
|
||||
|
||||
---
|
||||
apiVersion: metallb.io/v1beta1
|
||||
kind: L2Advertisement
|
||||
metadata:
|
||||
name: l2-advertisement
|
||||
namespace: metallb-system
|
||||
spec:
|
||||
ipAddressPools:
|
||||
- first-pool
|
||||
@@ -0,0 +1,3 @@
|
||||
namespace: metallb-system
|
||||
resources:
|
||||
- github.com/metallb/metallb/config/native?ref=v0.15.0
|
||||
19
internal/setup/cluster-services/metallb/wild-manifest.yaml
Normal file
19
internal/setup/cluster-services/metallb/wild-manifest.yaml
Normal file
@@ -0,0 +1,19 @@
|
||||
name: metallb
|
||||
description: Bare metal load-balancer for Kubernetes
|
||||
namespace: metallb-system
|
||||
category: infrastructure
|
||||
|
||||
configReferences:
|
||||
- cluster.name
|
||||
|
||||
serviceConfig:
|
||||
ipRange:
|
||||
path: cluster.ipAddressPool
|
||||
prompt: "Enter IP range for MetalLB (e.g., 192.168.1.240-192.168.1.250)"
|
||||
default: "192.168.1.240-192.168.1.250"
|
||||
type: string
|
||||
loadBalancerIp:
|
||||
path: cluster.loadBalancerIp
|
||||
prompt: "Enter primary load balancer IP"
|
||||
default: "192.168.1.240"
|
||||
type: string
|
||||
Reference in New Issue
Block a user