for the ubuntu vms --just run
make setup-kindbrew install kindchoco install kind-
If you are unable to create the cluster with the
kind-setup/config.ymldue to port 80 being in use. Check and kill the process running on it -
It could also be nginx running locally or you are running some webserver on your machine which operates on port 80.
kind --helpmake kind-create-clusterkubectl cluster-info --context kind-demo-clustermake kind-ingress-setupkubectl -n ingress-nginx get pods
kubectl -n ingress-nginx get pods -wCheck your address pool
docker network inspect -f '{{.IPAM.Config}}' kindThe output will contain a cidr such as 172.18.0.0/16. We want our loadbalancer IP range to come from this subclass. We can configure metallb, for instance, to use 172.18.255.200 to 172.18.255.250 by creating the configmap.
Now apply the setup
make create-loadbalancermake lb-address-poolLet's deploy nginx which has a service, deployment and an ingress. We will get the loadbalancer's IP and then test that in the browser or using any commandline utility like curl. You should see the default nginx page.
make demo-nginx-setuptesting Visit the loadbalancer ip to see your service running.
OR
Run:
curl <lb-ip>
curl 172.18.255.200We’ll need to get the IP address of our kind node’s Docker container first by running:
kubectl get svc/nginx-service -o=jsonpath='{.status.loadBalancer.ingress[0].ip}'Then add an entry to /etc/hosts with the IP address found that looks like:
172.18.255.200 test.kalkulus.localThe previous step work, but require working with the host system and are limited to Linux. We can instead create a Docker container. We can leverage docker run’s --add-host argument to add an entry to the container’s /etc/hosts file.
docker run \
--add-host test.kalkulus.local:172.18.255.200 \
--net kind \
--rm \
curlimages/curl:7.71.0 test.kalkulus.localkubectl port-forward po/demo-fastapi-6678bbbd54-5t97r 8000:8000 -n backendThis builds the image and push it to the KinD cluster.
make image-buildmake demo-fastapi-deploy-manifestsmake demo-fastapi-statusmake kind-destroy-cluster