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
a602ae77
Unverified
Commit
a602ae77
authored
Oct 08, 2016
by
Jordan Liggitt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move kubelet api paths to constants
parent
426caf5b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
6 deletions
+13
-6
server.go
pkg/kubelet/server/server.go
+11
-4
handler.go
pkg/kubelet/server/stats/handler.go
+2
-2
No files found.
pkg/kubelet/server/server.go
View file @
a602ae77
...
@@ -62,6 +62,13 @@ import (
...
@@ -62,6 +62,13 @@ import (
"k8s.io/kubernetes/pkg/volume"
"k8s.io/kubernetes/pkg/volume"
)
)
const
(
metricsPath
=
"/metrics"
specPath
=
"/spec/"
statsPath
=
"/stats/"
logsPath
=
"/logs/"
)
// Server is a http.Handler which exposes kubelet functionality over HTTP.
// Server is a http.Handler which exposes kubelet functionality over HTTP.
type
Server
struct
{
type
Server
struct
{
auth
AuthInterface
auth
AuthInterface
...
@@ -258,12 +265,12 @@ func (s *Server) InstallDefaultHandlers() {
...
@@ -258,12 +265,12 @@ func (s *Server) InstallDefaultHandlers() {
Operation
(
"getPods"
))
Operation
(
"getPods"
))
s
.
restfulCont
.
Add
(
ws
)
s
.
restfulCont
.
Add
(
ws
)
s
.
restfulCont
.
Add
(
stats
.
CreateHandlers
(
s
.
host
,
s
.
resourceAnalyzer
))
s
.
restfulCont
.
Add
(
stats
.
CreateHandlers
(
s
tatsPath
,
s
.
host
,
s
.
resourceAnalyzer
))
s
.
restfulCont
.
Handle
(
"/metrics"
,
prometheus
.
Handler
())
s
.
restfulCont
.
Handle
(
metricsPath
,
prometheus
.
Handler
())
ws
=
new
(
restful
.
WebService
)
ws
=
new
(
restful
.
WebService
)
ws
.
ws
.
Path
(
"/spec/"
)
.
Path
(
specPath
)
.
Produces
(
restful
.
MIME_JSON
)
Produces
(
restful
.
MIME_JSON
)
ws
.
Route
(
ws
.
GET
(
""
)
.
ws
.
Route
(
ws
.
GET
(
""
)
.
To
(
s
.
getSpec
)
.
To
(
s
.
getSpec
)
.
...
@@ -336,7 +343,7 @@ func (s *Server) InstallDebuggingHandlers() {
...
@@ -336,7 +343,7 @@ func (s *Server) InstallDebuggingHandlers() {
ws
=
new
(
restful
.
WebService
)
ws
=
new
(
restful
.
WebService
)
ws
.
ws
.
Path
(
"/logs/"
)
Path
(
logsPath
)
ws
.
Route
(
ws
.
GET
(
""
)
.
ws
.
Route
(
ws
.
GET
(
""
)
.
To
(
s
.
getLogs
)
.
To
(
s
.
getLogs
)
.
Operation
(
"getLogs"
))
Operation
(
"getLogs"
))
...
...
pkg/kubelet/server/stats/handler.go
View file @
a602ae77
...
@@ -55,11 +55,11 @@ type handler struct {
...
@@ -55,11 +55,11 @@ type handler struct {
summaryProvider
SummaryProvider
summaryProvider
SummaryProvider
}
}
func
CreateHandlers
(
provider
StatsProvider
,
summaryProvider
SummaryProvider
)
*
restful
.
WebService
{
func
CreateHandlers
(
rootPath
string
,
provider
StatsProvider
,
summaryProvider
SummaryProvider
)
*
restful
.
WebService
{
h
:=
&
handler
{
provider
,
summaryProvider
}
h
:=
&
handler
{
provider
,
summaryProvider
}
ws
:=
&
restful
.
WebService
{}
ws
:=
&
restful
.
WebService
{}
ws
.
Path
(
"/stats/"
)
.
ws
.
Path
(
rootPath
)
.
Produces
(
restful
.
MIME_JSON
)
Produces
(
restful
.
MIME_JSON
)
endpoints
:=
[]
struct
{
endpoints
:=
[]
struct
{
...
...
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