4.13 - Lab 14¶
Objectives¶
- Access the cluster as a developer
- Deploy a workload
- Inspect the NSX Advanced load balancer
- Inspect the logs in vRealize log insight
Access the Cluster as a Developer¶
-
Using the terminal, click the new terminal tab button in the top left.
Keep the original terminal tab to continue accessing the cluster using the admin account.
Use the new terminal tab to access the cluster using the developer account.
-
Navigate to the
Workspace
directory.cd ~/Workspace
-
Using the new terminal tab, make kubectl use the new kubeconfig.
export KUBECONFIG=~/Workspace/kubeconfig-developers.yaml
-
Attempt access the cluster using kubectl.
kubectl get pods -A
The browser opens.
-
Click Advanced, then click Accept the Risk and Continue.
The browser redirects to the LDAP login screen.
-
Click Advanced, then click Accept the Risk and Continue.
The browser displays the login screen.
-
Log in using the LDAP credentials.
- User name: developer01
- Password: VMware1!
-
Click Login.
You have been logged in and may now close this tab
is displayed in the browser. -
In the terminal, review the kubectl output.
The pods running on the cluster are listed.
-
List the kubectl contexts.
kubectl config get-contexts
The
tanzu-cli-tkc-01@tkc-01
context displays.
Developer Workload¶
-
Using the terminal, navigate to the
Workspace
directory.cd ~/Workspace
-
Ensure that kubectl is using the developer credentials.
export KUBECONFIG=~/Workspace/kubeconfig-developers.yaml
-
Display the vmbeans configuration file.
cat vmbeans.yaml
A deployment and LoadBalancer service type display.
The service has an external-dns annotation specifying the VMBeans FQDN.
-
Deploy the vmbeans configuration.
kubectl apply -f vmbeans.yaml
-
Verify the status of the deployment by using kubectl.
kubectl get deployment,service
Re-run the command until the deployment status is READY 1/1 and the vmbeans-service has an IP address listed in the EXTERNAL-IP field.
-
Using Firefox, open the VMBeans bookmark in a new tab.
http://vmbeans.tkg.vclass.local
The VMBeans website displays.
Inspect the NSX Advanced Load Balancer UI¶
-
Using Firefox, open the NSX Adv LB bookmark.
https://sa-nsxlb-01.vclass.local
-
Log in to NSX Advanced Load Balancer.
- User name: admin
- Password: VMware1!
-
On the Dashboard screen, under Virtual Services, click default-tkc-01--default-....
default-tkc-01--default is the load balancer for the VMBeans service that you created in the previous task.
-
Click Displaying Past 6 Hours and change it to Past 30 Minutes.
-
Using the terminal, navigate to the
Workspace
directory.cd ~/Workspace/
-
Generate traffic to the VMBeans website and leave the command running.
./gen-vmbeans-http-req.sh
-
View the traffic in NSX Advanced Load Balancer UI.
It takes a few minutes for the graph to display the traffic.
Continue to the next task while waiting for the graph to update.
Inspect the Logs in Vrealize Log Insight¶
-
Using Firefox, click the vRLI bookmark in a new tab.
https://sa-loginsight-01.vclass.local
-
Log in to vRealize Log Insight.
- User name: admin
- Password: VMware1!
- In the top panel, click Interactive Analytics.
- Click ADD FILTER.
- From the text drop-down menu, click appname.
- In the text box beside contains, enter vmbeans and select the full pod name vmbeans-deployment-##########-#####.
-
Click the search icon.
The logs from the vmbeans pod display.
-
Review the first log entry in the list.
The log line contains "
GET / HTTP/1.1 200
" which is a web request logged by the web server process inside the VMBeans pod. -
Using the terminal, close the terminal tab created in task 1 so you are no longer using the
~/Workspace/kubeconfig-developers.yaml
file to access the cluster.