Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
calico needs kubelet config —network-config=cni (#3128)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackfrancis authored May 31, 2018
1 parent ac2b4bf commit 962dcc1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/acsengine/defaults-kubelet.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ func setKubeletConfig(cs *api.ContainerService) {

// Override default --network-plugin?
if o.KubernetesConfig.NetworkPlugin == NetworkPluginKubenet {
o.KubernetesConfig.KubeletConfig["--network-plugin"] = NetworkPluginKubenet
if o.KubernetesConfig.NetworkPolicy != NetworkPolicyCalico {
o.KubernetesConfig.KubeletConfig["--network-plugin"] = NetworkPluginKubenet
}
o.KubernetesConfig.KubeletConfig["--max-pods"] = strconv.Itoa(DefaultKubernetesMaxPods)
}

Expand Down
11 changes: 11 additions & 0 deletions pkg/acsengine/defaults-kubelet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,14 @@ func TestKubeletMaxPods(t *testing.T) {
NetworkPluginKubenet, k["--max-pods"])
}
}

func TestKubeletCalico(t *testing.T) {
cs := createContainerService("testcluster", defaultTestClusterVer, 3, 2)
cs.Properties.OrchestratorProfile.KubernetesConfig.NetworkPolicy = NetworkPolicyCalico
setKubeletConfig(cs)
k := cs.Properties.OrchestratorProfile.KubernetesConfig.KubeletConfig
if k["--network-plugin"] != "cni" {
t.Fatalf("got unexpected '--network-plugin' kubelet config value for NetworkPolicy=%s: %s",
NetworkPolicyCalico, k["--network-plugin"])
}
}

0 comments on commit 962dcc1

Please sign in to comment.