Skip to content

Commit

Permalink
Merge pull request kubernetes#123972 from deads2k/remove-insecure-ser…
Browse files Browse the repository at this point in the history
…ving

Remove k8s.io/apiserver ability to bind insecure ports
  • Loading branch information
k8s-ci-robot authored Apr 18, 2024
2 parents 7f67cb5 + de302c7 commit daa3356
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 136 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,18 @@ type Options struct {
ClientQPSLimit float32
ClientQPSBurst int

SecureServing apiserveroptions.SecureServingOptions
InsecureServing apiserveroptions.DeprecatedInsecureServingOptions
SecureServing apiserveroptions.SecureServingOptions
}

func NewOptions() *Options {
secureServing := apiserveroptions.NewSecureServingOptions()
secureServing.ServerCert.PairName = "webhook"
o := &Options{
SecureServing: *secureServing,
InsecureServing: apiserveroptions.DeprecatedInsecureServingOptions{},
ClientQPSLimit: DefaultClientQPSLimit,
ClientQPSBurst: DefaultClientQPSBurst,
SecureServing: *secureServing,
ClientQPSLimit: DefaultClientQPSLimit,
ClientQPSBurst: DefaultClientQPSBurst,
}
o.SecureServing.BindPort = DefaultPort
o.InsecureServing.BindPort = DefaultInsecurePort
return o
}

Expand All @@ -65,15 +62,13 @@ func (o *Options) AddFlags(fs *pflag.FlagSet) {
fs.IntVar(&o.ClientQPSBurst, "client-qps-burst", o.ClientQPSBurst, "Client QPS burst limit for throttling requests to the API server.")

o.SecureServing.AddFlags(fs)
o.InsecureServing.AddFlags(fs)
}

// Validate validates all the required options.
func (o *Options) Validate() []error {
var errs []error

errs = append(errs, o.SecureServing.Validate()...)
errs = append(errs, o.InsecureServing.Validate()...)

return errs
}
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@ func LoadConfig(opts *options.Options) (*Config, error) {

var c Config
opts.SecureServing.ApplyTo(&c.SecureServing)
opts.InsecureServing.ApplyTo(&c.InsecureServing)

// Load Kube Client
kubeConfig, err := clientcmd.BuildConfigFromFlags("", opts.Kubeconfig)
Expand Down

0 comments on commit daa3356

Please sign in to comment.