As a follow up to my recent blog post on how to install Metallb as a service load balancer with Tanzu Community Edition (TCE), I also wanted to take a look at the other alternative which is using kube-vip. As mentioned in the previous blog post, I also noticed that Scott Rosenberg, an awesome VMware/Tanzu customer who has also been contributing to the community, has been working on some really cool ways of deploying additional packages using the Carvel tooling.
Since I have not deployed kube-vip for use with service load balancer, I was curious on how easy it would be to setup and hint, it is pretty darn easy using Carvel packages! You can find the detailed instructions along with a sample kubernetes (k8s) application to verify load balancer configuration was setup correctly.
Step 1 - Clone Scott's Github repo:
git clone https://github.com/vrabbi/tkgm-customizations.git
Step 2 - Change into the kube-vip package directory:
cd tkgm-customizations/carvel-packages/kube-vip-package/
Step 3 - Apply the required files:
kubectl apply -n tanzu-package-repo-global -f metadata.yml
kubectl apply -n tanzu-package-repo-global -f package.yaml
Step 4 - Create a values.yaml file that contains the desired load balancer IP Address range (e.g. 192.168.30.240 to 192.168.30.250):
cat <<EOF > values.yaml
vip_range: 192.168.30.240-192.168.30.250
EOF
Step 5 - Install the kube-vip package and provide our values.yaml file:
tanzu package install kubevip -p kubevip.terasky.com -v 0.3.9 -f values.yaml
Step 6 - Deploy sample k8s application that uses service type load balancer such as the famous Yelb application:
kubectl create ns yelb
kubectl -n yelb apply -f https://raw.githubusercontent.com/lamw/yelb/master/deployments/platformdeployment/Kubernetes/yaml/yelb-k8s-loadbalancer.yaml
Verify that all Yelb Pods are running:
kubectl -n yelb get pods
Step 7 - Verify Yelb application has allocated an IP Address out of the kube-vip address range:
kubectl -n yelb get svc
Step 8 - Open a browser to the IP Address shown from the previous step and if everything was configured successfully, you should see the following:
🎃💉dɛnɪs foʊʃeɪ💉🎃 (@DennisFaucher) says
Thank you William (and Scott). Scott has already helped me with a TCE issue (Antrea).
🎃💉dɛnɪs foʊʃeɪ💉🎃 (@DennisFaucher) says
Also, this is the FIRST TIME I have been able to get a LB working on TCE. Hooray.