-
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: UnifiedControlPlaneImage string -> UseHyperKubeImage bool #70793
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,8 +32,8 @@ func GetGenericImage(prefix, image, tag string) string { | |
|
||
// GetKubeControlPlaneImage generates and returns the image for the core Kubernetes components or returns the unified control plane image if specified | ||
func GetKubeControlPlaneImage(image string, cfg *kubeadmapi.ClusterConfiguration) string { | ||
if cfg.UnifiedControlPlaneImage != "" { | ||
return cfg.UnifiedControlPlaneImage | ||
if cfg.UseHyperKubeImage { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
image = constants.HyperKube | ||
} | ||
repoPrefix := cfg.GetControlPlaneImageRepository() | ||
kubernetesImageTag := kubeadmutil.KubernetesVersionToImageTag(cfg.KubernetesVersion) | ||
|
@@ -56,10 +56,16 @@ func GetEtcdImage(cfg *kubeadmapi.ClusterConfiguration) string { | |
// GetAllImages returns a list of container images kubeadm expects to use on a control plane node | ||
func GetAllImages(cfg *kubeadmapi.ClusterConfiguration) []string { | ||
imgs := []string{} | ||
imgs = append(imgs, GetKubeControlPlaneImage(constants.KubeAPIServer, cfg)) | ||
imgs = append(imgs, GetKubeControlPlaneImage(constants.KubeControllerManager, cfg)) | ||
imgs = append(imgs, GetKubeControlPlaneImage(constants.KubeScheduler, cfg)) | ||
imgs = append(imgs, GetKubeControlPlaneImage(constants.KubeProxy, cfg)) | ||
|
||
// start with core kubernetes images | ||
if cfg.UseHyperKubeImage { | ||
imgs = append(imgs, GetKubeControlPlaneImage(constants.HyperKube, cfg)) | ||
} else { | ||
imgs = append(imgs, GetKubeControlPlaneImage(constants.KubeAPIServer, cfg)) | ||
imgs = append(imgs, GetKubeControlPlaneImage(constants.KubeControllerManager, cfg)) | ||
imgs = append(imgs, GetKubeControlPlaneImage(constants.KubeScheduler, cfg)) | ||
imgs = append(imgs, GetKubeControlPlaneImage(constants.KubeProxy, cfg)) | ||
} | ||
|
||
// pause, etcd and kube-dns are not available on the ci image repository so use the default image repository. | ||
imgs = append(imgs, GetGenericImage(cfg.ImageRepository, "pause", constants.PauseVersion)) | ||
|
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.