Skip to content

Latest commit

 

History

History
96 lines (60 loc) · 6.43 KB

01_install_tkg_mgmt.md

File metadata and controls

96 lines (60 loc) · 6.43 KB

Install TKG Management Cluster

Follow the official docs for background and pre-requisite tasks, 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.

Initial Install of Management Cluster

On AWS

  1. Complete Deploy Management Clusters to Amazon EC2 which does setup activity in EC2. In this step, the docs will walk you through 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 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

On Azure

  1. Complete the initial general requirements for deploying a TKG management cluster to Azure.

  2. Review the documentation to register a TKG application on Azure to understand the steps. It's not necessary to manually create the Azure application, instead the below script will automate the steps. It will use the current az CLI context to find your tenant and subscription ID, then it will create an application and a client secret. Those items will be written to the parameters file for use in the following steps.

NOTE: For the app-name you can either set it manually in the params file (azure.app-name) to a preferred name, or let the script set one.

./scripts/01-prep-azure-objects.sh
  1. Configure additional variables in params.yaml in the azure section. You will need to set:
  • azure.location - e.g. canadacentral
  • azure.control-plane-machine-type - e.g. Standard_D2s_v3 cpu: 2, ram: 8GiB
  • azure.node-machine-type - e.g. Standard_D2s_v3
  1. Accept the TKG Azure base image license.
az vm image terms accept --publisher vmware-inc --offer tkg-capi --plan k8s-1dot19dot1-ubuntu-1804
  1. Deploy the management cluster.
./scripts/02-deploy-azure-mgmt-cluster.sh

On vSphere

  1. Complete Deploy Management Clusters 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 VMware Tanzu Kubernetes Grid 1.2.1 OVAs for Kubernetes from https://www.vmware.com/go/get-tkg. You need to download v1.19.1 for the management cluster and optionally the others if you choose to deploy workload clusters with a different version of Kubernetes:

  • Photon v3 Kubernetes v1.19.3 OVA (our scripts will only use this version)
  • Photon v3 Kubernetes v1.18.10 OVA
  • Photon v3 Kubernetes v1.17.13 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

Post Deployment Configuration

Deploying managment clusters in various IaaS takes anywhere from 10-25 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. 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:
tkg get management-clusters
kubectl get pods -A

Go to Next Step

Attach Management Cluster to TMC