python: Unable to send a request to a service proxy
I’m trying to make a post request via the proxy API to a service without the k8s cluster without much luck. Found the below candidate API -
connect_post_namespaced_service_proxy
connect_post_namespaced_service_proxy_with_path
proxy_post_namespaced_service
proxy_post_namespaced_service_with_path
But was unable to attach a body (or extra headers to them):
- Can anyone point to examples or documentation on how to do this?
- What is the difference between the plain &
_with_pathAPIs (the documentation for bot?
connect_post_namespaced_service_proxy:
:param str path: Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy.
connect_post_namespaced_service_proxy_with_path:
:param str path2: Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy.
- What is the difference between the two sets of APIs?
connect_post_XXX
proxy_post_XXX
Thanks!
About this issue
- Original URL
- State: open
- Created 7 years ago
- Comments: 46 (7 by maintainers)
@jbyers19 as a workaround, you could use the ‘call_api’ method directly, sorta like:
I’m using the async python client, but this should work with the sync one too I’d guess.
/remove-lifecycle rotten
I believe those work the same. Kubernetes apiserver allows the request to specify the subpath that you want to connect to either through a query parameter or by directly composing the URL path. Those two APIs reflect the options that the openapi spec gives.
the
proxy_*methods are deprecated and removed, useconnect_*insteadthe upstream openapi spec needs to be fixed so that this client library can support writing body and additional headers. I will take a stab