Frequently encountered questions (How TOs) with supporting TMC SM
search cancel

Frequently encountered questions (How TOs) with supporting TMC SM

book

Article ID: 417146

calendar_today

Updated On:

Products

VMware Tanzu Mission Control

Issue/Introduction

This KB provide some general procedures of How To Procedures when using TMC SM product. 

Environment

TMC SM 1.4

Resolution

1. How to get the values file from the TMC SM setup?

kubectl -n tmc-local get secret tanzu-mission-control-tmc-local-values -ojsonpath='{.data.values\.yaml}' | base64 -d

2. How to upload the tanzu CLI plugin to the TMC SM image repository?

TMC_SM_REPO="harbor.tanzu.io:8443/tmc"
tanzu plugin upload-bundle --tar tmc/tanzu-cli-plugins/tmc.tar.gz --to-repo "$TMC_SM_REPO"

tanzu plugin source update default -u ${TMC_SM_REPO}/plugin-inventory:latest

 

3. How to create a TMC plugin context for TMC SM?

tanzu plugin install --group vmware-tmc/default

TMC_SM_ENDPOINT="tmc.tanzu.io"
tanzu tmc context create tmc-sm --endpoint $TMC_SM_ENDPOINT --idp-type pinniped [--basic-auth]

Note

  1. If MFA enabled idP, don’t use option “--basic-auth”, and run tanzu cli with “root/sudo” on a server with a web browser. 
  2. The default context name is “tmc-sm” in the migration script.

 

4. How to change the resource configuration temporarily for debugging?

# Pause the packageInstall to avoid rollback changes
kctrl package installed pause -i pinniped -n tmc-local
# Modify the resource configuration, and test the changes
...
# After debugging, unpause the packageInstall to rollback changes
kctrl package installed kick -i pinniped -n tmc-local

 

5. How to generate a kubeconfig token with “tanzu tmc cluster generate-token” for terraform?

Export variables same as SaaS
CLUSTER_UID
CLUSTER_RID_V2
CLUSTER_ENDPOINT
CLUSTER_CA_BUNDLE
In TMC SM it’s required to export below two environment variables:
TMC_ENDPOINT
TMC_SELF_MANAGED=“true”
Get above values with “tanzu tmc cluster kubeconfig get $CLUSTER -m $MGMT_CLUSTER -p $PROVISIONER”

 

6. How to connect DB of TMC SM

 

kubectl -n tmc-local port-forward svc/postgres-postgresql 5432:5432 </dev/null &>/dev/null &

# e.g connect to  rds-credentials
# install psql
# sudo apt update && sudo apt install postgresql-client -y
psql $(kubectl -n tmc-local get secret rds-credentials -ojson | jq -r '.data.PGURL | @base64d | sub("postgres-postgresql"; "127.0.0.1")')

 

 

7. How to collect support bundle for TMC SM

 

# Download the crashd CLI
wget https://github.com/vmware-tanzu/crash-diagnostics/releases/download/v0.4.3/crashd_0.4.3_linux_amd64.tar.gz
tar xvfz crashd_0.4.3_linux_amd64.tar.gz

# Donwload diagnostics.crsh
tmc-sm-installer/dependencies/imgpkg/imgpkg pull -i projects.packages.broadcom.com/tmc_selfmanaged/additional-resources:1.0.0 -o 
/tmp/tmc-sm-support-bundle

mkdir /tmp/tmc-sm-logs
./crashd run --args="outdir=/tmp/tmc-sm-logs" /tmp/tmc-sm-support-bundle/crashd/diagnostics.crsh

# Copy the log bundle from /tmp/tmc-sm-logs/tmc-log-dump.tar.gz

Or collect with vks-support-bundle https://knowledge.broadcom.com/external/article/345464/gathering-logs-for-vsphere-with-tanzu.htm