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
f867ba3b
Commit
f867ba3b
authored
Sep 10, 2015
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #13682 from ryfow/block-startup-for-cert
Auto commit by PR queue bot
parents
c047f828
d22a29cf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
14 deletions
+15
-14
server.go
cmd/kube-apiserver/app/server.go
+15
-14
No files found.
cmd/kube-apiserver/app/server.go
View file @
f867ba3b
...
@@ -499,23 +499,24 @@ func (s *APIServer) Run(_ []string) error {
...
@@ -499,23 +499,24 @@ func (s *APIServer) Run(_ []string) error {
}
}
glog
.
Infof
(
"Serving securely on %s"
,
secureLocation
)
glog
.
Infof
(
"Serving securely on %s"
,
secureLocation
)
if
s
.
TLSCertFile
==
""
&&
s
.
TLSPrivateKeyFile
==
""
{
s
.
TLSCertFile
=
path
.
Join
(
s
.
CertDirectory
,
"apiserver.crt"
)
s
.
TLSPrivateKeyFile
=
path
.
Join
(
s
.
CertDirectory
,
"apiserver.key"
)
// TODO (cjcullen): Is PublicAddress the right address to sign a cert with?
alternateIPs
:=
[]
net
.
IP
{
config
.
ServiceReadWriteIP
}
alternateDNS
:=
[]
string
{
"kubernetes.default.svc"
,
"kubernetes.default"
,
"kubernetes"
}
// It would be nice to set a fqdn subject alt name, but only the kubelets know, the apiserver is clueless
// alternateDNS = append(alternateDNS, "kubernetes.default.svc.CLUSTER.DNS.NAME")
if
err
:=
util
.
GenerateSelfSignedCert
(
config
.
PublicAddress
.
String
(),
s
.
TLSCertFile
,
s
.
TLSPrivateKeyFile
,
alternateIPs
,
alternateDNS
);
err
!=
nil
{
glog
.
Errorf
(
"Unable to generate self signed cert: %v"
,
err
)
}
else
{
glog
.
Infof
(
"Using self-signed cert (%s, %s)"
,
s
.
TLSCertFile
,
s
.
TLSPrivateKeyFile
)
}
}
go
func
()
{
go
func
()
{
defer
util
.
HandleCrash
()
defer
util
.
HandleCrash
()
for
{
for
{
if
s
.
TLSCertFile
==
""
&&
s
.
TLSPrivateKeyFile
==
""
{
s
.
TLSCertFile
=
path
.
Join
(
s
.
CertDirectory
,
"apiserver.crt"
)
s
.
TLSPrivateKeyFile
=
path
.
Join
(
s
.
CertDirectory
,
"apiserver.key"
)
// TODO (cjcullen): Is PublicAddress the right address to sign a cert with?
alternateIPs
:=
[]
net
.
IP
{
config
.
ServiceReadWriteIP
}
alternateDNS
:=
[]
string
{
"kubernetes.default.svc"
,
"kubernetes.default"
,
"kubernetes"
}
// It would be nice to set a fqdn subject alt name, but only the kubelets know, the apiserver is clueless
// alternateDNS = append(alternateDNS, "kubernetes.default.svc.CLUSTER.DNS.NAME")
if
err
:=
util
.
GenerateSelfSignedCert
(
config
.
PublicAddress
.
String
(),
s
.
TLSCertFile
,
s
.
TLSPrivateKeyFile
,
alternateIPs
,
alternateDNS
);
err
!=
nil
{
glog
.
Errorf
(
"Unable to generate self signed cert: %v"
,
err
)
}
else
{
glog
.
Infof
(
"Using self-signed cert (%s, %s)"
,
s
.
TLSCertFile
,
s
.
TLSPrivateKeyFile
)
}
}
// err == systemd.SdNotifyNoSocket when not running on a systemd system
// err == systemd.SdNotifyNoSocket when not running on a systemd system
if
err
:=
systemd
.
SdNotify
(
"READY=1
\n
"
);
err
!=
nil
&&
err
!=
systemd
.
SdNotifyNoSocket
{
if
err
:=
systemd
.
SdNotify
(
"READY=1
\n
"
);
err
!=
nil
&&
err
!=
systemd
.
SdNotifyNoSocket
{
glog
.
Errorf
(
"Unable to send systemd daemon successful start message: %v
\n
"
,
err
)
glog
.
Errorf
(
"Unable to send systemd daemon successful start message: %v
\n
"
,
err
)
...
...
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