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
2cc51009
Unverified
Commit
2cc51009
authored
Jul 02, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
Jul 02, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #79182 from tallclair/automated-cherry-pick-of-#78313-upstream-release-1.14
Automated cherry pick of #78313: Avoid the default server mux
parents
c5a761cc
0f9623d9
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 @
2cc51009
...
...
@@ -708,9 +708,10 @@ func run(s *options.KubeletServer, kubeDeps *kubelet.Dependencies, stopCh <-chan
}
if
s
.
HealthzPort
>
0
{
healthz
.
DefaultHealthz
()
mux
:=
http
.
NewServeMux
()
healthz
.
InstallHandler
(
mux
)
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
{
klog
.
Errorf
(
"Starting health server failed: %v"
,
err
)
}
...
...
staging/src/k8s.io/apiserver/pkg/server/healthz/doc.go
View file @
2cc51009
...
...
@@ -17,5 +17,5 @@ limitations under the License.
// Package healthz implements basic http server health checking.
// Usage:
// import "k8s.io/apiserver/pkg/server/healthz"
// healthz.
DefaultHealthz(
)
// healthz.
InstallHandler(mux
)
package
healthz
// import "k8s.io/apiserver/pkg/server/healthz"
staging/src/k8s.io/apiserver/pkg/server/healthz/healthz.go
View file @
2cc51009
...
...
@@ -37,15 +37,6 @@ type HealthzChecker interface {
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
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