kubernetes-sigs / cluster-api-provider-ibmcloud

Cluster API Provider for IBM Cloud
https://cluster-api-ibmcloud.sigs.k8s.io
Apache License 2.0
62 stars 82 forks source link

Cannot delete the cluster created by kind #227

Closed clyang82 closed 5 years ago

clyang82 commented 5 years ago

/kind bug /sig ibmcloud

We have packed kind and docker client in clusterctl docker image. it is available in latest version - quay.io/cluster-api-provider-ibmcloud/clusterctl:latest

When I use a sample job to create the cluster, the kind cluster cannot be deleted once there has any errors. You have to login the worker node to install the kind client to delete the cluster in order to rerun the job.

/cc @gyliu513 @hchenxa @zxDiscovery

xunpan commented 5 years ago

Did you try kind delete cluster --name=clusterapi manually in your container started by clusterctl image? It is used by clusterctl to delete kind cluster when there has issues during cluster creation.

hchenxa commented 5 years ago

or you may delete the containers which create by kind on your work node. Execute below command to find the container you created and then delete it. docker ps -qa --no-trunc --filter "label=io.k8s.sigs.kind.cluster=<clustername>"

clyang82 commented 5 years ago

Thanks @xunpan @hchenxa for your solution. I think we may add the delete kind cluster before the job exists unexpectedly.

gyliu513 commented 5 years ago

@clyang82 https://github.com/kubernetes-sigs/cluster-api-provider-ibmcloud/pull/249

FYI @songleo

hchenxa commented 5 years ago

I prefer to open this issue and I think it's not prefer to install the kind of each of worker node and manually delete the cluster before create this yaml.

and may be we can have an init-container to do this job.

gyliu513 commented 5 years ago

@hchenxa when upgrade cluster api, we will have random cluster name https://github.com/kubernetes-sigs/cluster-api/pull/984 , so there will not be such problem.

hchenxa commented 5 years ago

@gyliu513 , so there have a new problem when using the random cluster name, if the job failed, we did not clean up the kind cluster, so there will have so many kind cluster created on the worker node.

gyliu513 commented 5 years ago

@hchenxa , that's a question and you can open another issue to trace it.