diff --git a/cmd/kube-apiserver/app/options/options.go b/cmd/kube-apiserver/app/options/options.go index 544cb8f0aad..9e8e3e9d01f 100644 --- a/cmd/kube-apiserver/app/options/options.go +++ b/cmd/kube-apiserver/app/options/options.go @@ -125,7 +125,6 @@ func (s *ServerRunOptions) AddFlags(fs *pflag.FlagSet) { s.GenericServerRunOptions.AddUniversalFlags(fs) s.Etcd.AddFlags(fs) s.SecureServing.AddFlags(fs) - s.SecureServing.AddDeprecatedFlags(fs) s.InsecureServing.AddFlags(fs) s.InsecureServing.AddDeprecatedFlags(fs) s.Audit.AddFlags(fs) diff --git a/pkg/kubeapiserver/options/serving.go b/pkg/kubeapiserver/options/serving.go index 79e3f67500b..2b1ca82d91e 100644 --- a/pkg/kubeapiserver/options/serving.go +++ b/pkg/kubeapiserver/options/serving.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Package options contains flags and options for initializing an apiserver +// Package options contains flags and options for initializing kube-apiserver package options import ( @@ -31,7 +31,7 @@ import ( kubeserver "k8s.io/kubernetes/pkg/kubeapiserver/server" ) -// NewSecureServingOptions gives default values for the kube-apiserver and federation-apiserver which are not the options wanted by +// NewSecureServingOptions gives default values for the kube-apiserver which are not the options wanted by // "normal" API servers running on the platform func NewSecureServingOptions() *genericoptions.SecureServingOptions { return &genericoptions.SecureServingOptions{ @@ -56,8 +56,8 @@ func DefaultAdvertiseAddress(s *genericoptions.ServerRunOptions, insecure *Insec if s.AdvertiseAddress == nil || s.AdvertiseAddress.IsUnspecified() { hostIP, err := insecure.DefaultExternalAddress() if err != nil { - return fmt.Errorf("Unable to find suitable network address.error='%v'. "+ - "Try to set the AdvertiseAddress directly or provide a valid BindAddress to fix this.", err) + return fmt.Errorf("unable to find suitable network address.error='%v'. "+ + "Try to set the AdvertiseAddress directly or provide a valid BindAddress to fix this", err) } s.AdvertiseAddress = hostIP } @@ -85,7 +85,7 @@ func (s InsecureServingOptions) Validate(portArg string) []error { errors := []error{} if s.BindPort < 0 || s.BindPort > 65535 { - errors = append(errors, fmt.Errorf("--insecure-port %v must be between 0 and 65535, inclusive. 0 for turning off insecure (HTTP) port.", s.BindPort)) + errors = append(errors, fmt.Errorf("--insecure-port %v must be between 0 and 65535, inclusive. 0 for turning off insecure (HTTP) port", s.BindPort)) } return errors @@ -98,14 +98,17 @@ func (s *InsecureServingOptions) DefaultExternalAddress() (net.IP, error) { func (s *InsecureServingOptions) AddFlags(fs *pflag.FlagSet) { fs.IPVar(&s.BindAddress, "insecure-bind-address", s.BindAddress, ""+ "The IP address on which to serve the --insecure-port (set to 0.0.0.0 for all interfaces).") + fs.MarkDeprecated("insecure-bind-address", "This flag will be removed in a future version.") fs.IntVar(&s.BindPort, "insecure-port", s.BindPort, ""+ "The port on which to serve unsecured, unauthenticated access. It is assumed "+ "that firewall rules are set up such that this port is not reachable from outside of "+ "the cluster and that port 443 on the cluster's public address is proxied to this "+ - "port. This is performed by nginx in the default setup. Set to zero to disable") + "port. This is performed by nginx in the default setup. Set to zero to disable.") + fs.MarkDeprecated("insecure-port", "This flag will be removed in a future version.") } +// TODO: remove it until kops stop using `--address` func (s *InsecureServingOptions) AddDeprecatedFlags(fs *pflag.FlagSet) { fs.IPVar(&s.BindAddress, "address", s.BindAddress, "DEPRECATED: see --insecure-bind-address instead.") diff --git a/staging/src/k8s.io/apiserver/pkg/server/options/serving.go b/staging/src/k8s.io/apiserver/pkg/server/options/serving.go index 84fde93c7a5..edf2b02f5cf 100644 --- a/staging/src/k8s.io/apiserver/pkg/server/options/serving.go +++ b/staging/src/k8s.io/apiserver/pkg/server/options/serving.go @@ -98,7 +98,7 @@ func (s *SecureServingOptions) Validate() []error { errors := []error{} if s.BindPort < 0 || s.BindPort > 65535 { - errors = append(errors, fmt.Errorf("--secure-port %v must be between 0 and 65535, inclusive. 0 for turning off secure port.", s.BindPort)) + errors = append(errors, fmt.Errorf("--secure-port %v must be between 0 and 65535, inclusive. 0 for turning off secure port", s.BindPort)) } return errors @@ -155,12 +155,6 @@ func (s *SecureServingOptions) AddFlags(fs *pflag.FlagSet) { } -func (s *SecureServingOptions) AddDeprecatedFlags(fs *pflag.FlagSet) { - fs.IPVar(&s.BindAddress, "public-address-override", s.BindAddress, - "DEPRECATED: see --bind-address instead.") - fs.MarkDeprecated("public-address-override", "see --bind-address instead.") -} - // ApplyTo fills up serving information in the server configuration. func (s *SecureServingOptions) ApplyTo(c *server.Config) error { if s == nil {