mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-11 22:20:18 +00:00
Add a generic proxier
To proxy traffic to anything that implements ResourceLocation. Currently, this is only services. This is easily extensible to minions (would supercede existing mechanism) and pods.
This commit is contained in:
@@ -99,8 +99,10 @@ func (g *APIGroup) InstallREST(mux mux, paths ...string) {
|
||||
|
||||
for _, prefix := range paths {
|
||||
prefix = strings.TrimRight(prefix, "/")
|
||||
proxyHandler := &ProxyHandler{prefix + "/proxy/", g.handler.storage, g.handler.codec}
|
||||
mux.Handle(prefix+"/", http.StripPrefix(prefix, restHandler))
|
||||
mux.Handle(prefix+"/watch/", http.StripPrefix(prefix+"/watch/", watchHandler))
|
||||
mux.Handle(prefix+"/proxy/", http.StripPrefix(prefix+"/proxy/", proxyHandler))
|
||||
mux.Handle(prefix+"/redirect/", http.StripPrefix(prefix+"/redirect/", redirectHandler))
|
||||
mux.Handle(prefix+"/operations", http.StripPrefix(prefix+"/operations", opHandler))
|
||||
mux.Handle(prefix+"/operations/", http.StripPrefix(prefix+"/operations/", opHandler))
|
||||
|
Reference in New Issue
Block a user