In my previous post about the announcements made at VMworld 2021 I talked about the VMware Tanzu Community edition. Today I will show you how to set it up on MacOS
First of all I am using a Mac running MacOS 11.6 and its running on an Intel Mac (I know I also want the new M1 pro/max one).
So lets get started with Setting up VMware Tanzu Community Edition on MacOS shall we?
Before you begin
So lets first get the prerequisite in place. I need Homebrew, Docker and kubectl installed on my Mac.
I need to open terminal (or iTerm in my case) and run the following command:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Once done you should see something like this:
Now that I have Homebrew running I will install docker. Instructions for installing Docker can be found here.
You might want to check and see the resources assigned to run Docker, this way you will not consume all resources available to you. To change the resource settings open the Docker desktop and go to Settings –> Resources
Next to checking the resources I also checked to see if Docker is running correctly:
This command should return something like this:
I have seen some issues out there where people did not get a proper version info. To fix this they had to open the Docker Desktop app and accept the basic setup steps. Maybe I am not running into an issue is that I already openend the Desktop app to set the resources.
And last but not least I will install kubectl:
brew install kubectl
I can now see if kubectl was installed correctly by running the below command:
This should show something like this:
Installing Tanzu Community Edition
So now that I have all the prerequisites in place I will install Tanzu Community Edition (TCE).
As I installed Homebrew this part is just as simple as installing kubectl. Simply run the following commands.
brew tap vmware-tanzu/tanzu brew install tanzu-community-edition
Once I finish the setup I am prompted to initialise the required plugins for TCE as you can see in the screenshot below.
So after running the above command I can get started with TCE and deploy my first cluster.
Getting started with TCE
So now that I have TCE running, I will setup a standalone cluster.
Again in terminal (or Iterm2) I run the following command to get the cluster going:
tanzu standalone-cluster create --ui
When I run this command the UI will open up in your browser to complete the setup.
First I select deploy on my local workstation but you could also deploy to vSphere, AWS and Azure.
Now all you need to do is provide a cluster name and use the NNF* solution to complete the wizard.
*Next next finish
Now this setup will take some time so get a coffee or thee, walk your dog, hug your wife or just watch and wait.
Once finished I can check to see if there is anything running:
First I do a context switch:
kubectl config use-context arjen-admin@arjen
*Note that where it says “arjen” you need to input your cluster name that you picked during the setup
Then I check to see what is running:
kubectl get nodes
I can see that the API node is running:
Deploy an app
So now that I have my cluster running let’s deploy an app to see if all is working as expected. I found this article from VMware that described deploying a demo app called kuard.
kubectl run --restart=Never --image=gcr.io/kuar-demo/kuard-amd64:blue kuard
Next I verify that the pod is running:
kubectl get pods
Which results in:
Now all I need to do is forward the pod container port 8080 to my local 8080 port on my Mac:
kubectl port-forward kuard 8080:8080
And now I can browse to http://localhost:8080 and should see something like this:
So now I have a fully working app on my Tanzu cluster running.
Since I showed you how to setup TCE I will now show you how to clean up after your self (my wife would be proud)
First lets remove the kuard app:
kubectl delete pod kuard
Secondly, I will clean up the TCE standalone-cluster
tanzu standalone-cluster delete arjen
*Again, replace “arjen” with your cluster name
Once this is done I check to see if everything is cleaned up:
Which should result in nothing running in Docker:
If you also want to remove TCE completely, you can run this command:
So there you have it Setting up VMware Tanzu Community Edition on MacOS. First I installed all the prerequisites, secondly I deployed TCS and thirdly I deployed a demo app.
Finally i cleaned up after my self.
I hope you enjoyed reading this blog and have fun deploying your own TCE environment.