Bug 1270492 - [fork][platformmanagement_522] Can not access the services via API proxy for example sample-app
Summary: [fork][platformmanagement_522] Can not access the services via API proxy for ...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: Pod
Version: 3.x
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Jordan Liggitt
QA Contact: Jianwei Hou
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-10-10 10:57 UTC by weiwei jiang
Modified: 2016-10-30 22:54 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-23 21:15:31 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description weiwei jiang 2015-10-10 10:57:53 UTC
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 04:42:56 UTC
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 07:17:14 UTC
(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.