Skip to content

Latest commit

 

History

History
58 lines (44 loc) · 1.55 KB

README.md

File metadata and controls

58 lines (44 loc) · 1.55 KB

MetalLB

Prerequisites

Setup Kubernetes cluster

If you don't have a running cluster, follow Create a single-master Kubernetes cluster with kubeadm by Ansible to set up a Kubernetes cluster.

Deploy a nginx into Kubernetes cluster

Source: https://kubernetes.io/docs/concepts/services-networking/connect-applications-service/

Deploy

kubectl apply -f my-nginx-deploy.yaml
kubectl get pods -l run=my-nginx

Expose service type LoadBalancer

kubectl apply -f my-nginx-svc.yaml
kubectl get svc my-nginx

You will see that EXTERNAL-IP is always pending.

Install MetalLB with Helm

Source: https://metallb.universe.tf/installation/#installation-with-helm

Install

helm repo add metallb https://metallb.github.io/metallb
helm install metallb metallb/metallb -f values.yaml

If you want to uninstall MetalLB, run helm uninstall metallb.

List all releases

helm list --all -A

Verify

Get services again

kubectl get svc my-nginx

You will see that EXTERNAL-IP is assigned with an IP.

In order to be able to connect to the IP, you will need to be inside VM networks. SSH into the first master VM, then try to curl to the EXTERNAL-IP that you see above.

ssh ci@172.16.1.11

If you would like to connect to the IP from your host, you can set up Bridged Networking on VirtualBox VMs, which is not covered here!