mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 07:20:13 +00:00
Add beta annotation for kube-proxy
This commit is contained in:
parent
b9c7cf43b2
commit
4a2e64d3eb
@ -98,6 +98,7 @@ const (
|
||||
proxyModeUserspace = "userspace"
|
||||
proxyModeIptables = "iptables"
|
||||
experimentalProxyModeAnnotation = "net.experimental.kubernetes.io/proxy-mode"
|
||||
betaProxyModeAnnotation = "net.beta.kubernetes.io/proxy-mode"
|
||||
)
|
||||
|
||||
func checkKnownProxyMode(proxyMode string) bool {
|
||||
@ -327,9 +328,15 @@ func mayTryIptablesProxy(proxyMode string, client nodeGetter, hostname string) b
|
||||
glog.Errorf("Not trying iptables proxy: got nil Node %q", hostname)
|
||||
return false
|
||||
}
|
||||
proxyMode, found := node.Annotations[experimentalProxyModeAnnotation]
|
||||
proxyMode, found := node.Annotations[betaProxyModeAnnotation]
|
||||
if found {
|
||||
glog.V(1).Infof("Found experimental annotation %q = %q", experimentalProxyModeAnnotation, proxyMode)
|
||||
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 == proxyModeIptables {
|
||||
glog.V(1).Infof("Annotation allows iptables proxy")
|
||||
|
@ -45,11 +45,19 @@ func Test_mayTryIptablesProxy(t *testing.T) {
|
||||
{"", "net.experimental.kubernetes.io/proxy-mode", "iptables", true},
|
||||
{"", "net.experimental.kubernetes.io/proxy-mode", "other", false},
|
||||
{"", "net.experimental.kubernetes.io/proxy-mode", "", false},
|
||||
{"", "net.beta.kubernetes.io/proxy-mode", "userspace", false},
|
||||
{"", "net.beta.kubernetes.io/proxy-mode", "iptables", true},
|
||||
{"", "net.beta.kubernetes.io/proxy-mode", "other", false},
|
||||
{"", "net.beta.kubernetes.io/proxy-mode", "", false},
|
||||
{"", "proxy-mode", "iptables", false},
|
||||
{"userspace", "net.experimental.kubernetes.io/proxy-mode", "userspace", false},
|
||||
{"userspace", "net.experimental.kubernetes.io/proxy-mode", "iptables", false},
|
||||
{"iptables", "net.experimental.kubernetes.io/proxy-mode", "userspace", true},
|
||||
{"iptables", "net.experimental.kubernetes.io/proxy-mode", "iptables", true},
|
||||
{"userspace", "net.beta.kubernetes.io/proxy-mode", "userspace", false},
|
||||
{"userspace", "net.beta.kubernetes.io/proxy-mode", "iptables", false},
|
||||
{"iptables", "net.beta.kubernetes.io/proxy-mode", "userspace", true},
|
||||
{"iptables", "net.beta.kubernetes.io/proxy-mode", "iptables", true},
|
||||
}
|
||||
for i, c := range cases {
|
||||
getter := &fakeNodeInterface{}
|
||||
|
Loading…
Reference in New Issue
Block a user