kubectl get VCenterPrime -A
No resources found
TCA: 2.2, 2.3
TCP: 2.7, 3.0
Minikube data is lost in following scenarios
mkdir -p ~/minikube-data-recovery
VCenterPrime Secret# Set Required VariablesVCENTER_PASSWORD="<vcenterPasswordToBeChanged>"VCENTER_USERNAME="<vcenterUsernameToBeChanged>"MGMT_CLUSTER_NAME="<mgmtClusternameToBeChanged>"
cat <<EOF > ~/minikube-data-recovery/vcenterprime-secret.yamlapiVersion: v1data: password: `echo ${VCENTER_USERNAME} |base64 -w 0` username: `echo ${VCENTER_PASSWORD} |base64 -w 0`kind: Secretmetadata: name: vcprime-${MGMT_CLUSTER_NAME}-secret namespace: tca-systemtype: OpaqueEOF
Note: Username and password are intentionally swapped in the secret as per implementation. Do not get confused.
~/minikube-data-recovery/vcenterprime-secret.yaml and kubectl apply itkubectl apply -f ~/minikube-data-recovery/vcenterprime-secret.yaml --kubeconfig=/home/admin/.kube/config# Set Required VariablesMGMT_CLUSTER_NAME="<mgmtClusternameToBeChanged>"VCENTER_HOST="<vcenterFQDNToBeChanged>"DATACENTER="<dataCenterToBeChanged>"THUMBPRINT="<thumbprintTobeChanged>"
cat <<EOF > ~/minikube-data-recovery/vcenterprime.yamlapiVersion: telco.vmware.com/v1alpha1kind: VCenterPrimemetadata: name: vcprime-${MGMT_CLUSTER_NAME} namespace: tca-systemspec: server: address: ${VCENTER_HOST} credentialRef: kind: Secret name: vcprime-${MGMT_CLUSTER_NAME}-secret namespace: tca-system subConfig: datacenter: ${DATACENTER} thumbprint: ${THUMBPRINT}EOF
Note: you can use the below command to get the sha1 thumbprint of vcenteropenssl s_client -connect ${VCENTER_HOST}:443 </dev/null 2>/dev/null | openssl x509 -noout -fingerprint -sha1
Verify the ~/minikube-data-recovery/vcenterprime-secret.yaml and kubectl apply itkubectl apply -f ~/minikube-data-recovery/vcenterprime.yaml --kubeconfig=/home/admin/.kube/config
Note: Repeat below steps 4,5,6,7 for all management clusters whose CRs are missing in tca-cp minikube
Create Namespace for missing Management Cluster# Set VariablesMGMT_CLUSTER_NAME="<mgmtClusterNameToBeChanged>"
cat <<EOF > ~/minikube-data-recovery/namespace.yamlapiVersion: v1kind: Namespacemetadata: labels: kubernetes.io/metadata.name: ${MGMT_CLUSTER_NAME} name: ${MGMT_CLUSTER_NAME}
EOF
verify ~/minikube-data-recovery/namespace.yaml and apply itkubectl apply -f ~/minikube-data-recovery/namespace.yaml --kubeconfig=/home/admin/.kube/config
Create Management Cluster's kubeconfig secret
MGMT_CLUSTER_NAME="<mgmtClusternameToBeChanged>"PATH_TO_KUBECONFIG="<pathToKubeconfigToBeChanged>"
cat <<EOF > ~/minikube-data-recovery/${MGMT_CLUSTER_NAME}-kubeconfig-secret.yamlapiVersion: v1data: value: `base64 -w 0 ${PATH_TO_KUBECONFIG}`kind: Secretmetadata: name: ${MGMT_CLUSTER_NAME}-kubeconfig namespace: ${MGMT_CLUSTER_NAME}type: OpaqueEOF
Note: The kubeconfig for mgmt cluster can be copied from /opt/vmware/k8s-bootstrapper/<mgmt_cluster_uuid>/kubeconfig file located on tca-cp.
Switch to root for accessing this file and copy to /tmp/ before changing ownership to admin:admin
Verify the content and apply itkubectl apply -f ~/minikube-data-recovery/${MGMT_CLUSTER_NAME}-kubeconfig-secret.yaml --kubeconfig=/home/admin/.kube/config
Create TcaKubernetesCluster CR# Set VariablesMGMT_CLUSTER_NAME="<mgmtClusternameToBeChanged>"ENDPOINT_IP="<mgmtclusterendpointIpToBeChanged>"TBR_BOM="<tbrBomToBeChanged>"
cat <<EOF > ~/minikube-data-recovery/${MGMT_CLUSTER_NAME}-tkc.yamlapiVersion: telco.vmware.com/v1alpha1kind: TcaKubernetesClustermetadata: labels: telco.vmware.com/cluster-role: management name: ${MGMT_CLUSTER_NAME} namespace: ${MGMT_CLUSTER_NAME}spec: cloudProviders: primeRef: kind: VCenterPrime name: vprime-${MGMT_CLUSTER_NAME} namespace: tca-system clusterNetwork: pods: cidrBlocks: - 100.96.0.0/11 services: cidrBlocks: - 100.64.0.0/13 cniType: antrea controlPlaneEndpoint: host: ${ENDPOINT_IP} strategy: rollingUpdate: maxSurge: 1 maxUnavailable: 0 type: RollingUpdate tcaBomReleaseRef: name: ${TBR_BOM}EOF
Note: To get the vcenter prime name you created previously you can use below command
kubectl get vcenterprime -n tca-system --kubeconfig=/home/admin/.kube/config
Note: Please use the below command to find tbr bom version value
kubectl get tbr -n tca-system
Verify the file contents of ~/minikube-data-recovery/${MGMT_CLUSTER_NAME}-tkc.yaml and apply it
kubectl apply -f ~/minikube-data-recovery/${MGMT_CLUSTER_NAME}-tkc.yaml --kubeconfig=/home/admin/.kube/config
Edit Add-Ons from TCA UI And Save
From TCA UI Navigate to the caas cluster → mgmtcluster
Click on Edit Cluster Configuration for the mgmtcluster , do nothing and save
Wait for TcaClusterAddon CRs to be recreated in the namespace:
kubectl get TcaClusterAddon -A -w --kubeconfig=/home/admin/.kube/config