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
a7edbedc
Commit
a7edbedc
authored
Jun 08, 2015
by
krousey
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #9262 from bprashanth/minion_proxy
Apiserver can proxy to nodes
parents
ff1e0336
50eb9ad5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
19 deletions
+24
-19
server.go
cmd/kube-apiserver/app/server.go
+2
-1
server.go
pkg/kubelet/server.go
+5
-0
rest.go
pkg/registry/minion/rest.go
+17
-18
No files found.
cmd/kube-apiserver/app/server.go
View file @
a7edbedc
...
...
@@ -37,6 +37,7 @@ import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
"github.com/GoogleCloudPlatform/kubernetes/pkg/cloudprovider"
"github.com/GoogleCloudPlatform/kubernetes/pkg/master"
"github.com/GoogleCloudPlatform/kubernetes/pkg/master/ports"
"github.com/GoogleCloudPlatform/kubernetes/pkg/tools"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
forked
"github.com/GoogleCloudPlatform/kubernetes/third_party/forked/coreos/go-etcd/etcd"
...
...
@@ -121,7 +122,7 @@ func NewAPIServer() *APIServer {
RuntimeConfig
:
make
(
util
.
ConfigurationMap
),
KubeletConfig
:
client
.
KubeletConfig
{
Port
:
10250
,
Port
:
ports
.
KubeletPort
,
EnableHttps
:
true
,
HTTPTimeout
:
time
.
Duration
(
5
)
*
time
.
Second
,
},
...
...
pkg/kubelet/server.go
View file @
a7edbedc
...
...
@@ -24,6 +24,7 @@ import (
"io"
"net"
"net/http"
"net/http/pprof"
"net/url"
"path"
"strconv"
...
...
@@ -146,6 +147,10 @@ func (s *Server) InstallDebuggingHandlers() {
s
.
mux
.
HandleFunc
(
"/logs/"
,
s
.
handleLogs
)
s
.
mux
.
HandleFunc
(
"/containerLogs/"
,
s
.
handleContainerLogs
)
s
.
mux
.
Handle
(
"/metrics"
,
prometheus
.
Handler
())
s
.
mux
.
HandleFunc
(
"/debug/pprof/"
,
pprof
.
Index
)
s
.
mux
.
HandleFunc
(
"/debug/pprof/profile"
,
pprof
.
Profile
)
s
.
mux
.
HandleFunc
(
"/debug/pprof/symbol"
,
pprof
.
Symbol
)
}
// error serializes an error object into an HTTP response.
...
...
pkg/registry/minion/rest.go
View file @
a7edbedc
...
...
@@ -29,6 +29,7 @@ import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
"github.com/GoogleCloudPlatform/kubernetes/pkg/fields"
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
"github.com/GoogleCloudPlatform/kubernetes/pkg/master/ports"
"github.com/GoogleCloudPlatform/kubernetes/pkg/registry/generic"
"github.com/GoogleCloudPlatform/kubernetes/pkg/runtime"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
...
...
@@ -129,7 +130,7 @@ func MatchNode(label labels.Selector, field fields.Selector) generic.Matcher {
}
}
// ResourceLocation returns a
URL to which one can
send traffic for the specified node.
// ResourceLocation returns a
n URL and transport which one can use to
send traffic for the specified node.
func
ResourceLocation
(
getter
ResourceGetter
,
connection
client
.
ConnectionInfoGetter
,
ctx
api
.
Context
,
id
string
)
(
*
url
.
URL
,
http
.
RoundTripper
,
error
)
{
name
,
portReq
,
valid
:=
util
.
SplitPort
(
id
)
if
!
valid
{
...
...
@@ -143,22 +144,20 @@ func ResourceLocation(getter ResourceGetter, connection client.ConnectionInfoGet
node
:=
nodeObj
.
(
*
api
.
Node
)
host
:=
node
.
Name
// TODO: use node's IP, don't expect the name to resolve.
if
portReq
!=
""
{
return
&
url
.
URL
{
Host
:
net
.
JoinHostPort
(
host
,
portReq
)},
nil
,
nil
if
portReq
==
""
||
strconv
.
Itoa
(
ports
.
KubeletPort
)
==
portReq
{
scheme
,
port
,
transport
,
err
:=
connection
.
GetConnectionInfo
(
host
)
if
err
!=
nil
{
return
nil
,
nil
,
err
}
return
&
url
.
URL
{
Scheme
:
scheme
,
Host
:
net
.
JoinHostPort
(
host
,
strconv
.
FormatUint
(
uint64
(
port
),
10
),
),
},
transport
,
nil
}
scheme
,
port
,
transport
,
err
:=
connection
.
GetConnectionInfo
(
host
)
if
err
!=
nil
{
return
nil
,
nil
,
err
}
return
&
url
.
URL
{
Scheme
:
scheme
,
Host
:
net
.
JoinHostPort
(
host
,
strconv
.
FormatUint
(
uint64
(
port
),
10
),
),
},
transport
,
nil
return
&
url
.
URL
{
Host
:
net
.
JoinHostPort
(
host
,
portReq
)},
nil
,
nil
}
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