During the deployment of the management cluster, either from the installer interface or the CLI, Tanzu Kubernetes Grid creates a temporary management cluster using a Kubernetes in Docker (
kind) cluster on the bootstrap machine. After creating the temporary management cluster locally, Tanzu Kubernetes Grid uses it to provision the final management cluster in the platform of your choice, depending on whether you are deploying to vSphere, Amazon EC2, or Microsoft Azure. After the deployment of the management cluster finishes successfully, Tanzu Kubernetes Grid deletes the temporary
Tanzu Kubernetes Grid saves the configuration of your management cluster in the
~/.tkg/config.yaml file. Tanzu Kubernetes Grid also creates a folder named
~/.tkg/providers, that contains all of the files required by Cluster API to create the management cluster.
IMPORTANT: By default, unless you specify the
--kubeconfig option to save the
kubeconfig for a cluster to a specific file, all clusters that you deploy from the Tanzu Kubernetes Grid CLI are added to a shared
.kube-tkg/config file. If you delete the shared
.kube-tkg/config file, all management clusters become orphaned and thus unusable.
When you deploy a management cluster, pod-to-pod networking with Antrea is automatically enabled in the management cluster.
After you deploy a cluster to vSphere, each control plane node requires a static IP address. This includes both management and Tanzu Kubernetes clusters. These static IP addresses are required in addition to the static IP address that you assigned to Kube-VIP when you deploy a managment cluster.
To make the IP addresses that your DHCP server assigned to the control plane nodes static, you can configure a DHCP reservation for each control plane node in the cluster. For instructions on how to configure DHCP reservations, see your DHCP server documentation.
After the deployment of the management cluster completes successfully, control plane VM and one or more worker node VMs are present in your vSphere inventory, Amazon EC2 instances, or Azure resource group. You can obtain information about your management cluster by running the
tkg get management-cluster command, and by locating the created artifacts in vSphere, your Amazon EC2 dashboard, or the Azure Portal.
Unless you manually change the context of the Tanzu Kubernetes Grid CLI to another cluster by using the
tkg set management-cluster command, by default the CLI uses the context of the most recently deployed management cluster.
View the management cluster objects in vSphere, Amazon EC2, or Azure.
You should see the following VMs or instances. If you did not specify a name for the management cluster,
cluster_name is something similar to
Tanzu Kubernetes Grid CLI provides commands that facilitate many of the operations that you can perform with your management cluster. However, for certain operations, you still need to use
kubectl. By default, Tanzu Kubernetes Grid sets the
kubectl context to a new management cluster when you deploy it.
On the bootstrap machine on which you ran
tkg init, run the
tkg get management-cluster command to see the context of the management cluster that you have deployed.
tkg get management-cluster
If you deployed a management cluster named
my-management-cluster-admin@my-management-cluster, you will see the following output:
MANAGEMENT-CLUSTER-NAME CONTEXT-NAME STATUS my-management-cluster * my-management-cluster-admin@my-management-cluster Success other-mgmnt-cluster other-mgmnt-cluster-admin@other-mgmnt-cluster Success
The asterisk (
my-management-cluster as being the current context of the Tanzu Kubernetes Grid CLI.
kubectl to use the context of the other management cluster, so that you can examine its resources, run
kubectl config use-context.
kubectl config use-context other-mgmnt-cluster-admin@other-mgmnt-cluster
kubectl commands to examine the resources of the management cluster.
For example, run
kubectl get nodes,
kubectl get pods, or
kubectl get namespaces to see the nodes, pods, and namespaces running in the management cluster.
You can now use Tanzu Kubernetes Grid to start deploying Tanzu Kubernetes clusters. For information, see Deploying Tanzu Kubernetes Clusters and Managing their Lifecycle.