[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Unable to access the app on All In one Vagrant for Openshift Origin



This is somewhat tricky, but there are a few overlapping issues.

First, there can be many services, and each has their own virtual IP address.  That ip is hooked up to a proxy on each machine that forwards connections to pods.  In your case that is 172.30.15.137 on port 15000.  From your host, if you are using nat, packets that go to the VM will be ignored because the service proxy is listening on just the service ip, not 0.0.0.0.  You must use vagrants private network mode and forward packets from your host to the VM address in order for your browser to connect to a service ip directly.  You want to route 172.30.0.0/16 to the VM ip.

Second, the router (which forwards http to services) listens on port 80 and 443 on the VM (once deployed) is a proxy only for http, so if your c hello world app speaks http you can talk to the router on those ports which are passed on to your pod.

So, you need to adjust vagrant slightly for the former, or ensure the router is running correctly for the latter.

On Nov 24, 2015, at 11:36 AM, Suryaveer Chauhan <chauhan suryaveer gmail com> wrote:

Hi All,

I am trying OpenShift Origin V3 "All in One Vagrant" and followed the document it refers.

The turbo app that comes along with it works fine from the browser on the host machine (using the browser addon).

Later, I created a simple C code which just listens on a port and reply Hello World. I deployed this app using a docker image and deployment is done fine. I am able to hit the URL of pod from within the Vagrant VM and am getting the reply to but I am not able to get the reply on the browser on the host machine. 

I added the route and also in the Vagrant file added the port forwarding statement (listening on port 15000).

Below is the describe of service and routes:

C:\openshift_paas\openshift-origin-v1.0.7-67bb208-windows-amd64>oc describe svc samplecserver
Name:                   samplecserver
Namespace:              samplecserver
Labels:                 app=samplecserver
Selector:               app=samplecserver,deploymentconfig=samplecserver
Type:                   ClusterIP
IP:                     
Port:                   15000-tcp       15000/TCP
Endpoints:              172.17.0.10:15000
Session Affinity:       None
No events.


C:\openshift_paas\openshift-origin-v1.0.7-67bb208-windows-amd64>oc get routes
NAME            HOST/PORT         PATH      SERVICE         LABELS              TLS TERMINATION
samplecserver   www.example.com             samplecserver   app=samplecserver

Details of service

C:\openshift_paas\openshift-origin-v1.0.7-67bb208-windows-amd64> oc get svc samplecserver -o json
{
    "kind": "Service",
    "apiVersion": "v1",
    "metadata": {
        "name": "samplecserver",
        "namespace": "samplecserver",
        "selfLink": "/api/v1/namespaces/samplecserver/services/samplecserver",
        "uid": "2a35f5d2-925b-11e5-a55a-080027c5bfa9",
        "resourceVersion": "48715",
        "creationTimestamp": "2015-11-24T03:26:35Z",
        "labels": {
            "app": "samplecserver"
        },
        "annotations": {
            "openshift.io/generated-by": "OpenShiftNewApp"
        }
    },
    "spec": {
        "ports": [
            {
                "name": "15000-tcp",
                "protocol": "TCP",
                "port": 15000,
                "targetPort": 15000
            }
        ],
        "selector": {
            "app": "samplecserver",
            "deploymentconfig": "samplecserver"
        },
        "portalIP": "172.30.15.137",
        "clusterIP": "172.30.15.137",
        "type": "ClusterIP",
        "sessionAffinity": "None"
    },
    "status": {
        "loadBalancer": {}
    }
}

Routes:

C:\openshift_paas\openshift-origin-v1.0.7-67bb208-windows-amd64> oc get routes samplecserver -o json
{
    "kind": "Route",
    "apiVersion": "v1",
    "metadata": {
        "name": "samplecserver",
        "namespace": "samplecserver",
        "selfLink": "/oapi/v1/namespaces/samplecserver/routes/samplecserver",
        "uid": "a28bca94-925d-11e5-a55a-080027c5bfa9",
        "resourceVersion": "49013",
        "creationTimestamp": "2015-11-24T03:44:16Z",
        "labels": {
            "app": "samplecserver"
        }
    },
    "spec": {
        "host": "www.example.com",
        "to": {
            "kind": "Service",
            "name": "samplecserver"
        },
        "port": {
            "targetPort": "15000"
        }
    },
    "status": {}
}

I feel something very silly is missing somewhere but unable to find. Please help.

Thanks & Regards,
Suryaveer Singh Chauhan
_______________________________________________
users mailing list
users lists openshift redhat com
http://lists.openshift.redhat.com/openshiftmm/listinfo/users

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]