Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
24c687fd
Commit
24c687fd
authored
Jan 30, 2018
by
hzxuzhonghu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
deprecate insecure http flags and remove already deprecated public-address-override
parent
9fa96264
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
14 deletions
+10
-14
options.go
cmd/kube-apiserver/app/options/options.go
+0
-1
serving.go
pkg/kubeapiserver/options/serving.go
+9
-6
serving.go
staging/src/k8s.io/apiserver/pkg/server/options/serving.go
+1
-7
No files found.
cmd/kube-apiserver/app/options/options.go
View file @
24c687fd
...
...
@@ -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
)
...
...
pkg/kubeapiserver/options/serving.go
View file @
24c687fd
...
...
@@ -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
(
"
U
nable 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
(
"
u
nable 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."
)
...
...
staging/src/k8s.io/apiserver/pkg/server/options/serving.go
View file @
24c687fd
...
...
@@ -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
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment