Skip to content

Matt Adam

Tech Blog

Menu
  • Home
  • Home Lab
    • Home Lab
    • Home Lab with NSX-T
  • Kubernetes
    • Openshift
    • K3s
    • Tanzu
      • Tanzu – TKGs (WCP)
      • Tanzu – TKG (TKGm)
    • Avi Kubernetes Operator (AKO)
  • About
  • Privacy Policy
Menu

Useful Tanzu / Kubectl Commands

Posted on September 8, 2022September 9, 2022 by Matt Adam

I’ll try and maintain a list of commands that I use frequently for interacting with the tanzu cli and the kubectl cli. Probably also some helm commands.

Table of Contents

  • Tanzu CLI Commands
  • Kubectl Commands
  • Helm Commands

Tanzu CLI Commands

##############################
##### Initialize Cluster #####
##############################
tanzu init


##############################
#### Tanzu UI Deployment #####
##############################
tanzu management-cluster create --ui --bind "0.0.0.0:8080"


##############################
####### Switch Context #######
##############################
tanzu management-cluster kubeconfig get --admin
kubectl config use-context management-cluster-1-admin@management-cluster-1

tanzu cluster kubeconfig get guest-cluster-1 --admin
kubectl config use-context guest-cluster-1-admin@guest-cluster-1


##############################
#### Mgmt Cluster Status #####
##############################
tanzu management-cluster get


##############################
#### Guest Cluster Status ####
##############################
tanzu cluster get guest-cluster-1


##############################
#### Delete Mgmt Cluster #####
##############################
tanzu management-cluster delete


##############################
#### Delete Guest Cluster ####
##############################
tanzu cluster delete guest-cluster-1


Kubectl Commands

##############################
#### Edit AKO Config Map #####
##############################
kubectl edit cm -n avi-system


##############################
####### Troubleshooting ###### # Modify the file path to your context
##############################
kubectl get po,deploy,cluster,kubeadmcontrolplane,machine,machinedeployment -A --kubeconfig /root/.kube-tkg/tmp/config_IT8nYmgN

Helm Commands

##############################
### cat Values into a file ### # Select version
##############################
helm show values ako/ako --version 1.7.1 > values.yaml

##############################
###### Update AKO Repo ####### 
##############################
helm repo update
helm search repo


##############################
##### Deploy AKO on Guest #### # Select version and modify the values.yaml file
##############################
kubectl create ns avi-system
helm install  ako/ako  --generate-name --version 1.7.2 -f  ako_values.yaml  -n avi-system


##############################
######### Delete AKO #########
##############################
helm delete $(helm list -n avi-system -q) -n avi-system

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • Upgrading the ESXi Node from vSphere7 to vSphere 8
  • Setting up the Kubernetes Dashboard
  • Running a DNS server in K3s
  • Raspberry Pi Kubernetes Cluster
  • Pod Routing: NodePort, ClusterIP, NodePortLocal

About

My name is Matt Adam and I’m a Product Line Manager at VMware.

I support the NSX Advanced Load Balancer (Avi Networks) with a focus on containers and Kubernetes. I have a background in load balancing, automation, development, and public cloud.

© 2023 Matt Adam | Powered by Minimalist Blog WordPress Theme