kubeadm: kube-proxy needs to know the pod subnet CIDR in order to understand what's internal and external traffic.

Fixes https://github.com/kubernetes/kubeadm/issues/102
This commit is contained in:
Paulo Pires 2017-01-04 20:32:27 +00:00
parent f143ce01e9
commit cae862dadf
No known key found for this signature in database
GPG Key ID: F3F6ED5C522EAA71
2 changed files with 9 additions and 2 deletions

View File

@ -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 {

View File

@ -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",
},
},
}