Skip to content

Commit

Permalink
kubeadm: Make kube-proxy tolerate the uninitialized cloud taint
Browse files Browse the repository at this point in the history
  • Loading branch information
luxas committed Jul 17, 2017
1 parent 1170b7c commit d0ab597
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions cmd/kubeadm/app/phases/addons/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ go_library(
"//cmd/kubeadm/app/images:go_default_library",
"//cmd/kubeadm/app/util:go_default_library",
"//pkg/api:go_default_library",
"//plugin/pkg/scheduler/algorithm:go_default_library",
"//vendor/k8s.io/api/core/v1:go_default_library",
"//vendor/k8s.io/api/extensions/v1beta1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library",
Expand Down
4 changes: 3 additions & 1 deletion cmd/kubeadm/app/phases/addons/addons.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import (
"k8s.io/kubernetes/cmd/kubeadm/app/images"
kubeadmutil "k8s.io/kubernetes/cmd/kubeadm/app/util"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/plugin/pkg/scheduler/algorithm"
)

// CreateEssentialAddons creates the kube-proxy and kube-dns addons
Expand All @@ -44,10 +45,11 @@ func CreateEssentialAddons(cfg *kubeadmapi.MasterConfiguration, client *clientse
return fmt.Errorf("error when parsing kube-proxy configmap template: %v", err)
}

proxyDaemonSetBytes, err := kubeadmutil.ParseTemplate(KubeProxyDaemonSet, struct{ Image, ClusterCIDR, MasterTaintKey string }{
proxyDaemonSetBytes, err := kubeadmutil.ParseTemplate(KubeProxyDaemonSet, struct{ Image, ClusterCIDR, MasterTaintKey, CloudTaintKey string }{
Image: images.GetCoreImage("proxy", cfg, cfg.UnifiedControlPlaneImage),
ClusterCIDR: getClusterCIDR(cfg.Networking.PodSubnet),
MasterTaintKey: kubeadmconstants.LabelNodeRoleMaster,
CloudTaintKey: algorithm.TaintExternalCloudProvider,
})
if err != nil {
return fmt.Errorf("error when parsing kube-proxy daemonset template: %v", err)
Expand Down
3 changes: 2 additions & 1 deletion cmd/kubeadm/app/phases/addons/addons_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,11 @@ func TestCompileManifests(t *testing.T) {
},
{
manifest: KubeProxyDaemonSet,
data: struct{ Image, ClusterCIDR, MasterTaintKey string }{
data: struct{ Image, ClusterCIDR, MasterTaintKey, CloudTaintKey string }{
Image: "foo",
ClusterCIDR: "foo",
MasterTaintKey: "foo",
CloudTaintKey: "foo",
},
expected: true,
},
Expand Down
3 changes: 3 additions & 0 deletions cmd/kubeadm/app/phases/addons/manifests.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ spec:
tolerations:
- key: {{ .MasterTaintKey }}
effect: NoSchedule
- key: {{ .CloudTaintKey }}
value: "true"
effect: NoSchedule
volumes:
- name: kube-proxy
configMap:
Expand Down

0 comments on commit d0ab597

Please sign in to comment.