먼저 워커 클러스터 컨텍스트로 바꾼다.
tanzu init
tanzu login
tanzu mangement-cluster create {이름} --ui
tanzu mc create {이름} --file {file}
안되면 kubectl에서 지워줘야하는듯해보임.
tanzu mc delete {mc name}
tanzu config server list
tanzu config server delete {mc name}
클러스터 설정 파일(kubeconfig) 위치
.kube/config << 워커 클러스터
.kube-tkg/config << mgmt 클러스터
[brewinstall@tanzu-bootstrap-cluster ~]$ kubectl config current-context
tce-management-cluster-admin@tce-management-cluster
[brewinstall@tanzu-bootstrap-cluster ~]$ kubectl config get-contexts
CURRENT NAME CLUSTER AUTHINFO NAMESPACE
* tce-management-cluster-admin@tce-management-cluster tce-management-cluster tce-management-cluster-admin
[brewinstall@tanzu-bootstrap-cluster ~]$ kubectl config get-clusters
NAME
tce-management-cluster
[brewinstall@tanzu-bootstrap-cluster ~]$ kubectl config get-users
NAME
tce-management-cluster-admin
클러스터, 컨텍스트, 유저 삭제 방법
[brewinstall@tanzu-bootstrap-cluster ~]$ kubectl config delete-context tce-mgmt-cluster-admin@tce-mgmt-cluster
deleted context tce-mgmt-cluster-admin@tce-mgmt-cluster from /home/brewinstall/.kube/config
[brewinstall@tanzu-bootstrap-cluster ~]$
[brewinstall@tanzu-bootstrap-cluster ~]$ vi /home/brewinstall/.kube/config
[brewinstall@tanzu-bootstrap-cluster ~]$ kubectl config delete-cluster tce-mgmt-cluster-admin@tce-mgmt-cluster
error: cannot delete cluster tce-mgmt-cluster-admin@tce-mgmt-cluster, not in /home/brewinstall/.kube/config
[brewinstall@tanzu-bootstrap-cluster ~]$ vi /home/brewinstall/.kube/config
[brewinstall@tanzu-bootstrap-cluster ~]$ kubectl config delete-cluster tce-mgmt-cluster
deleted cluster tce-mgmt-cluster from /home/brewinstall/.kube/config
[brewinstall@tanzu-bootstrap-cluster ~]$ vi /home/brewinstall/.kube/config
[brewinstall@tanzu-bootstrap-cluster ~]$ kubectl config delete-user tce-mgmt-cluster-admin
deleted user tce-mgmt-cluster-admin from /home/brewinstall/.kube/config
kubectl config use-context my-cluster-admin@my-cluster
kubectl cluster-info
[ec2-user@ip-10-0-31-78 ~]$ kubectl get po
The connection to the server localhost:8080 was refused - did you specify the right host or port?
[ec2-user@ip-10-0-31-78 ~]$ kubectl api-versions
error: couldn't get available api versions from server: Get "http://localhost:8080/api?timeout=32s": dial tcp [::1]:8080: connect: connection refused
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config