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

calico needs kubelet config —network-config=cni #3128

Merged
merged 1 commit into from
May 31, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"])
}
}