One of the announcements that I was personally excited about coming from VMworld 2021 is the release of Tanzu Community Edition (TCE). You can read my blog post covering Tanzu Community Edition here. One of the great things you can do with Tanzu Community Edition is install Tanzu Kubernetes clusters on a local workstation. Awesome! You can also leverage existing clouds such as vSphere, AWS, and Azure as well. In this post, we will cover how to install Kubernetes in Windows using Tanzu Community Edition.
What is Tanzu Community Edition?
This will duplicate much of what I have written in the blog post referenced above. However, for the purpose of getting this installed in Windows, it is good to revisit why this is such a powerful tool and to evangelize the product across the community.
Tanzu Community Edition is a free Tanzu offering that allows anyone to get experience with Tanzu Kubernetes, even if you don’t have access to a paid Tanzu Kubernetes enterprise cluster. TCE removes all the blockers from getting up and running with Tanzu Kubernetes clusters in a way that is simple, easy, and basically “push button” in nature.
The great thing with Tanzu Kubernetes Community Edition is it is fully featured. It even includes features that are not included as of yet in the enterprise version. Note the packages that are available for VMware Tanzu Community Edition:
With Tanzu Community Edition, one of the main features you will note about the solution is the ease of installing it and the ability to install it on a workstation running Linux, macOS, and Windows.
Install Kubernetes in Windows using Tanzu Community Edition
To get up and running with Tanzu Community Edition on a Windows workstation, the official Github page lists the chocolatey package manager as the way to install. However, as you note on the page (I didn’t at first), the chocolatey package is not quite ready yet. If you attempt as I did to use it anyway, you will most likely see the following, unless it has been released by the time you read this blog.
Instead of using Chocolatey, you can still install in Windows by manually downloading the Tanzu Community Edition .ZIP file, extracting, and running the install.bat.
Download the .ZIP file from here:
When you run the install.bat file, you will note a few files copied out and then the direction to add the path listed to your PATH variable in Windows. This is so you can run the “tanzu” commands without having to navigate to the explicit path.
Create the Tanzu Community Edition standalone cluster
To create the Tanzu Community Edition Standalone cluster, run the following command to launch the Kickstarter Web interface that allows you to customize your cluster in a GUI web interface.
tanzu standalone-cluster create --ui
However, when I first ran this command, in windows, there is a known bug where you get a X509 Certificate error.
To resolve this, navigate to the following file: %USERPROFILE%\.config\tanzu\tkg\config.yaml and copy over and replace the contents of the file with:
release: version: "" TKG_CUSTOM_IMAGE_REPOSITORY_SKIP_TLS_VERIFY: true
Now, rerun the command and you should see it get to the point of Serving kickstart UI at HTTP://127.0.0.1:8080. Nice! As you can see, you have the option to deploy the standalone cluster to:
- VMware vSphere
- Amazon EC2
- Microsoft Azure
I am choosing the Docker installation to run the cluster locally. It will check the prerequisites and make sure the Docker daemon is running among other things.
Next, specify the standalone cluster name.
Finally, set up your Kubernetes Network. Here, unless you need to use a proxy or you have overlapping subnets with the default here, you can just leave these as is, which is what I have done.
When you confirm your settings, you can edit the configuration if you want. Also, you can copy the CLI command for learning purposes for next time. After reviewing, click Deploy Standalone Cluster.
The installation of the Tanzu Community Edition standalone cluster to Docker begins.
Windows installation error
After my installation got to the standalone cluster, it sat for a few minutes and then errored out with the following error captured in the screenshot below. I tried three different workstations and all failed with the same error message I have captured below. I still have not got to the bottom of this, but more tinkering will be in order to find where these values are coming from. I did notice there is an official bug ticket open for this one here: Docker installation: “Failed to invoke API on cluster : Get “https://172.18.0.3:6443/version?timeout=32s”: dial tcp 172.18.0.3:6443: connectex” · Issue #2200 · vmware-tanzu/community-edition · GitHub
It looks to be a networking error as it literally is not able to connect to the IP shown. However, as far as I can tell, this is not an IP range that is provisioned in my environment, either in Docker, or in the YAML files.
So for the purposes of the rest of the install in Docker, I switched over to my Linux box which did not receive the same error message. This is what we would have expected to see for the Tanzu Community Edition for Windows.
Setting the cluster context and connecting to the Tanzu Community Edition standalone cluster
To set the context and connect to your Tanzu Community Edition standalone cluster, use the following commands. I am going to show the commands with my cluster name.
kubectl config set-context tcelocal-admin@tcelocal kubeclt config use-context tcelocal-admin@tcelocal kubectl get pod -A
Final Thoughts and wrapping up
As you can see, there are currently a few buggy things with the Tanzu Community Edition (TCE) standalone cluster installation on Windows. But, it is bleeding-edge new and hot off the press, so it can be expected. The SSL certificate error can be resolved using a known workaround. However, the cluster API endpoint message is still one that was a show stopper for me in my Windows environment. Let me know in the comments below if you are receiving this error and if you have found a workaround. It is being tracked in the bug linked above, so hopefully, it will get resolved soon.
Once this and a few other bugs are squashed, this will be arguably the perfect way to Install Kubernetes in Windows using Tanzu Community Edition. Users will be able to get familiar with Tanzu and learn Kubernetes at the same time. Stay tuned for more Tanzu Community Edition posts.