I sometimes have conversations with people that got vSphere with Tanzu up and running and now struggling a bit to get around and to deploy their first applications. In a couple of blogposts I will provide some basic tricks and tips, just to get you started with vSphere with Tanzu and Kubernetes in general. Currently available:
- vSphere /w Tanzu 101 – Create your first vSphere Namespace (this article)
- vSphere /w Tanzu 101 – Install & configure command line tools (to be published soon)
- vSphere /w Tanzu 101 – Deploy your first TKG cluster and Kubernetes App(to be published soon)
On top of these basic steps, I would highly recommend to create an account at kube.academy and get started with some great free Kubernetes courses.
This article assumes vSphere with Tanzu on vSphere 7 up and running, and that you’re ready to configure your first vSphere namespace.
Create your first vSphere Namespace
In vSphere with Tanzu, a vSphere namespace holds your Kubernetes resources. You will need to create a vSphere Namespace to get started. Note that a vSphere Namespace is not a Kubernetes Namespace. Although there are some similarities, a vSphere Namespace within the context of the supervisor cluster is a vSphere construct. A Kubernetes Namespace runs on a Kubernetes cluster, that we will deploy at a later stage.
In the vSphere Webclient, choose Workload Management in the main menu and select Create Namespace.
Think of a descriptive name for your namespace (e.g. viktorious-ns01), select your vSphere /w Tanzu enabled cluster, and select a Network. Kubernetes nodes deployed to the vSphere namespace will be deployed to the selected cluster and connect to the selected network. Now click Create Namespace.
Now open the new namespace. To get started you (at least) need to configure:
- Permissions on the vSphere Namespace. This determines who can view, edit and/or is owner of this namespace.
- Add storage to the vSphere Namespace by selecting a storage policy. Without an active storage policy you cannot deploy anything. Kubernetes cluster will be deployed to the storage that is tagged with the selecte storage policy/policies.
- Add one or more VM classes. Selected VM classes determine which Kubernetes cluster nodes sizes can be deployed within the vSphere Namespace. There are guaranteed (a 100% reservation is configured) and best-effort (no resources are reserved) VM classes.
- Check if the content library that contains all Kubernetes images is linked to the namespace.
Optional configuration options
It’s optional (but depending on your requirements probably recommended) to set limits on the available capacity, in terms of cpu/memory/storage, on the vSphere namespace. Another things you can configure are limits of the number of objects (e.g. config maps, secrets, persistent volume claims and services) that can live on the supervisor cluster.