-
Notifications
You must be signed in to change notification settings - Fork 39.8k
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: UnifiedControlPlaneImage string -> UseHyperKubeImage bool #70793
Conversation
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 @rosti
/priority important-soon
// used for all control plane components. | ||
UnifiedControlPlaneImage string | ||
// UseHyperKubeImage controls if hyperkube should be used for Kubernetes components instead of their respective separate images | ||
UseHyperKubeImage bool |
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.
someone might decide to build a custom "unified control plane" image that is not called hyperkube.
in such a case they would have to name it "hyperkube" for kubeadm to be able to work with it.
this at least solves upgrade issues for us...
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.
If some users override this with their own image, then it should be based on hyperkube. Hence tagging it appropriately and setting it up on their own repository is the way to go.
Definitely we should not allow users to put whatever image they see fit in here and the bool value is the best solution for me.
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.
@rosti well done!
Only one small point to be addressed, then ready to go for me
@@ -103,6 +108,14 @@ func Convert_v1alpha3_ClusterConfiguration_To_kubeadm_ClusterConfiguration(in *C | |||
return err | |||
} | |||
|
|||
if len(in.UnifiedControlPlaneImage) == 0 { | |||
out.UseHyperKubeImage = false | |||
} else if strings.Contains(in.UnifiedControlPlaneImage, "/hyperkube:") { |
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.
This check is weak and can lead to unsupported behaviours:
What if the user is using a custom image repository? This will get switched to a different image repository
Same questions about image tag
However, from the other side I don't think we should make this check too complex, so I will be fine with whatever check we agree upon
@neolit123 @timothysc opinions?
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.
the string "hypercube" has to be moved to constants.go.
the tag and repo conversation might be a bit too much, i think it's OK to have it like that.
we can also show a warning here too, right?
Added |
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
thanks for the update.
return nil | ||
} | ||
|
||
if strings.Contains(in.UnifiedControlPlaneImage, "/"+constants.HyperKube+":") { |
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.
TBH I don't think this should be here. I think you should hard fail and force the user to adjust their config.
cmd/kubeadm/app/images/images.go
Outdated
|
||
// start with core kubernetes images | ||
if cfg.UseHyperKubeImage { | ||
imgs = append(imgs, GetKubeControlPlaneImage("", cfg)) |
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.
Why wouldn't this be the const for the hyperkube image?
if cfg.UnifiedControlPlaneImage != "" { | ||
return cfg.UnifiedControlPlaneImage | ||
actualImage := image | ||
if cfg.UseHyperKubeImage { |
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.
If you change the line below I don't think this is necessary
Up until now UnifiedControlPlaneImage existed as a string value as part of the ClusterConfiguration. This provided an override for the Kubernetes core component images with a single custom image. It is mostly used to override the control plane images with the hyperkube image. This saves both bandwith and disk space on the control plane nodes. Unfortunately, this specified an entire image string (complete with its prefix, image name and tag). This disables upgrades of setups that use hyperkube. Therefore, to enable upgrades on hyperkube setups and to make configuration more convenient, the UnifiedControlPlaneImage option is replaced with a boolean option, called UseHyperKubeImage. If set to true, this option replaces the image name of any Kubernetes core components with hyperkube, thus allowing for upgrades and respecting the image repository and version, specified in the ClusterConfiguration. Signed-off-by: Rostislav M. Georgiev <[email protected]>
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.
/approve
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rosti, timothysc 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 |
/test pull-kubernetes-verify |
Always use CoreDNS and remove the feature gate from config. Add workaround for `unifiedControlPlaneImage` removal kubernetes/kubernetes#70793 Fixes kubernetes-retired#250
Always use CoreDNS and remove the feature gate from config. Add workaround for `unifiedControlPlaneImage` removal kubernetes/kubernetes#70793 Fixes kubernetes-retired#250
Always use CoreDNS and remove the feature gate from config. Add workaround for `unifiedControlPlaneImage` removal kubernetes/kubernetes#70793 Fixes kubernetes-retired#250
What type of PR is this?
/kind api-change
What this PR does / why we need it:
Up until now
UnifiedControlPlaneImage
existed as a string value as part of theClusterConfiguration
. This provided an override for the Kubernetes core component images with a single custom image. It is mostly used to override the control plane images with thehyperkube
image. This saves both bandwidth and disk space on the control plane nodes.Unfortunately, this specified an entire image string (complete with its prefix, image name and tag). This disables upgrades of setups that use
hyperkube
.Therefore, to enable upgrades on
hyperkube
setups and to make configuration more convenient, theUnifiedControlPlaneImage
option is replaced with a boolean option, calledUseHyperKubeImage
. If set to true, this option replaces the image name of any Kubernetes core components withhyperkube
, thus allowing for upgrades and respecting the image repository and version, specified in theClusterConfiguration
.Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Refs kubernetes/kubeadm#911
Special notes for your reviewer:
/cc @kubernetes/sig-cluster-lifecycle-pr-reviews
/area kubeadm
/assign @fabriziopandini
/assign @timothysc
/assign @luxas
Does this PR introduce a user-facing change?: