-
Notifications
You must be signed in to change notification settings - Fork 605
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kustomization not removing attributes added by kubectl edit
#2099
Kustomization not removing attributes added by kubectl edit
#2099
Comments
Duplicate of fluxcd/kustomize-controller#486 |
The workaround mentioned in this issue does not resolve the issue. Are there any alternatives?
|
Hmm this is really strange, I have a test here for detecting drift of keys added directly to the cluster https://github.com/fluxcd/pkg/blob/main/ssa/manager_diff_test.go#L181 I'll try this on a real cluster tomorrow and get back to you. |
I tried this on a real cluster and was able to reproduce this.
Then after
The added field still exists:
|
I wander if this is by design or if it’s a bug in the Kubernetes API. Regardless of this, we can’t do anything in Flux if Kubernetes server-side apply doesn’t remove fields without a manager. I think we should document this behavior in https://github.com/fluxcd/kustomize-controller/blob/main/docs/spec/v1beta2/kustomization.md#reconciliation |
If The easiest way to get ownership of all fields is to use the following command:
The complete steps that can solve the problem are as follows。
Get ownership of all fields of
Remove the managedField of
For more information about ownership, please refer to the following document. |
We are also facing this problem, but we expect to solve it with the following steps.
We can delete the fields by kustomize-controller in the above steps. However, it does not mean that kustomize-controller will always be able to remove fields added by humans with We are considering the following solutions to this problem.
The above steps will allow kustomize-controller to remove fields added by humans with |
Describe the bug
When new keys are added through
kubectl edit
to a ConfigMap managed by flux, the subsequent reconciliation loops do not remove the keys not present in git.Steps to reproduce
kubectl edit
to add a new key not present in the git repositoryExpected behavior
The ConfigMap should be updated to match what is stored in Git, i.e the manually added key should be removed
Screenshots and recordings
No response
OS / Distro
macOS
Flux version
flux: v0.23.0
Flux check
Git provider
Gitlab
Container Registry provider
No response
Additional context
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: