This topic explains how to prepare Microsoft Azure for running Tanzu Kubernetes Grid.
If you are installing Tanzu Kubernetes Grid on Azure VMware Solution (AVS), you are installing to a vSphere environment. See Preparing Azure VMware Solution on Microsoft Azure in Prepare a vSphere Management as a Service Infrastructure to prepare your environment and Prepare to Deploy Management Clusters to vSphere to deploy management clusters.
prodplan (3 main nodes, 1 worker) and 4 for
dev(1 main, one worker)
prodplan (3 main nodes, 3 worker) and 4 for
dev(1 main, 1 worker)
LoadBalancer, 1 Public IP address is required.
Traffic is allowed between your local bootstrap machine and the image repositories listed in the management cluster Bill of Materials (BoM) file, over port 443, for TCP.*
~/.tanzu/tkg/bom/, and its name includes the Tanzu Kubernetes Grid version. For example,
imageRepositoryvalues to find their CNAMEs.
(Optional) A VNET with:
If you do not use an existing VNET, the installation process creates a new one.
The Azure CLI installed locally. See Install the Azure CLI in the Microsoft Azure documentation.
*Or see Deploying Tanzu Kubernetes Grid in an Internet-Restricted Environment for installing without external network access.
Tanzu Kubernetes Grid manages Azure resources as a registered application that accesses Azure through a service principal account. The following steps register your Tanzu Kubernetes Grid application with Azure Active Directory, create its service account, create a client secret for authenticating communications, and record information needed later to deploy a management cluster.
Log in to the Azure Portal.
Record your Tenant ID by hovering over your account name at upper-right, or else browse to Azure Active Directory > <Your Azure Org> > Properties > Tenant ID. The value is a GUID, for example
Browse to Active Directory > App registrations and click + New registration.
Enter a display name for the app, such as
tkg, and select who else can use it. You can leave the Redirect URI (optional) field blank.
Click Register. This registers the app with Azure and also creates a service principal as described in How to: Use the portal to create an Azure AD application and service principal that can access resources in the Azure documentation.
An overview pane for the app appears. Record its Application (client) ID value, which is a GUID.
From the Azure Portal top level, browse to Subscriptions. At the bottom of the pane, select one of the subscriptions you have access to, and record its Subscription ID. Click the subscription listing to open its overview pane.
Select to Access control (IAM) and click Add a role assignment.
In the Add role assignment pane
tkg. It appears underneath under Selected Members
Click Save. A popup appears confirming that your app was added as an owner for your subscription.
From the Azure Portal > Azure Active Directory > App Registrations, select your
tkg app under Owned applications. The app overview pane opens.
From Certificates & secrets > Client secrets click + New client secret.
In the Add a client secret popup, enter a Description, choose an expiration period, and click Add.
Azure lists the new secret with its generated value under Client Secrets. Record the value.
To run management cluster VMs on Azure, accept the license for their base Kubernetes version and machine OS.
$AZURE_SUBSCRIPTION_IDas environment variables.
Sign in to the Azure CLI.
az login --service-principal --username $AZURE_CLIENT_ID --password $AZURE_CLIENT_SECRET --tenant $AZURE_TENANT_ID
az vm image terms accept command, specifying the
--plan and your Subscription ID.
In Tanzu Kubernetes Grid v1.3.0, the default cluster image
--plan value is
k8s-1dot20dot4-ubuntu-2004, based on Kubernetes version 1.20.4 and the machine OS, Ubunti 20.04. Run the following command:
az vm image terms accept --publisher vmware-inc --offer tkg-capi --plan k8s-1dot20dot4-ubuntu-2004 --subscription $AZURE_SUBSCRIPTION_ID
You must repeat this to accept the base image license for every version of Kubernetes or OS that you want to use when you deploy clusters.
You deploy management clusters from a machine referred to as the bootstrap machine, using the Tanzu CLI. To connect to Azure, the bootstrap machine must provide the public key part of an SSH key pair. If your bootstrap machine does not already have an SSH key pair, you can use a tool such as
ssh-keygen to generate one.
On your bootstrap machine, run the following
ssh-keygen -t rsa -b 4096 -C "email@example.com"
Enter file in which to save the key (/root/.ssh/id_rsa):press Enter to accept the default.
Add the private key to the SSH agent running on your machine, and enter the password you created in the previous step.
.ssh/id_rsa.pubin a text editor so that you can easily copy and paste it when you deploy a management cluster.
For production deployments, it is strongly recommended to enable identity management for your clusters. For information about the preparatory steps to perform before you deploy a management cluster, see Enabling Identity Management in Tanzu Kubernetes Grid.
If you are using Tanzu Kubernetes Grid in an environment with an external internet connection, once you have set up identity management, you are ready to deploy management clusters to Azure.