2.7 - Lab 4¶
Objectives¶
- Create a Management Cluster
- Rename the Management Cluster Configuration File
- Examine the Management Cluster
Create a Management Cluster¶
-
Using the terminal, set the environment variables to install from the local Harbor registry.
source ~/Workspace/harbor-vars.sh
-
Run the tanzu command with the Tanzu Kubernetes Grid installer enabled.
tanzu management-cluster create --ui
The Tanzu Kubernetes Grid Installer opens in the browser.
-
Under VMware vSphere, click DEPLOY.
- In the IaaS Provider panel, enter the following values and then click CONNECT.
- On the Verify SSL Thumbprint page, click CONTINUE.
- On the vSphere 7.0.2 Environment Detected window, click DEPLOY TKG MANAGEMENT CLUSTER.
- Select /SA-Datacenter for DATACENTER.
- Using the Files application, retrieve the SSH Public Key from the student desktop.
- Navigate to the ~/.ssh folder.
- Open the id_rsa.pub file.
- Copy the file contents and paste them in the SSH PUBLIC KEY text box.
- Close the Text Editor window and click NEXT.
- In the Management Cluster Settings panel, enter the following values and click NEXT.
- In the VMware NSX Advanced Load Balancer panel, enter the following values.
- Using the Files application, retrieve the NSX CA certificate.
- Navigate to the ~/Workspace/certs folder.
- Open the nsx-ca.pem file.
- Copy the file contents and paste them in the CONTROLLER CERTIFICATE AUTHORITY text box.
- Close the Text Editor window.
- Click VERIFY CREDENTIALS.
- In the VMware NSX Advanced Load Balancer panel, enter the following values and click NEXT.
- In the Metadata panel, click NEXT.
- Under Specify the Resources, enter the following values and click NEXT.
- Under Kubernetes Network Settings, select pg-SA-Management for NETWORK NAME and click NEXT.
- In the Identity Management panel, select LDAPS.
- Under LDAPS Identity Management Source, enter the following values.
- Under User Search Attributes, enter the following values.
- Under Group Search Attributes, enter the following values.
- Using the Files application, retrieve the LDAP certificate.
- Navigate to the ~/Workspace/certs folder.
- Open the ldap.pem file.
- Copy the file contents and paste them in the ROOT CA text box.
- Close the Text Editor window and click NEXT.
- In the OS Image panel, select /SA-Datacenter/vm/ubuntu-2004-kube-v1.20.5-vmware.1 for OS IMAGE and click NEXT.
- In the Register TMC panel, Click NEXT.
- In the CEIP Agreement panel, deselect Participate in the Customer Experience Improvement Program and click NEXT.
- Click REVIEW CONFIGURATION.
-
Under CLI Command Equivalent, click COPY and paste the command into commands.txt on the student desktop.
The command includes a file with an autogenerated file name.
/home/student01/.tanzu/tkg/clusterconfigs/<AUTOGENERATED_FILENAME>.yaml
This file contains all the parameters you provided in the installer UI.
-
Verify that your configuration matches the configuration from the lab guide.
- Using the Terminal, open a new terminal tab.
-
Navigate to the
clusterconfigs
directory.cd ~/.tanzu/tkg/clusterconfigs
-
Run the
checkconfig
script.checkconfig <AUTOGENERATED_FILENAME>.yaml
If there is a configuration mismatch, Visual Studio Code opens with your configuration file on the left panel and the reference configuration file on the right panel. Differences are highlighted in red.
Do not close the Visual Studio Code window yet.
-
In Firefox, click EDIT CONFIGURATION and correct the parameters.
- Click REVIEW CONFIGURATION.
-
In Visual Studio Code, verify no differences are found between your configuration file and the reference configuration file.
Close the Visual Studio Code window.
-
Deploy the management cluster.
-
Click DEPLOY MANAGEMENT CLUSTER.
The deploy progress screen displays.
CAUTION:
Do not close the browser window yet.
-
Wait for the
Management cluster created!
message to display and then close the Tanzu Kubernetes Grid installer browser window.The management cluster takes approximately 20 minutes to deploy.
-
-
In the terminal, review the output of the Tanzu CLI.
Both the
Management cluster created!
message and the command to create a Tanzu Kubernetes cluster display.
Rename the Management Cluster Configuration File¶
-
Using the terminal, navigate to the
clusterconfigs
directory.cd ~/.tanzu/tkg/clusterconfigs
-
Rename the autogenerated filename captured in the previous task to match the management cluster name.
mv <AUTOGENERATED_FILENAME>.yaml sa-compute-01-mgmt.yaml
Examine the Management Cluster¶
-
Using the terminal, retrieve the admin kubeconfig file for the management cluster.
tanzu management-cluster kubeconfig get --admin
NOTE:
The Tanzu CLI automatically adds the management cluster kubeconfig data to your local kubeconfig file. These steps are provided for learning purposes.
-
List the kubectl contexts.
kubectl config get-contexts
-
Set the current kubectl context to point to the management cluster.
kubectl config use-context sa-compute-01-mgmt-admin@sa-compute-01-mgmt
-
Display all pods running on the cluster.
kubectl get pods -A
The status of some
pinniped-post-deploy-job
pods might display as error, which is expected. -
Display the status of the management cluster nodes.
kubectl get nodes
The output displays the following nodes with a Ready status.
-
In the vSphere Client, click Menu.
- Click Hosts and Clusters.
-
Expand rp-tkg-management.
The VMs correspond to the
kubectl get nodes
output.