Follow the official docs for background and pre-requisite tasks.
First complete Set Up the Bootstrap Environment for Tanzu Kubernetes Grid which includes downloading tkg cli from my.vmware.com and links for kubectl and docker setup. Although not required, it is helpful to have the kind cli installed.
Then Follow the next section that applies for your environment: AWS or vSphere. These instructions are based on the official docs steps that use the CLI. Alternatively you can use the Installer Interface and have the config file autogenerated with correct & well formatted values.
- Complete Prepare to Deploy the Management Cluster to Amazon EC2 which does setup activity in EC2. In this step, the docs will walk you through downloading
clusterawsadm
from my.vmware.com, setting environment variables, and creating a key pair. However, if you would like to use our scripted approach, you simply need to ensure you have installed theclusterawsadm
cli and populated yourparams.yaml
file. At that point, you can use the following script. The private key will be stored in thekeys
directory.
./scripts/01-prep-aws-objects.sh
- Follow steps from Deploy the Management Cluster to Amazon EC2 with the CLI up to the
tkg init
command. Then you can use our script below to execute the required steps to create the management cluster. Your only manual action is to prepare the.tkg/config.yaml
file. For this you can also use theREDACTED-config.yaml
located at the root of this repo as a reference of what a given config.yaml ended up looking like after the tasks described in the docs. Run this script to complete the deployment.
./scripts/02-deploy-aws-mgmt-cluster.sh
Note: This step takes about 12 minutes. You have an opportunity here to skip ahead to Step 3: Configure DNS and Prep Certificate Signing, Step 4: Configure Okta, and Step 5: Retrieve TKG Extensions to complete steps in parallel. Then you can come back and finish off this step.
- At this point the management cluster is deployed. We will be adding a few additional components such that we would benefit from two worker nodes in the cluster. Also, in order to be nice to our users, let's deploy a default storage class. The following script will perform these actions.
./scripts/03-post-deploy-mgmt-cluster.sh
- Validation Step. Check management cluster is provisioned, pods are running and storage class is configured;
tkg get management-clusters
kubectl get pods -A
kubectl get storageclass
- Complete Prepare to Deploy the Management Cluster to vSphere which prepares an SSH key and the OS image templates to be used for all clusters.
First thing you need to do is to download the OVAs from https://www.vmware.com/go/get-tkg. You need to get:
- VMware Tanzu Kubernetes Grid 1.1.0 Kubernetes v1.18.2 OVA (Photon OS)
- VMware Tanzu Kubernetes Grid 1.1 Load Balancer OVA
Then you can follow the manual steps in the documentation or use the following script to automate the creation of the SSH key, upload OVAs and set as template. SSH keys will be stored at keys/tkg_rsa
and keys/tkg_rsa.pub
.
You'll need to install govc. You'll also need to fill the vsphere
configuration block of the params.yaml
file with the values from your vSphere environment and local folders. Then run this script:
./scripts/01-prep-vsphere-objects.sh
- Follow steps from Deploy the Management Cluster to vSphere with the CLI up to the
tkg init
command. Then you can use our script below to execute the required steps to create the management cluster. Your only manual action is to prepare the.tkg/config.yaml
file. For this you can also use theREDACTED-config.yaml
located at the root of this repo as a reference of what a given config.yaml ended up looking like after the tasks described in the docs. Run this script to complete the deployment.
./scripts/02-deploy-vsphere-mgmt-cluster.sh
Note: This step takes about 12 minutes. You have an opportunity here to skip ahead to Step 3: Configure DNS and Prep Certificate Signing, Step 4: Configure Okta, and Step 5: Retrieve TKG Extensions to complete steps in parallel. Then you can come back and finish off this step.
- At this point the management cluster is deployed. We will be adding a few additional components such that we would benefit from two worker nodes in the cluster. Also, in order to be nice to our users, let's configure a CSI Storage Policy deploy a default storage class.
Follow these steps in vCenter:
- Tags & Custom Attributes -> Categories -> New -> k8s-storage (Datastore, Datastore Cluster)
- Tags & Custom Attributes -> Tags -> New -> k8s-storage (choose k8s-storage category)
- Storage -> Select datastore -> Tags -> Assign Tag (k8s-storage)
- Policies & Profiles > VM Storage Profiles > Create VM Storage Policy
- Name: “k8s Storage Policy”
- Enable tag placement
- Choose category and tag created previously
- Confirm your storage Datastore is compatible
Then run the following command to scale to 2 worker nodes and apply a default storage class that uses the CNS provisioner to the cluster.
./scripts/03-post-deploy-mgmt-cluster.sh
- Validation Step. Check management cluster is provisioned, pods are running and the sc is configured;
tkg get management-clusters
kubectl get pods -A
kubectl get sc