You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"openshift-install destroy cluster" leaves auth dir, breaking next install #522
After installing, there is the auth/kubeconfig file in the current checkout. When destroying the cluster, this file is not deleted. A following cluster install load this files, but it does not match the new certificates. Hence, the cluster does not work as expected for the user.
More on this over here and later. For now, the easiest approach is probably to use --dir=whatever and then after you destroy the cluster rm -rf whatever to give you a clean slate for the next run.
I don't follow how the presence of auth/kubeconfig caused the certificate mismatch. If the installer's state file was still present, it would have reused all of the previously generated TLS assets, resulting in valid certificates. Did you remove the installer's state file but leave the kubeconfig?
Yes, that makes sense. You are effectively telling the installer to ignore whatever kubeconfig it has generated and to instead use the one you have provided (which will almost always be incorrect).
The result is a failed cluster. All instances behind the int and ext aws elb are OutOfService. Kublet services are failed on instances ... essentially there is no OpenShift cluster.
You will see the following output (and systemd journal logs) when starting kublet ....
I still think the UX is broken. There should be a default for --dir and a warning or even error if that dir already exists, with an override if it is really intended to re-use a dir.
This would make life easier for devs, where cluster installs happen many times a day. But I think it would make life slightly more complicated for external users, who are more likely to successfully launch a single cluster and then walk away from the installer for weeks+. I'm fine biasing the UX in favor of external users.
However, folks who preserve their state file (or, with #556, their state directory) should be fine reusing an earlier run's assets exept for the 30-minute-validity kubelet-client cert and its descendants. I think we could guard against that with asset-load-time validators.
The only remaining issue then would be folks who removed parents but not frozen child assets between runs. #556 does a better job tracking frozen/modified assets, with this warning (which we can strengthen as discussed there) in the dangerous case.
I wanted to post an error message from a state my system is in now which I think is related to this issue. openshift-install cluster delete fails with the following message:
DependencyViolation: resource sg-0d577e26d576aabc9 has a dependent object
DependencyViolation: resource sg-0d577e26d576aabc9 has a dependent object
This is a separate issues. This issues is about leftovers on the installer host. Your issue is about leftovers in the AWS account. Can you file a new issue with the full teardown logs? Check in ${INSTALL_DIR}/.openshift_install.log, and scrub whatever you post for any information you consider sensitive.
But I think it would make life slightly more complicated for external users, who are more likely to successfully launch a single cluster and then walk away from the installer for weeks+.
Why would having a default --dir value be slightly more complicated for external users? Having a default --dir automatically be set to the cluster name would make it nice and obvious I would think.
What are the potential issues here? I anticipate that once this GA's, it would be writing to the system default kubeconfig (~/.kube/config), right? So I guess I'm curious what the complications would be?
Why would having a default --dir value be slightly more complicated for external users? Having a default --dir automatically be set to the cluster name would make it nice and obvious I would think.
Setting to the cluster name may be okay, but only when we are generating it all from scratch. We have to support the case where install-config is imported in.
What are the potential issues here? I anticipate that once this GA's, it would be writing to the system default kubeconfig (~/.kube/config), right? So I guess I'm curious what the complications would be?
~/.kube/config may not be ideal (though useful in many cases) because multiple clusters may (and likely) need to be launched from a single local machine. So isolating a cluster to its target 'dir' is strongly desirable.
./openshift-install v4.1.0-201904211700-dirty
built from commit f3b726cc151f5a3d66bc7e23e81b3013f1347a7e
release image quay.io/openshift-release-dev/ocp-release@sha256:345ec9351ecc1d78c16cf0853fe0ef2d9f48dd493da5fdffc18fa18f45707867
Not sure why this version is marked "dirty" - I downloaded it from the official link.
Activity
sttts commentedon Oct 23, 2018
Couldn't double check this due to the current AWS quota issues. Please confirm if this is an issue.
wking commentedon Oct 24, 2018
More on this over here and later. For now, the easiest approach is probably to use
--dir=whateverand then after you destroy the clusterrm -rf whateverto give you a clean slate for the next run.crawford commentedon Oct 25, 2018
I don't follow how the presence of
auth/kubeconfigcaused the certificate mismatch. If the installer's state file was still present, it would have reused all of the previously generated TLS assets, resulting in valid certificates. Did you remove the installer's state file but leave the kubeconfig?sttts commentedon Oct 25, 2018
Yes, I did.
stlaz commentedon Oct 25, 2018
Encountered the very same problem - several times. Removing the
auth/directory always fixes the cert mismatch.crawford commentedon Oct 25, 2018
Yes, that makes sense. You are effectively telling the installer to ignore whatever kubeconfig it has generated and to instead use the one you have provided (which will almost always be incorrect).
We should revisit this UX issue soon.
mazzystr commentedon Oct 31, 2018
I have been doing the following...
bin/openshift-install destroy-clusterrm -rf terraform.state terraform.tfvars terraform.tfstate .openshift_install_state.json metadata.jsonbin/openshift-install clustermv auth/kubeconfig ~/.kube/ccallegarexport KUBECONFIG=$HOME/.kube/ccallegarThe result is a failed cluster. All instances behind the int and ext aws elb are OutOfService. Kublet services are failed on instances ... essentially there is no OpenShift cluster.
You will see the following output (and systemd journal logs) when starting kublet ....
Executing the following fixes everything!
bin/openshift-install destroy-clusterbin/openshift-install clustermv auth/kubeconfig ~/.kube/ccallegarexport KUBECONFIG=$HOME/.kube/ccallegarwking commentedon Oct 31, 2018
Docs for the easier
--dirapproach are in flight with #532.sttts commentedon Nov 1, 2018
I still think the UX is broken. There should be a default for
--dirand a warning or even error if that dir already exists, with an override if it is really intended to re-use a dir.wking commentedon Nov 1, 2018
This would make life easier for devs, where cluster installs happen many times a day. But I think it would make life slightly more complicated for external users, who are more likely to successfully launch a single cluster and then walk away from the installer for weeks+. I'm fine biasing the UX in favor of external users.
However, folks who preserve their state file (or, with #556, their state directory) should be fine reusing an earlier run's assets exept for the 30-minute-validity kubelet-client cert and its descendants. I think we could guard against that with asset-load-time validators.
The only remaining issue then would be folks who removed parents but not frozen child assets between runs. #556 does a better job tracking frozen/modified assets, with this warning (which we can strengthen as discussed there) in the dangerous case.
jeremyeder commentedon Dec 7, 2018
I wanted to post an error message from a state my system is in now which I think is related to this issue.
openshift-install cluster deletefails with the following message:wking commentedon Dec 7, 2018
This is a separate issues. This issues is about leftovers on the installer host. Your issue is about leftovers in the AWS account. Can you file a new issue with the full teardown logs? Check in
${INSTALL_DIR}/.openshift_install.log, and scrub whatever you post for any information you consider sensitive.jeremyeder commentedon Dec 7, 2018
Ack - #836
wgordon17 commentedon Dec 17, 2018
@wking
Why would having a default
--dirvalue be slightly more complicated for external users? Having a default--dirautomatically be set to the cluster name would make it nice and obvious I would think.What are the potential issues here? I anticipate that once this GA's, it would be writing to the system default
kubeconfig(~/.kube/config), right? So I guess I'm curious what the complications would be?rajatchopra commentedon Jan 17, 2019
Fixed with this commit: b686588
Closing the issue. Please re-open if it still exists. I have tested it against a libvirt cluster and auth gets removed upon a destroy.
rajatchopra commentedon Jan 17, 2019
Setting to the cluster name may be okay, but only when we are generating it all from scratch. We have to support the case where install-config is imported in.
~/.kube/config may not be ideal (though useful in many cases) because multiple clusters may (and likely) need to be launched from a single local machine. So isolating a cluster to its target 'dir' is strongly desirable.
tzvatot commentedon May 5, 2019
This issue still happens with
Not sure why this version is marked "dirty" - I downloaded it from the official link.