Reinstalled flux behaves as if it wasn't uninstalled #4787
Replies: 2 comments 3 replies
-
Without a few more details, like the actual manifest that you used, I'm not sure anyone can tell why Flux deleted the namespace. But it does sound like when you repeated the same steps, you got the same outcome. So that at least suggests the possibility of holding it wrong. There could also be a guard rail missing, or other UX enhancement possible that would make this mode of catastrophic failure less likely. I really cannot tell you without the manifest from your repo. It sounds like you are not bootstrapping flux the normal way. When you say you create the namespace and apply the manifest again, how does this differ from bootstrapping exactly and why are you doing it this way, instead of running bootstrap according to the instructions? Please provide more details about any specific guides you followed, and include as many details as you can about the reasons why you may have needed to diverge from the guide as it is written. These issues may complicate support but without more information, I cannot be of any help except to balk and say "sounds like you got a repro there, at least huh huh" I'm sorry, I don't mean to make light of a serious issue, (but please don't go and do this a third time just to make a point!) we can certainly help you piece together exactly what you did to make sure others know not to do that. It may be expected behavior. Running If you delete the flux-system namespace before running flux uninstall, for example, that can easily result in all hell breaking loose. That is not the recommended process for uninstalling flux in any guide we host, though, so hopefully you didn't get that specific advice from anywhere in the flux docs! (Let us know...) |
Beta Was this translation helpful? Give feedback.
-
Thanks very much for the help and advice. I don't believe this had anything to do with Flux. More to do with the fact that I needed to force delete the namespace (due to external pressure to get everything running again asap in a namespace with the same name!) which is never a good thing to do in Kubernetes. I think your summary is great advice... "... and if namespaces are mixed with other resources, it could result in the surprise deletion of a namespace and all the contents. The defense against this is keeping your manifest bundles small and declaring the namespaces in a separate Kustomization, perhaps even with prune disabled. We will definitely be moving to individual kustomizations, and probably disabling prune to start with! Thanks so much. |
Beta Was this translation helpful? Give feedback.
-
I created two plain kubectl manifest files, to install two deployments, in a folder in a repo watched by flux.
Unfortunately, I accidentally included declarations to create a namespace in each manifest file.
The namespace folder already contained many other deployments.
Firstly, the reconciliation of one of these new manifests failed, presumably as both were trying to create the same namespace. I didn't really understand the message from "flux get all -A".
Apologies I didn't record it either... something about a reference to a directory not a file.
Secondly, as expected, when I deleted both manifests from the watched folder, the namespace and all of its contents was removed.
I didn't think about that until everybody started asking where their applications had gone!!!
Now the bit I don't understand...
I cleaned things up by creating the namespace once more and uninstalling/installing flux again.
I used the same git repo for the install... using flux bootstrap gitlab and the same watched folder.
I then copied the two updated manifests (with no declaration to create namespace) to the folder for flux to synch.
But the result was that flux again deleted the namespace.
I was definitely not expecting that!!!
Any idea why?
Did flux not cleanly uninstall?
Should I have used a new gitlab repo so there was no historical versions of the manifests with the create manifest declaration?
Beta Was this translation helpful? Give feedback.
All reactions