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
364dd1a7
Commit
364dd1a7
authored
Sep 20, 2016
by
Davanum Srinivas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New command line flag - Set CA file for apiserver in-process client
parent
25d4a708
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
3 deletions
+12
-3
known-flags.txt
hack/verify-flags/known-flags.txt
+1
-0
server_run_options.go
pkg/genericapiserver/options/server_run_options.go
+11
-3
No files found.
hack/verify-flags/known-flags.txt
View file @
364dd1a7
...
@@ -504,6 +504,7 @@ tcp-services
...
@@ -504,6 +504,7 @@ tcp-services
terminated-pod-gc-threshold
terminated-pod-gc-threshold
test-flags
test-flags
test-timeout
test-timeout
tls-ca-file
tls-cert-file
tls-cert-file
tls-private-key-file
tls-private-key-file
to-version
to-version
...
...
pkg/genericapiserver/options/server_run_options.go
View file @
364dd1a7
...
@@ -17,6 +17,7 @@ limitations under the License.
...
@@ -17,6 +17,7 @@ limitations under the License.
package
options
package
options
import
(
import
(
"errors"
"net"
"net"
"strconv"
"strconv"
"strings"
"strings"
...
@@ -114,6 +115,7 @@ type ServerRunOptions struct {
...
@@ -114,6 +115,7 @@ type ServerRunOptions struct {
// for testing). This is not actually exposed as a flag.
// for testing). This is not actually exposed as a flag.
DefaultStorageVersions
string
DefaultStorageVersions
string
TargetRAMMB
int
TargetRAMMB
int
TLSCAFile
string
TLSCertFile
string
TLSCertFile
string
TLSPrivateKeyFile
string
TLSPrivateKeyFile
string
TokenAuthFile
string
TokenAuthFile
string
...
@@ -213,12 +215,14 @@ func (s *ServerRunOptions) NewSelfClient(token string) (clientset.Interface, err
...
@@ -213,12 +215,14 @@ func (s *ServerRunOptions) NewSelfClient(token string) (clientset.Interface, err
QPS
:
50
,
QPS
:
50
,
Burst
:
100
,
Burst
:
100
,
}
}
if
s
.
SecurePort
>
0
{
if
s
.
SecurePort
>
0
&&
len
(
s
.
TLSCAFile
)
>
0
{
clientConfig
.
Host
=
"https://"
+
net
.
JoinHostPort
(
s
.
BindAddress
.
String
(),
strconv
.
Itoa
(
s
.
SecurePort
))
clientConfig
.
Host
=
"https://"
+
net
.
JoinHostPort
(
s
.
BindAddress
.
String
(),
strconv
.
Itoa
(
s
.
SecurePort
))
clientConfig
.
Insecure
=
tru
e
clientConfig
.
CAFile
=
s
.
TLSCAFil
e
clientConfig
.
BearerToken
=
token
clientConfig
.
BearerToken
=
token
}
else
{
}
else
if
s
.
InsecurePort
>
0
{
clientConfig
.
Host
=
net
.
JoinHostPort
(
s
.
InsecureBindAddress
.
String
(),
strconv
.
Itoa
(
s
.
InsecurePort
))
clientConfig
.
Host
=
net
.
JoinHostPort
(
s
.
InsecureBindAddress
.
String
(),
strconv
.
Itoa
(
s
.
InsecurePort
))
}
else
{
return
nil
,
errors
.
New
(
"Unable to set url for apiserver local client"
)
}
}
return
clientset
.
NewForConfig
(
clientConfig
)
return
clientset
.
NewForConfig
(
clientConfig
)
...
@@ -445,6 +449,10 @@ func (s *ServerRunOptions) AddUniversalFlags(fs *pflag.FlagSet) {
...
@@ -445,6 +449,10 @@ func (s *ServerRunOptions) AddUniversalFlags(fs *pflag.FlagSet) {
"It defaults to a list of preferred versions of all registered groups, "
+
"It defaults to a list of preferred versions of all registered groups, "
+
"which is derived from the KUBE_API_VERSIONS environment variable."
)
"which is derived from the KUBE_API_VERSIONS environment variable."
)
fs
.
StringVar
(
&
s
.
TLSCAFile
,
"tls-ca-file"
,
s
.
TLSCAFile
,
"If set, this "
+
"certificate authority will used for secure access from Admission "
+
"Controllers. This must be a valid PEM-encoded CA bundle."
)
fs
.
StringVar
(
&
s
.
TLSCertFile
,
"tls-cert-file"
,
s
.
TLSCertFile
,
""
+
fs
.
StringVar
(
&
s
.
TLSCertFile
,
"tls-cert-file"
,
s
.
TLSCertFile
,
""
+
"File containing x509 Certificate for HTTPS. (CA cert, if any, concatenated "
+
"File containing x509 Certificate for HTTPS. (CA cert, if any, concatenated "
+
"after server cert). If HTTPS serving is enabled, and --tls-cert-file and "
+
"after server cert). If HTTPS serving is enabled, and --tls-cert-file and "
+
...
...
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