Bug 1270492 - [fork][platformmanagement_522] Can not access the services via API proxy for example sample-app
[fork][platformmanagement_522] Can not access the services via API proxy for ...
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Kubernetes (Show other bugs)
3.x
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Jordan Liggitt
Jianwei Hou
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-10-10 06:57 EDT by weiwei jiang
Modified: 2016-10-30 18:54 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-11-23 16:15:31 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description weiwei jiang 2015-10-10 06:57:53 EDT
Description of problem:
When try to access the frontend service via api proxy for 
examples/sample-app/application-template-stibuild.json template, got 503

# curl -k -H "Authorization:Bearer rKcVgAatuoZxrLKPFuiirTY23ExDFMOeyBvne_GE1y0" https://127.0.0.1:8443/api/v1/proxy/namespaces/default/services/http:frontend:5432-tcp/                                                                                                                                                 
{
  "kind": "Status",
  "apiVersion": "v1",
  "metadata": {},
  "status": "Failure",
  "message": "no endpoints available for service \"http:frontend:5432-tcp\"",
  "reason": "ServiceUnavailable",
  "code": 503
}

# curl -k -H "Authorization:Bearer rKcVgAatuoZxrLKPFuiirTY23ExDFMOeyBvne_GE1y0" https://127.0.0.1:8443/api/v1/proxy/namespaces/default/services/
https:frontend:5432-tcp/
{
  "kind": "Status",
  "apiVersion": "v1",
  "metadata": {},
  "status": "Failure",
  "message": "no endpoints available for service \"https:frontend:5432-tcp\"",
  "reason": "ServiceUnavailable",
  "code": 503
}

Version-Release number of selected component (if applicable):
fork_ami_openshift3_platformmanagement_public_522_98

How reproducible:
always

Steps to Reproduce:
1.Create a template app with examples/sample-app/application-template-stibuild.json in default namespaces
2.Use cluster-admin access the the pod via API proxy 
curl -k -H "Authorization:Bearer rKcVgAatuoZxrLKPFuiirTY23ExDFMOeyBvne_GE1y0" https://127.0.0.1:8443/api/v1/proxy/namespaces/default/services/http:frontend:5432-tcp/  
3.

Actual results:
As description

Expected results:
Should not got 503, should be 200.

Additional info:
Work fine with pod via api proxy
Comment 1 Jordan Liggitt 2015-10-11 00:42:56 EDT
Proxying to a service port requires the name of the port. `new-app` happens to generate names with `<port>-<protocol>`, but the sti template sets its own custom names.

I think you need to use "https://127.0.0.1:8443/api/v1/proxy/namespaces/default/services/http:frontend:web/"

Also, https will only work if the backend is actually serving https, which I don't think the sample app is.
Comment 2 weiwei jiang 2015-10-12 03:17:14 EDT
(In reply to Jordan Liggitt from comment #1)
> Proxying to a service port requires the name of the port. `new-app` happens
> to generate names with `<port>-<protocol>`, but the sti template sets its
> own custom names.
> 
> I think you need to use
> "https://127.0.0.1:8443/api/v1/proxy/namespaces/default/services/http:
> frontend:web/"
> 
> Also, https will only work if the backend is actually serving https, which I
> don't think the sample app is.

Rechecked with /http:frontend:web/ and found this is not an issue now.

Note You need to log in before you can comment on or make changes to this bug.