This topic tells you how to set up the infrastructure to create an application environment in Tanzu Platform for Kubernetes.
An application environment is represented by an abstraction called a Space. After you have created a Space, it is easy to deploy an application to that Space with a single command.
This topic includes the procedures for setting up the infrastructure and objects required to enable anyone on your team to create a Space. You can then proceed through the Space creation and application deployment topics.
Make sure you have the following objects in place and have performed the following tasks:
Make sure you have the Tanzu Application Platform Admin service role for VMware Tanzu Platform.
To view your roles, click on your name in the top right-hand corner of the Tanzu Platform cloud services console and select My Account > My Roles.
An IAM account with the following policy or equivalent:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"sns:*",
"cloudtrail:*",
"cloudformation:*",
"events:*",
"iam:*",
"ec2:DescribeRegions"
],
"Resource": "*"
}
]
}
An AWS Access Key and the AWS Secret Access Key set as environment variables for the IAM account. See the instructions in the AWS environment variables documentation.
A Route 53 Public Hosted Zone.
The Route 53 Public Hosted Zone will be used to create DNS records and associated health checks for deployed applications. You will need the domain name and Hosted Zone ID for the Route 53 public hosted zone. See Creating a public hosted zoned for more information.
The following provides an overview of the main steps to set up your infrastructure.
Before you can create an application environment in the Tanzu Platform, you must perform some initial configuration of Tanzu Platform, the Tanzu CLI, and AWS. You only need to perform these procedures once.
Tanzu Platform for Kubernetes resources are created in a project. The project acts as a logical grouping within Tanzu Platform for Tanzu Platform for Kubernetes resources. Therefore, before you create any resources, you must create a project.
A project allows you to manage packages, configurations, and role-based access controls for all clusters in a cluster group, rather than managing each cluster on an individual basis. Creating a project in your organization requires either Organization Admin or Organization Owner roles.
Log in to the organization in which to create a new project.
tanzu login
Create a new project with a unique name and a description.
tanzu project create PROJECT-NAME --description PROJECT-DESCRIPTION
Verify that the project has been created.
List all available projects:
tanzu project list
Retrieving the details of your specific project.
tanzu project get PROJECT-NAME
For more information about creating projects in Tanzu Platform, see Add projects and assign users.
NoteYou can associate only one AWS account to a project.
Do the following to connect your AWS account to Tanzu Platform.
In the Event Monitoring section, follow the on-screen steps to enable event monitoring.
ImportantYou must enable event monitoring to use Tanzu Platform for Kubernetes with AWS.
OK
, and the event monitoring state is Connected
.For more information, see Add an Amazon Web Services account to VMware Tanzu Hub in Using and Managing VMware Tanzu Hub.
You create EKS credentials to allow you to manage your EKS clusters from Tanzu Platform. The EKS credentials you create include the roles and policies required for the Tanzu Platform to manage the EKS clusters in your project.
Do the following in Tanzu Platform hub to create an EKS credential:
Tanzu EKS credentials rely on AWS IAM Roles. Therefore, EKS credentials do not require traditional user-based security tokens such as access keys or passwords. For more information, see Providing access to AWS accounts owned by third parties in the AWS documentation.
To enable DNS records to be dynamically created and deleted for applications within a Space, a role is required to manage Route 53 records. These steps create a role with the required policy and add it to your project.
Route 53 GLSB credentials rely on AWS IAM Roles. Therefore, the Route 53 GLSB credentials do not require traditional user-based security tokens such as access keys or passwords. For more information, see Providing access to AWS accounts owned by third parties in the AWS documentation.
You must add or create a functional EKS-compliant virtual private cloud (VPC) for EKS cluster lifecycle management. If you already have an EKS-compliant VPC set up, you can reuse it.
If you do not have an EKS-compliant VPC set up, you can use the AWS guide to use a CloudFormation stack to create a VPC that will meet all of the requirements for EKS. When creating the stack, you can simply provide a name for the stack, and accept all the other defaults, unless you choose to create a more advanced VPC.
For more information about VPCs and subnets for EKS, see Amazon EKS VPC and subnet requirements and considerations, Create a VPC plus other VPC resources in the AWS documentation.
When you create a project, Tanzu Platform creates a run
cluster group for you. The run
cluster group contains the Capabilities required for deploying a Space for a run application environment.
If you want to create a new cluster group, see Create a cluster group. You must create the cluster in a cluster group.
You will use the cluster you create to run the example Where for Dinner application. The steps of how to deploy the example Where for Dinner application is described later in this guide.
If you have an existing EKS cluster or a separate process to create the cluster, you can attach an existing cluster instead. For more information on how to attach an existing EKS cluster, see Add an existing EKS cluster.
Do the following to create a cluster in your project in Tanzu Platform hub:
run
cluster group.eks-run-cluster
.run
cluster group is selected.Configure the control plane.
Select the account credential you configured in Create EKS credentials.
NoteThe account credential has to be verified before it appears in the dropdown, which may take up to 5 minutes.
1.29
.us-east-1
.For node pools, set the scaling and compute to meet your requirements.
NoteThe minimum cluster size is 3
t3.xlarge
nodes.
Click Create.
Wait for the cluster to be created and for the status in Tanzu Platform hub to be Healthy
. This could take 30-45 minutes.
If you’re using Tanzu Platform for Kubernetes SaaS, set up networking so that the provisioned cluster can connect to Tanzu Platform on port 443 with HTTP and Websocket (TCP) protocols.
Now that you have created a cluster, you are ready to begin creating the application environment. Before you create an application environment, you must first create an Availability Target.
Tanzu Platform for Kubernetes provides a all-regions.tanzu.vmware.com
Availability Target with every project, that includes all clusters regardless of region by default. You use this availability target in the next section to create your application environment on. To view this Availability Target, do the following:
all-regions.tanzu.vmware.com
Availability Target.The following table lists some actions you can take on managed clusters.
Actions | Steps to follow |
---|---|
Create application environments using Spaces | See Create an application environment using Spaces |
Edit the configuration of a cluster | Go to Infrastructure > Kubernetes Clusters > Clusters and select a cluster to reconfigure. |
Create an Availability Target for fault isolation | See managing Availability Targets |