Bug 1271078 - Cannot curl the service exposed for a pod (QE V3 cluster only)
Cannot curl the service exposed for a pod (QE V3 cluster only)
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Containers (Show other bugs)
3.x
Unspecified Unspecified
medium Severity medium
: ---
: 3.x
Assigned To: Ravi Sankar
chaoyang
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-10-13 02:42 EDT by Xingxing Xia
Modified: 2015-11-23 16:15 EST (History)
10 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:57 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 Xingxing Xia 2015-10-13 02:42:45 EDT
Description of problem:
Use 'oc expose' to expose service for a pod. Then 'curl' the service IP with mapped port. But the 'curl' result fails.

Version-Release number of selected component (if applicable):
oc v1.0.6-494-g04bfa26
kubernetes v1.1.0-alpha.1-653-g86b4e77

Test Environment:
QE V3 Cluster env

How reproducible:
Always


Steps to Reproduce:
1. Visit https://console.qe.openshift.com in browser. Then visit https://api.qe.openshift.com/oauth/token/request to get access token
2. oc login with the token, create a project, then create a new app:
$ oc new-app openshift/ruby-20-centos7 --code=https://github.com/openshift/ruby-hello-world -l app=test-ruby --name=myapp
3. Wait the bc, dc to complete. Check the pod
$ oc get pod
4. Expose service from pod
$ oc expose pod <pod_name> --port=80 --target-port=8080 --generator=service/v1
5.Check service
$ oc get svc
6. Access app with the new port and ip. Due to I cannot login into the QE V3 cluster node, so instead of using "curl http://<service ip>:80", use these:
1> $ oc rsh <pod_name> # Enter into the pod container shell
2> bash-4.2$ curl <service ip>:80

Actual results:
2.
<-- snip -->
imagestreams/ruby-20-centos7
imagestreams/myapp
buildconfigs/myapp
<-- snip -->
3. See the pod
NAME            READY     STATUS    RESTARTS   AGE
myapp-1-1lk3v   1/1       Running   0          57s
4. 
service "myapp-1-1lk3v" exposed
5. See the service and its IP
NAME            CLUSTER_IP      EXTERNAL_IP   PORT(S)    SELECTOR                                                  AGE
myapp-1-1lk3v   172.30.79.80    <none>        80/TCP     app=test-ruby,deployment=myapp-1,deploymentconfig=myapp   10s
6.
1> oc rsh succeeds
2> Error happens:
curl: (56) Recv failure: Connection reset by peer

Expected results:
6.
2> The output for command "curl http://<service ip>:80| grep title" should be:
<title>Hello from OpenShift v3!</title>

Additional info:
In step 2, if we add the option --env=MYSQL_USER=root,MYSQL_PASSWORD=test,MYSQL_DATABASE=test,MYSQL_ROOT_PASSWORD=abcd1234, then step 6.2 succeeds!
But on AWS devenv-fedora instance, even if we don't add the --env option, step 6.2 succeeds as well.
Comment 2 Fabiano Franz 2015-10-13 14:20:26 EDT
Doesn't seem related to the CLI. Reassigning.
Comment 3 Eric Paris 2015-10-29 13:39:08 EDT

*** This bug has been marked as a duplicate of bug 1273253 ***
Comment 4 Eric Paris 2015-11-02 10:08:08 EST
Is this reproducible in the latest nightly builds? There were multiple reports of problems like this fixed in https://github.com/openshift/origin/pull/5470 ?
Comment 5 Xingxing Xia 2015-11-02 21:54:08 EST
Verified against QE V3 cluster env with version:
oc v1.0.7-121-gce9f146
kubernetes v1.2.0-alpha.1-1107-g4c8e6f4

So move it to VERIFIED

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