diff --git a/kubernetes/ip-address-pool.yaml b/kubernetes/ip-address-pool.yaml new file mode 100644 index 0000000..98f7820 --- /dev/null +++ b/kubernetes/ip-address-pool.yaml @@ -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 diff --git a/kubernetes/l2-advertisement.yaml b/kubernetes/l2-advertisement.yaml new file mode 100644 index 0000000..f304fdc --- /dev/null +++ b/kubernetes/l2-advertisement.yaml @@ -0,0 +1,5 @@ +apiVersion: metallb.io/v1beta1 +kind: L2Advertisement +metadata: + name: main + namespace: metallb-system diff --git a/kubernetes/loadbalancer-test.yaml b/kubernetes/loadbalancer-test.yaml new file mode 100644 index 0000000..dd83b9f --- /dev/null +++ b/kubernetes/loadbalancer-test.yaml @@ -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