mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 23:17:50 +00:00
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:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user