vmware-tanzu / cluster-api-provider-bringyourownhost

Kubernetes Cluster API Provider BYOH for already-provisioned hosts running Linux.
Apache License 2.0
232 stars 76 forks source link

k8sinstallerconfigtemplates not removed after deleting the cluster via "kubectl delete" command #819

Open haiwu opened 1 year ago

haiwu commented 1 year ago

What steps did you take and what happened: I followed the same steps here at https://github.com/vmware-tanzu/cluster-api-provider-bringyourownhost/blob/main/docs/getting_started.md, on a vanilla Ubuntu 20.04 OS, with kind and docker on the same host.

root@instance-11:~/cluster-api-provider-bringyourownhost# k delete cluster byoh-cluster cluster.cluster.x-k8s.io "byoh-cluster" deleted

root@instance-11:~/cluster-api-provider-bringyourownhost# k get k8sinstallerconfigtemplates NAME AGE byoh-cluster-control-plane 7m30s byoh-cluster-md-0 7m30s

root@instance-11:~/cluster-api-provider-bringyourownhost# kubectl apply -f cluster.yaml kubeadmconfigtemplate.bootstrap.cluster.x-k8s.io/byoh-cluster-md-0 created cluster.cluster.x-k8s.io/byoh-cluster created machinedeployment.cluster.x-k8s.io/byoh-cluster-md-0 created kubeadmcontrolplane.controlplane.cluster.x-k8s.io/byoh-cluster-control-plane created byocluster.infrastructure.cluster.x-k8s.io/byoh-cluster created byomachinetemplate.infrastructure.cluster.x-k8s.io/byoh-cluster-control-plane created byomachinetemplate.infrastructure.cluster.x-k8s.io/byoh-cluster-md-0 created k8sinstallerconfigtemplate.infrastructure.cluster.x-k8s.io/byoh-cluster-control-plane unchanged k8sinstallerconfigtemplate.infrastructure.cluster.x-k8s.io/byoh-cluster-md-0 unchanged

What did you expect to happen: I would expect to see the following 2 k8sinstallerconfigtemplates would be deleted after deleting its cluster: root@instance-11:~/cluster-api-provider-bringyourownhost# k get k8sinstallerconfigtemplates NAME AGE byoh-cluster-control-plane 7m30s byoh-cluster-md-0 7m30s

What's the point of keeping them, after its cluster has already been deleted?

Anything else you would like to add: None

Environment:

LuisPedroso commented 6 months ago

i'm having the same problem, and when i apply yaml again, it doesn't do the kubeadm init