Remove proxy-mode annotation from kube-proxy

This removes the net.experimental.kubernetes.io/proxy-mode and net.beta.kubernetes.io/proxy-mode annotations from kube-proxy.
This commit is contained in:
Christoph Blecker
2017-01-28 09:12:28 -08:00
parent eb8d34ba63
commit a9dfd254c7
5 changed files with 11 additions and 181 deletions

View File

@@ -72,10 +72,8 @@ type ProxyServer struct {
}
const (
proxyModeUserspace = "userspace"
proxyModeIPTables = "iptables"
experimentalProxyModeAnnotation = options.ExperimentalProxyModeAnnotation
betaProxyModeAnnotation = "net.beta.kubernetes.io/proxy-mode"
proxyModeUserspace = "userspace"
proxyModeIPTables = "iptables"
)
func checkKnownProxyMode(proxyMode string) bool {
@@ -425,34 +423,6 @@ func getProxyMode(proxyMode string, client nodeGetter, hostname string, iptver i
glog.Warningf("Flag proxy-mode=%q unknown, assuming iptables proxy", proxyMode)
return tryIPTablesProxy(iptver, kcompat)
}
// proxyMode == "" - choose the best option.
if client == nil {
glog.Errorf("nodeGetter is nil: assuming iptables proxy")
return tryIPTablesProxy(iptver, kcompat)
}
node, err := client.Get(hostname, metav1.GetOptions{})
if err != nil {
glog.Errorf("Can't get Node %q, assuming iptables proxy, err: %v", hostname, err)
return tryIPTablesProxy(iptver, kcompat)
}
if node == nil {
glog.Errorf("Got nil Node %q, assuming iptables proxy", hostname)
return tryIPTablesProxy(iptver, kcompat)
}
proxyMode, found := node.Annotations[betaProxyModeAnnotation]
if found {
glog.V(1).Infof("Found beta annotation %q = %q", betaProxyModeAnnotation, proxyMode)
} else {
// We already published some information about this annotation with the "experimental" name, so we will respect it.
proxyMode, found = node.Annotations[experimentalProxyModeAnnotation]
if found {
glog.V(1).Infof("Found experimental annotation %q = %q", experimentalProxyModeAnnotation, proxyMode)
}
}
if proxyMode == proxyModeUserspace {
glog.V(1).Infof("Annotation demands userspace proxy")
return proxyModeUserspace
}
return tryIPTablesProxy(iptver, kcompat)
}