mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
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:
parent
f143ce01e9
commit
cae862dadf
@ -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 {
|
||||
|
@ -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",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user