Hide Forgot
Description of problem: After I create a hello-openshift app via `oc new-app openshift/hello-openshift:latest --name=hello-openshift`, got "no endpoints available for service \"hello-openshift\"" when try to access the "/api/v1/namespaces/<namespace name>/services/<service name>/proxy/" with bearer token. And the pod/proxy work well # curl -k https://127.0.0.1:8443/api/v1/namespaces/wjiang/pods/hello-openshift-1-we1f4/proxy/ Hello OpenShift! # oc get endpoints NAME ENDPOINTS AGE hello-openshift 172.17.0.5:8080,172.17.0.5:8888 12m Version-Release number of selected component (if applicable): devenv-rhel7_4020 How reproducible: always Steps to Reproduce: 1. Create an app oc new-app openshift/hello-openshift:latest --name=hello-openshift 2. Grant admin role to system:anonymouns user oc policy add-role-to-user admin system:anonymouns 3. Try to curl the api curl -k https://<master host>:8443/api/v1/namespaces/<namespace name>/services/<service name>/proxy/ Actual results: # curl -k https://127.0.0.1:8443/api/v1/namespaces/wjiang/services/hello-openshift/proxy/ { "kind": "Status", "apiVersion": "v1", "metadata": {}, "status": "Failure", "message": "no endpoints available for service \"hello-openshift\"", "reason": "ServiceUnavailable", "code": 503 } Expected results: Hello OpenShift! Additional info:
The hello-openshift app's service is set up to serve on port 8080. Ergo, you'd need the following url to properly proxy to it: http://localhost:8443/api/v1/namespaces/proxy-test/services/http:hello-openshift:8080/proxy/
{(In reply to Solly Ross from comment #1) > The hello-openshift app's service is set up to serve on port 8080. Ergo, > you'd need the following url to properly proxy to it: > > http://localhost:8443/api/v1/namespaces/proxy-test/services/http:hello- > openshift:8080/proxy/ Checked with devenv-rhel7_4026, the works well with the api entry. But then we have to update the swaggerapi doc, since I use the api according to the doc, it said that the parameter is the "name of the Service", and even the kubernetes official doc http://kubernetes.io/docs/api-reference/v1/operations/ { "path": "/api/v1/namespaces/{namespace}/services/{name}/proxy", "description": "API at /api/v1", "operations": [ { "type": "string", "method": "GET", "summary": "connect GET requests to proxy of Service", "nickname": "connectGetNamespacedServiceProxy", "parameters": [ { "type": "string", "paramType": "query", "name": "path", "description": "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.", "required": false, "allowMultiple": false }, { "type": "string", "paramType": "path", "name": "namespace", "description": "object name and auth scope, such as for teams and projects", "required": true, "allowMultiple": false }, { "type": "string", "paramType": "path", "name": "name", "description": "name of the Service", "required": true, "allowMultiple": false } ], "produces": [ "*/*" ], "consumes": [ "*/*" ] },
Please mark this VERIFIED and open a new bug for the Swagger issue
(In reply to Andy Goldstein from comment #3) > Please mark this VERIFIED and open a new bug for the Swagger issue Ok, will draft a new bug for the swagger issue.