/kind-metallb-nginx-ingress

KIND cluster with Metallb and NGINX Ingress controller

KIND cluster with Metallb and NGINX Ingress controller

  1. Create cluster
kind create cluster --config ./kind-config.yaml
  1. Deploy metallb

Create metallb namespace:

kubectl apply -f ./metallb-namespace.yaml

A range of IP addresses for metallb ConfigMap must be within the docker kind network. We can get docker kind network CIDR with this command:

docker network inspect -f '{{.IPAM.Config}}' kind

Deploy metallb:

kubectl apply -f ./metallb

Wait for metallb pods to have a status of Running:

kubectl get pods -n metallb-system --watch
  1. Deploy NGINX Ingress controller
kubectl apply -f ./ingress

Wait for ingress-nginx-controller-* pods to have a status of Running:

kubectl get pods -n ingress-nginx --watch

Verify that ingress-nginx-controller service get IP address from metallb address pool:

kubectl -n ingress-nginx get svc
NAME                                 TYPE           CLUSTER-IP      EXTERNAL-IP      PORT(S)                      AGE
ingress-nginx-controller             LoadBalancer   10.96.251.111   172.19.100.100   80:30717/TCP,443:30962/TCP   35m
ingress-nginx-controller-admission   ClusterIP      10.96.132.149   <none>           443/TCP                      35m
  1. Deploy test app
kubectl apply -f ./ingress-usage-example.yaml 

Verify that the ingress works:

# should output "foo"
curl 172.19.100.100/foo
# should output "bar"
curl 172.19.100.100/bar