Operators and administrators need to access the Kubernetes cluster that runs Tanzu for Apache Kafka for Tanzu Platform, or list the specific pods associated with a service instance.
Before proceeding, ensure you have the following prerequisites in place:
kubectl installed locally (if using a downloaded kubeconfig file).
BOSH CLI installed and configured, along with access to the BOSH environment (only required if using the optional BOSH SSH workflow).
The Tanzu for Apache Kafka for Tanzu Platform tile installed.
Tanzu Platform for Cloud Foundry
Tanzu for Apache Kafka on Tanzu Platform
Direct interaction with the underlying Kubernetes environment, master VMs, or service instance pods is often necessary for advanced troubleshooting, cluster exploration, or monitoring the health of deployed Apache Kafka service instances.
Note: If your foundation uses VMware Tanzu Kubernetes Service (VKS) or another bring-your-own cluster model, the tile's Kubeconfig credential does not apply. You must use the kubeconfig provided by your platform team and can skip to Step 4.
Step 1: Obtain the kubeconfig from the tile (For Embedded Clusters Only)
In Tanzu Operations Manager, open the Tanzu for Apache Kafka for Tanzu Platform tile.
Open the Credentials tab.
Find Kubeconfig and click Link to Credential.
The response will be in JSON format. Locate the kubeconfig within .credential.value.output and save that value to a local file (e.g., kafka-tile-kubeconfig).
Verify access by pointing kubectl to your new file:
kubectl --kubeconfig kafka-tile-kubeconfig get nodesStep 2: Connect to the Kubernetes master VM with SSH (Optional) Use this workflow only when you need shell access to the cluster VMs (e.g., for deep troubleshooting).
Obtain a list of the VMs by using the BOSH CLI:
bosh ssh -d <deployment-name> <master-instance/id>Step 3: Explore the Kubernetes cluster using kubectl on the VM If you logged into the Kubernetes master node via SSH, you can explore the cluster directly using kubectl. Its recommended to create an alias for the kubectl path combined with its kubeconfig to make commands easier:
alias kubectl='/var/vcap/packages/kubernetes/bin/kubectl --kubeconfig /var/vcap/jobs/kubernetes-roles/config/kubeconfig'Step 4: Obtain the pods for a service instance
To locate and list the pods running for a specific service instance:
1. Retrieve the service GUID using the Cloud Foundry CLI:
cf service SERVICE-INSTANCE-NAME --guid 2. The pods are deployed within the Kubernetes cluster in a namespace named <GUID>-ns. To list the pods, run the following command (using either your local kubectl context or the SSH session alias):
kubectl get pods -n <SERVICE-INSTANCE-GUID>-ns