I found it will failed if add the query to the request and the error is could not find the requested resource (get services hello:8080), the req url is https://10.233.20.51:6443/api/v1/namespaces/default/services/hello:8080/proxy/resources?kind=serviceentry&timeout=10s in fact. And after removing the query kind=serviceentry it will send successful.
I try to use kubectl proxy to transfer the request http://127.0.0.1:8001/api/v1/namespaces/default/services/hello:8080/proxy/resources\?kind\=serviceentry and it alse successful.
I want to send the traffic to my own service from
kube proxy
, like the code below:I found it will failed if add the query to the request and the error is
could not find the requested resource (get services hello:8080)
, the req url ishttps://10.233.20.51:6443/api/v1/namespaces/default/services/hello:8080/proxy/resources?kind=serviceentry&timeout=10s
in fact. And after removing the querykind=serviceentry
it will send successful.I try to use
kubectl proxy
to transfer the requesthttp://127.0.0.1:8001/api/v1/namespaces/default/services/hello:8080/proxy/resources\?kind\=serviceentry
and it alse successful.