Skip to content

Commit

Permalink
kubeadm: kube-proxy needs to know the pod subnet CIDR in order to und…
Browse files Browse the repository at this point in the history
…erstand what's internal and external traffic.

Fixes kubernetes/kubeadm#102
  • Loading branch information
pires committed Jan 4, 2017
1 parent f143ce0 commit cae862d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 3 additions & 1 deletion cmd/kubeadm/app/master/manifests.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,9 @@ func getSchedulerCommand(cfg *kubeadmapi.MasterConfiguration) []string {
}

func getProxyCommand(cfg *kubeadmapi.MasterConfiguration) []string {
return getComponentBaseCommand(proxy)
return append(getComponentBaseCommand(proxy),
"--cluster-cidr="+cfg.Networking.PodSubnet,
)
}

func getProxyEnvVars() []api.EnvVar {
Expand Down
7 changes: 6 additions & 1 deletion cmd/kubeadm/app/master/manifests_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -572,9 +572,14 @@ func TestGetProxyCommand(t *testing.T) {
expected []string
}{
{
cfg: &kubeadmapi.MasterConfiguration{},
cfg: &kubeadmapi.MasterConfiguration{
Networking: kubeadm.Networking{
PodSubnet: "bar",
},
},
expected: []string{
"kube-proxy",
"--cluster-cidr=bar",
},
},
}
Expand Down

0 comments on commit cae862d

Please sign in to comment.