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
Use --force flag for reconciling addons #69424
Conversation
Humm, good observation on that. What does it mean for those immutable fields after adding the /assign @mikedanese |
/assign |
I've tested this, it requires also newer version of kubectl. I have one more problem with that - if Addon Manager finds kube-dns service with incorrect ClusterIP (immutable field), instead of re-aplying it immediately, kube-dns service gets pruned and recreated only in the next Addon Manager run. @MrHohn The behavior I expect is for the resource to be re-created with correct configuration. |
@kawych Thanks for the explanation, I wasn't sure about what I was asking about if |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
That means ~1 minute gap between deletion and recreation, guessing not too bad? |
/retest |
/cc @mikedanese |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: kawych If they are not already assigned, you can assign the PR to them by writing The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@mikedanese PTAL |
/lgtm |
/retest |
I'm looking at the kubectl apply flags and I see this:
From the code, it looks like this does what you describe. But this looks really scary to me: kubernetes/pkg/kubectl/cmd/apply/apply.go Lines 945 to 947 in 9f15368
What happens if we push an object config that is invalid in some clusters? What if a customer accidentally misconfigures an admission webhook and we start getting invalid requests on applies? It seems like we would just start deleting objects and recreating them. Even more likely, what if the deployment controller updates a deployment at the same time we run apply and get a conflict? Wouldn't we delete the deployment, wait for it to fully delete, then recreate it? cc @apelisse |
/remove-lifecycle rotten
I think the same behavior happens for normal apply behavior, with the exception of immutable objects - only because normal
Not sure if this is possible, if so, it indeed seems like an issue. However, the desired outcome would be not to simply skip reconciling, but to pick up the updated deployment and perform reconcile on it, right? The code you linked includes retries for the patch operation, shouldn't it resolve the problem? Note the problem that I'm trying to address here: Addon Manager fails to reconcile some addons and the reconcile loop breaks. I believe the right solution would be to force reconciling immutable objects. If there are risks to it, we have to think of another solution. For example, can we add a logic that resumes the reconcile loop, so that |
|
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@fejta-bot: Closed this PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
What this PR does / why we need it:
Addon manager should use kubectl
--force
flag when reconciling addons. Without it, following scenario breaks the cluster:kubectl delete
on any resource with immutable fields, i.e. kube-dns servicekubectl create
your own resource with the same name, but different value for the immutable field, for example servicekube-dns
with ClusterIP = 10.35.240.12After that, Addon Manager fails to reconcile this resource. A failure in this steps leads to further failures, for example Addon Manager doesn't attempt to prune not-wanted addons.
Release note: