-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
kubeadm: upload the ClusterConfiguration
during the upgrade
#77513
kubeadm: upload the ClusterConfiguration
during the upgrade
#77513
Conversation
After this change, I can see the
|
During the upgrade process, `kubeadm` will take the current `ClusterConfiguration`, update the `KubernetesVersion` to the latest version, and call to `UploadConfiguration`. This change makes sure that when the mutation happens, not only the `ClusterStatus` is mutated, but the `ClusterConfiguration` object inside the `kubeadm-config` ConfigMap as well; it will contain the new `KubernetesVersion`.
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.
thanks for the quick fix @ereslibre
@fabriziopandini PTAL.
I think the upgrade path could instead of calling to UploadConfig make explicit what it needs to mutate inside the kubeadm-config ConfigMap (I think it's only the KubernetesVersion inside the ClusterConfiguration object).
hm, i think at this point (e.g. during upgrade) the ClusterConfiguration could have changed from v1beta1 to v1beta2, so we need to upload the whole object instead of patching the version field only?
/lgtm
/approve
/hold
/retest |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ereslibre, neolit123 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 |
You are right, dismiss that comment then, uploading the whole versioned object is the right thing to do. I omitted any reference to that in the commit message on purpose. |
or we can check if the API object version changed, and only do upload then. but it's probably faster to just re-upload. /priority important-longterm |
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.
@ereslibre
If I got it right, probably the cleanest solution is to implement one function:using create or replace for the full upload path (to be used by init, upgrade, config-upload) and one function using create or mutate for the change ClusterStatus path (to be used by join, reset).
That's means that only join/reset operations can be executed in parallel, but I`m fine with this.
However, let's discuss this tomorrow in the kubeadm office hours
I agree that
Reset is already split on
They are all safe in terms of concurrency because if you have competing clients, only one will succeed with the change, the rest will be returned a |
All that being said, I don't know if that refactor should be done on this PR. |
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.
Thanks for the quick fix @ereslibre !
I am fine with merging this now and do a refactoring later on.
@neolit123 @fabriziopandini, do you think we can remove the hold? |
/hold cancel |
What type of PR is this?
/kind bug
What this PR does / why we need it:
During the upgrade process,
kubeadm
will take the currentClusterConfiguration
, update theKubernetesVersion
to the latestversion, and call to
UploadConfig
.This change makes sure that when the mutation happens, not only the
ClusterStatus
is mutated, but theClusterConfiguration
objectinside the
kubeadm-config
ConfigMap as well; it will contain thenew
KubernetesVersion
.Which issue(s) this PR fixes:
Fixes kubernetes/kubeadm#1556
Special notes for your reviewer:
This is the straightforward fix with the least intrusive changes. However, I think the upgrade path could instead of calling to
UploadConfig
make explicit what it needs to mutate inside thekubeadm-config
ConfigMap (I think it's only theKubernetesVersion
inside theClusterConfiguration
object).This can be refactored later if desired, I think it would be better for the upgrade path to be explicit about what it mutates instead of blindly calling to
UploadConfig
.Does this PR introduce a user-facing change?:
/assign @fabriziopandini
/assign @rosti
/assign @neolit123