Skip to content
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: Fix the nodeSelector and scheduler mounts when using the self-hosted mode #42530

Merged
merged 1 commit into from
Mar 4, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 8 additions & 5 deletions cmd/kubeadm/app/master/selfhosted.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func launchSelfHostedControllerManager(cfg *kubeadmapi.MasterConfiguration, clie

func launchSelfHostedScheduler(cfg *kubeadmapi.MasterConfiguration, client *clientset.Clientset, volumes []v1.Volume, volumeMounts []v1.VolumeMount) error {
start := time.Now()
scheduler := getSchedulerDeployment(cfg)
scheduler := getSchedulerDeployment(cfg, volumes, volumeMounts)
if _, err := client.Extensions().Deployments(metav1.NamespaceSystem).Create(&scheduler); err != nil {
return fmt.Errorf("failed to create self-hosted %q deployment [%v]", kubeScheduler, err)
}
Expand Down Expand Up @@ -204,7 +204,7 @@ func getAPIServerDS(cfg *kubeadmapi.MasterConfiguration, volumes []v1.Volume, vo
},
},
Spec: v1.PodSpec{
NodeSelector: map[string]string{metav1.NodeLabelKubeadmAlphaRole: metav1.NodeLabelRoleMaster},
NodeSelector: map[string]string{kubeadmconstants.LabelNodeRoleMaster: ""},
HostNetwork: true,
Volumes: volumes,
Containers: []v1.Container{
Expand Down Expand Up @@ -255,7 +255,7 @@ func getControllerManagerDeployment(cfg *kubeadmapi.MasterConfiguration, volumes
},
},
Spec: v1.PodSpec{
NodeSelector: map[string]string{metav1.NodeLabelKubeadmAlphaRole: metav1.NodeLabelRoleMaster},
NodeSelector: map[string]string{kubeadmconstants.LabelNodeRoleMaster: ""},
HostNetwork: true,
Volumes: volumes,
Containers: []v1.Container{
Expand All @@ -278,7 +278,7 @@ func getControllerManagerDeployment(cfg *kubeadmapi.MasterConfiguration, volumes
return d
}

func getSchedulerDeployment(cfg *kubeadmapi.MasterConfiguration) ext.Deployment {
func getSchedulerDeployment(cfg *kubeadmapi.MasterConfiguration, volumes []v1.Volume, volumeMounts []v1.VolumeMount) ext.Deployment {
d := ext.Deployment{
TypeMeta: metav1.TypeMeta{
APIVersion: "extensions/v1beta1",
Expand Down Expand Up @@ -307,13 +307,15 @@ func getSchedulerDeployment(cfg *kubeadmapi.MasterConfiguration) ext.Deployment
},
},
Spec: v1.PodSpec{
NodeSelector: map[string]string{metav1.NodeLabelKubeadmAlphaRole: metav1.NodeLabelRoleMaster},
NodeSelector: map[string]string{kubeadmconstants.LabelNodeRoleMaster: ""},
HostNetwork: true,
Volumes: volumes,
Containers: []v1.Container{
{
Name: "self-hosted-" + kubeScheduler,
Image: images.GetCoreImage(images.KubeSchedulerImage, cfg, kubeadmapi.GlobalEnvParams.HyperkubeImage),
Command: getSchedulerCommand(cfg, true),
VolumeMounts: volumeMounts,
LivenessProbe: componentProbe(10251, "/healthz", v1.URISchemeHTTP),
Resources: componentResources("100m"),
Env: getProxyEnvVars(),
Expand All @@ -324,6 +326,7 @@ func getSchedulerDeployment(cfg *kubeadmapi.MasterConfiguration) ext.Deployment
},
},
}

return d
}

Expand Down