add demo of metallb working

This commit is contained in:
Pim Kunis 2024-03-24 22:11:12 +01:00
parent 7109768862
commit b4d6a9f46d
3 changed files with 48 additions and 0 deletions

View file

@ -0,0 +1,8 @@
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
name: main
namespace: metallb-system
spec:
addresses:
- 192.168.40.100-192.168.40.253

View file

@ -0,0 +1,5 @@
apiVersion: metallb.io/v1beta1
kind: L2Advertisement
metadata:
name: main
namespace: metallb-system

View file

@ -0,0 +1,35 @@
apiVersion: v1
kind: Service
metadata:
name: loadbalancer-test
# annotations:
# metallb.universe.tf/loadBalancerIPs: 192.168.1.100
spec:
ports:
- port: 80
targetPort: 8000
selector:
app: loadbalancer-test
type: LoadBalancer
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: loadbalancer-test
labels:
app: loadbalancer-test
spec:
replicas: 3
selector:
matchLabels:
app: loadbalancer-test
template:
metadata:
labels:
app: loadbalancer-test
spec:
containers:
- name: loadbalancer-test
image: mpepping/cyberchef
ports:
- containerPort: 8000