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
0f9623d9
Commit
0f9623d9
authored
May 16, 2019
by
Tim Allclair
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid the default server mux
parent
40238163
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
12 deletions
+4
-12
server.go
cmd/kubelet/app/server.go
+3
-2
doc.go
staging/src/k8s.io/apiserver/pkg/server/healthz/doc.go
+1
-1
healthz.go
staging/src/k8s.io/apiserver/pkg/server/healthz/healthz.go
+0
-9
No files found.
cmd/kubelet/app/server.go
View file @
0f9623d9
...
@@ -708,9 +708,10 @@ func run(s *options.KubeletServer, kubeDeps *kubelet.Dependencies, stopCh <-chan
...
@@ -708,9 +708,10 @@ func run(s *options.KubeletServer, kubeDeps *kubelet.Dependencies, stopCh <-chan
}
}
if
s
.
HealthzPort
>
0
{
if
s
.
HealthzPort
>
0
{
healthz
.
DefaultHealthz
()
mux
:=
http
.
NewServeMux
()
healthz
.
InstallHandler
(
mux
)
go
wait
.
Until
(
func
()
{
go
wait
.
Until
(
func
()
{
err
:=
http
.
ListenAndServe
(
net
.
JoinHostPort
(
s
.
HealthzBindAddress
,
strconv
.
Itoa
(
int
(
s
.
HealthzPort
))),
nil
)
err
:=
http
.
ListenAndServe
(
net
.
JoinHostPort
(
s
.
HealthzBindAddress
,
strconv
.
Itoa
(
int
(
s
.
HealthzPort
))),
mux
)
if
err
!=
nil
{
if
err
!=
nil
{
klog
.
Errorf
(
"Starting health server failed: %v"
,
err
)
klog
.
Errorf
(
"Starting health server failed: %v"
,
err
)
}
}
...
...
staging/src/k8s.io/apiserver/pkg/server/healthz/doc.go
View file @
0f9623d9
...
@@ -17,5 +17,5 @@ limitations under the License.
...
@@ -17,5 +17,5 @@ limitations under the License.
// Package healthz implements basic http server health checking.
// Package healthz implements basic http server health checking.
// Usage:
// Usage:
// import "k8s.io/apiserver/pkg/server/healthz"
// import "k8s.io/apiserver/pkg/server/healthz"
// healthz.
DefaultHealthz(
)
// healthz.
InstallHandler(mux
)
package
healthz
// import "k8s.io/apiserver/pkg/server/healthz"
package
healthz
// import "k8s.io/apiserver/pkg/server/healthz"
staging/src/k8s.io/apiserver/pkg/server/healthz/healthz.go
View file @
0f9623d9
...
@@ -37,15 +37,6 @@ type HealthzChecker interface {
...
@@ -37,15 +37,6 @@ type HealthzChecker interface {
Check
(
req
*
http
.
Request
)
error
Check
(
req
*
http
.
Request
)
error
}
}
var
defaultHealthz
=
sync
.
Once
{}
// DefaultHealthz installs the default healthz check to the http.DefaultServeMux.
func
DefaultHealthz
(
checks
...
HealthzChecker
)
{
defaultHealthz
.
Do
(
func
()
{
InstallHandler
(
http
.
DefaultServeMux
,
checks
...
)
})
}
// PingHealthz returns true automatically when checked
// PingHealthz returns true automatically when checked
var
PingHealthz
HealthzChecker
=
ping
{}
var
PingHealthz
HealthzChecker
=
ping
{}
...
...
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