mirror of https://github.com/kubernetes/kops.git
Merge pull request #545 from justinsb/kube_proxy_localhost
Point kube-proxy to localhost when running on master
This commit is contained in:
commit
b03793c972
|
@ -121,9 +121,7 @@ func (t *templateFunctions) populate(dest template.FuncMap) {
|
||||||
dest["KubeControllerManager"] = func() *api.KubeControllerManagerConfig {
|
dest["KubeControllerManager"] = func() *api.KubeControllerManagerConfig {
|
||||||
return t.cluster.Spec.KubeControllerManager
|
return t.cluster.Spec.KubeControllerManager
|
||||||
}
|
}
|
||||||
dest["KubeProxy"] = func() *api.KubeProxyConfig {
|
dest["KubeProxy"] = t.KubeProxyConfig
|
||||||
return t.cluster.Spec.KubeProxy
|
|
||||||
}
|
|
||||||
dest["KubeletConfig"] = func() *api.KubeletConfigSpec {
|
dest["KubeletConfig"] = func() *api.KubeletConfigSpec {
|
||||||
return t.kubeletConfig
|
return t.kubeletConfig
|
||||||
}
|
}
|
||||||
|
@ -222,3 +220,19 @@ func (t *templateFunctions) ProtokubeImage() string {
|
||||||
}
|
}
|
||||||
return image
|
return image
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// KubeProxyConfig builds the KubeProxyConfig configuration object
|
||||||
|
func (t *templateFunctions) KubeProxyConfig() *api.KubeProxyConfig {
|
||||||
|
config := &api.KubeProxyConfig{}
|
||||||
|
*config = *t.cluster.Spec.KubeProxy
|
||||||
|
|
||||||
|
// As a special case, if this is the master, we point kube-proxy to the local IP
|
||||||
|
// This prevents a circular dependency where kube-proxy can't come up until DNS comes up,
|
||||||
|
// which would mean that DNS can't rely on API to come up
|
||||||
|
if t.IsMaster() {
|
||||||
|
glog.Infof("kube-proxy running on the master; setting API endpoint to localhost")
|
||||||
|
config.Master = fi.String("http://127.0.0.1:8080")
|
||||||
|
}
|
||||||
|
|
||||||
|
return config
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue