Skip to content

Commit 3d589bd

Browse files
committed
kube-proxy: internal config: remove PortRange
Remove PortRange for internal configuration of kube-proxy adhering to the v1alpha2 version specifications as detailed in https://kep.k8s.io/784. Signed-off-by: Daman Arora <[email protected]>
1 parent c57e115 commit 3d589bd

File tree

5 files changed

+1
-13
lines changed

5 files changed

+1
-13
lines changed

cmd/kube-proxy/app/options.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,6 @@ func (o *Options) AddFlags(fs *pflag.FlagSet) {
170170
_ = fs.MarkDeprecated("healthz-port", "This flag is deprecated and will be removed in a future release. Please use --healthz-bind-address instead.")
171171
fs.Int32Var(&o.metricsPort, "metrics-port", o.metricsPort, "The port to bind the metrics server. Use 0 to disable.")
172172
_ = fs.MarkDeprecated("metrics-port", "This flag is deprecated and will be removed in a future release. Please use --metrics-bind-address instead.")
173-
fs.Var(utilflag.PortRangeVar{Val: &o.config.PortRange}, "proxy-port-range", "This was previously used to configure the userspace proxy, but is now unused.")
174-
_ = fs.MarkDeprecated("proxy-port-range", "This flag has no effect and will be removed in a future release.")
175173

176174
logsapi.AddFlags(&o.config.Logging, fs)
177175
}

cmd/kube-proxy/app/options_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,6 @@ nodePortAddresses:
224224
},
225225
MetricsBindAddress: tc.metricsBindAddress,
226226
Mode: kubeproxyconfig.ProxyMode(tc.mode),
227-
PortRange: "2-7",
228227
NodePortAddresses: []string{"10.20.30.40/16", "fd00:1::0/64"},
229228
DetectLocalMode: kubeproxyconfig.LocalModeClusterCIDR,
230229
DetectLocal: kubeproxyconfig.DetectLocalConfiguration{

pkg/proxy/apis/config/types.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,6 @@ type KubeProxyConfiguration struct {
236236
// configSyncPeriod is how often configuration from the apiserver is refreshed. Must be greater
237237
// than 0.
238238
ConfigSyncPeriod metav1.Duration
239-
240-
// portRange was previously used to configure the userspace proxy, but is now unused.
241-
PortRange string
242239
}
243240

244241
// ProxyMode represents modes used by the Kubernetes proxy server.

pkg/proxy/apis/config/v1alpha1/zz_generated.conversion.go

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/proxy/apis/config/validation/validation.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import (
2323
"strconv"
2424
"strings"
2525

26-
utilnet "k8s.io/apimachinery/pkg/util/net"
2726
"k8s.io/apimachinery/pkg/util/sets"
2827
"k8s.io/apimachinery/pkg/util/validation/field"
2928
utilfeature "k8s.io/apiserver/pkg/util/feature"
@@ -80,10 +79,6 @@ func Validate(config *kubeproxyconfig.KubeProxyConfiguration) field.ErrorList {
8079
}
8180
allErrs = append(allErrs, validateHostPort(config.MetricsBindAddress, newPath.Child("MetricsBindAddress"))...)
8281

83-
if _, err := utilnet.ParsePortRange(config.PortRange); err != nil {
84-
allErrs = append(allErrs, field.Invalid(newPath.Child("PortRange"), config.PortRange, "must be a valid port range (e.g. 300-2000)"))
85-
}
86-
8782
allErrs = append(allErrs, validateKubeProxyNodePortAddress(config.NodePortAddresses, newPath.Child("NodePortAddresses"))...)
8883
allErrs = append(allErrs, validateShowHiddenMetricsVersion(config.ShowHiddenMetricsForVersion, newPath.Child("ShowHiddenMetricsForVersion"))...)
8984

0 commit comments

Comments
 (0)