TCA: 2.3
TCP: 3.0
The issue seems to be that KBS cannot find the tkgcontext query data in the KBS database, so the deletion failed.
To check this, follow the procedure below:
curl http://localhost:8888/api/v1/managementclusterscurl --request GET http://127.0.0.1:8888/api/v1/managementcluster/{MC_ID} | jqcurl --request GET http://127.0.0.1:8888/api/v1/tkgcontext/{TKG_ID} | jq
{"code":"not_found","message":"tkgcontext: #########-####-#####-####-############ not exist in DB.","child_messages":null}Below is the sample file for tkgcontext.json
{"airgap": {"caCert":"encoded certificate","fqdn":"airgap.example.com"},"id":"82ba7200-246d-4b31-a559-886bb6d3e311","infrastructure": {"type":"vsphere","version":"8.0.2"},"ipFamilies":"IPv4","vsphere": {"clusterName":"mgmt-cluster","dataCenter":"dual-dc","dataStore":"vsanDatastore","ip":"dual-vcprime.ipv6.com","network":"/dual-dc/network/mgmt/dual-vds/management","resourcePool":"/dual-dc/host/mgmt-cluster/Resources/management","username":"[email protected]","password":"Your Password""vmFolder":"capv","vmTemplate":"caas-photon-5-kube-v1.28.4+vmware.1-23424098"}}
Below is the sample file for tkgcontext.json
{"id":"61353bdc-5701-49cc-9ea7-0a3d06a4fca5","ipFamilies":"IPv4","infrastructure":{"type":"vsphere","version":"7.0.3"},"vsphere":{"ip":"vcenter.vmlabs.com","username":"[email protected]","dataCenter":"Datacenter","dataStore":"Data-Disk","clusterName":"Cluster","network":"/Datacenter/network/DSwitch-MGMT/TCA-NTW","resourcePool":"/Datacenter/host/Cluster/Resources/TCA_Management","vmFolder":"TCA_Machines","vmTemplate":"/Datacenter/vm/TCA_Images/photon-3-kube-v1.24.10-vmware.1-tkg.1-fbb49d-21438772"}}
su rootcd /tmpcurl --request POST "http://127.0.0.1:8888/api/v1/tkgcontext" -d @tkgcontext.json