Skip to content

Latest commit

 

History

History
91 lines (61 loc) · 6.44 KB

01_install_tkg_mgmt.md

File metadata and controls

91 lines (61 loc) · 6.44 KB

Install TKG Management Cluster

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.

Install TKG Management Cluster on AWS

  1. 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 the clusterawsadm cli and populated your params.yaml file. At that point, you can use the following script. The private key will be stored in the keys directory.
./scripts/01-prep-aws-objects.sh
  1. 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 the REDACTED-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.

  1. 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
  1. 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

Install TKG Management Cluster on vSphere

  1. 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
  1. 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 the REDACTED-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.

  1. 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
  1. 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

Go to Next Step

Attach Management Cluster to TMC