Skip to content

Services does not work across pods #712

Closed

Description

@goldmann

When I try to connect to a service from a pod that is colocated with the destination pod - it works, but when the destination pod is running on another minion, the connection is not possible.

Below you can find an example - I'm trying to connect from wildflyPod to lbPod via service. It does work when wildflyPod and lbPod are running on the same minion, otherwise it won't work.

{
    "kind": "Config",
    "id": "wildfly-config",
    "apiVersion": "v1beta1",
    "name": "JBoss WildFly",
    "description": "Creates a JBoss WildFly cluster",
    "items": [
        {
            "kind": "Service",
            "id": "lb-http-service",
            "apiVersion": "v1beta1",
            "port": 90,
            "containerPort": 80,
            "selector": {
                "name": "lbPod"
            }
        },
        {
            "kind": "Service",
            "id": "wildfly-http-service",
            "apiVersion": "v1beta1",
            "port": 80,
            "containerPort": 8080,
            "selector": {
                "name": "wildflyPod"
            }
        },
        {
            "kind": "Service",
            "id": "wildfly-https-service",
            "apiVersion": "v1beta1",
            "port": 443,
            "containerPort": 8443,
            "selector": {
                "name": "wildflyPod"
            }
        },
        {
            "kind": "ReplicationController",
            "id": "wildflyController",
            "apiVersion": "v1beta1",
            "labels": {
                "name": "wildflyController"
            },
            "desiredState": {
                "replicas": 2,
                "replicaSelector": {
                    "name": "wildflyPod"
                },
                "podTemplate": {
                    "desiredState": {
                        "manifest": {
                            "id": "wildflyPod",
                            "version": "v1beta1",
                            "containers": [
                                {
                                    "image": "luksa/wildflycluster",
                                    "name": "wildfly-container",
                                    "env": [
                                        {
                                            "name": "FOO",
                                            "value": "BAR"
                                        }
                                    ],
                                    "ports": [
                                        {
                                            "hostPort": 9888,
                                            "containerPort": 8080
                                        },
                                        {
                                            "hostPort": 9443,
                                            "containerPort": 8443
                                        }
                                    ]
                                }
                            ],
                            "volumes": null
                        }
                    },
                    "labels": {
                        "name": "wildflyPod"
                    }
                }
            }
        },
        {
            "kind": "ReplicationController",
            "id": "lbController",
            "apiVersion": "v1beta1",
            "labels": {
                "name": "lbController"
            },
            "desiredState": {
                "replicas": 1,
                "replicaSelector": {
                    "name": "lbPod"
                },
                "podTemplate": {
                    "desiredState": {
                        "manifest": {
                            "id": "lbPod",
                            "version": "v1beta1",
                            "containers": [
                                {
                                    "image": "goldmann/mod_cluster",
                                    "name": "lb-container"                               
                                }
                            ],
                            "volumes": null
                        }
                    },
                    "labels": {
                        "name": "lbPod"
                    }
                }
            }
        }
    ]
}

/cc @mfojtik @rajatchopra @mrunalp

Activity

  1. mfojtik commented on Jan 22, 2015

    @mfojtik
    Contributor

    FYI this is f21, Vagrant with VirtualBox using OPENSHIFT_DEV_CLUSTER

  2. smarterclayton commented on Jan 31, 2015

    @smarterclayton
    Contributor

    @mrunalp what's the status of this?

  3. mrunalp commented on Feb 1, 2015

    @mrunalp
    Member

    I believe with the stability changes that went into openshift-sdn the last week, it should work with it. I will try this out on Monday and update status.

  4. mrunalp commented on Feb 3, 2015

    @mrunalp
    Member

    I tried this with openshift-sdn and am able to curl the lb-service to reach the backend which is running on another minion.

    export OPENSHIFT_SDN='ovs-simple'

    [root@openshift-master ~]# openshift cli get pods --server=http://localhost:8080                                                                                                                             
    POD                                    IP                  CONTAINER(S)        IMAGE(S)               HOST                  LABELS              STATUS
    97b2bcec-ab3d-11e4-8816-0800279696e1   10.1.1.5            wildfly-container   luksa/wildflycluster   openshift-minion-2/   name=wildflyPod     Running
    97ba0a6d-ab3d-11e4-8816-0800279696e1   10.1.0.7            lb-container        goldmann/mod_cluster   openshift-minion-1/   name=lbPod          Running
    [root@openshift-master ~]# openshift cli get se --server=http://localhost:8080
    NAME                    LABELS                                    SELECTOR            IP                  PORT
    kubernetes              component=apiserver,provider=kubernetes   <none>              172.30.17.2         443
    kubernetes-ro           component=apiserver,provider=kubernetes   <none>              172.30.17.206       80
    lb-http-service         <none>                                    name=lbPod          172.30.17.217       90
    wildfly-http-service    <none>                                    name=wildflyPod     172.30.17.161       80
    wildfly-https-service   <none>                                    name=wildflyPod     172.30.17.210       443
    
    On minion-1
    [root@openshift-minion-1 ~]# curl 172.30.17.217:90 | tail -n 10
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  4609  100  4609    0     0  1640k      0 --:--:-- --:--:-- --:--:-- 2250k
                                            <div class="logos">
                                                    <p>You are free to use the images below on Apache and Fedora powered HTTP servers. Thanks for using Apache and Fedora!</p>
    
                                                    <p><a href="http://httpd.apache.org/"><img src="/icons/apache_pb2.gif" alt="[ Powered by Apache ]"/></a> <a href="http://fedoraproject.org/"><img src="/icons/poweredby.png" alt="[ Powered by Fedora ]" width="88" height="31" /></a></p>
                                            </div>
                                    </div>
                            </div>
                    </div>
            </body>
    </html>
    
    
  5. rajatchopra commented on Feb 3, 2015

    @rajatchopra
    Contributor

    To clarify, plain 'vagrant up' uses the old GRE networking.
    To use the new openshift-sdn, do the following -

    $ export OPENSHIFT_DEV_CLUSTER=1
    $ export OPENSHIFT_NUM_MINIONS=2
    $ export OPENSHIFT_SDN=ovs-simple
    $ vagrant up
    
  6. goldmann commented on Feb 4, 2015

    @goldmann
    ContributorAuthor

    With openshift-sdn it does not work either.

    You need to curl from inside of the container which is running on another minion. I'm using origin version tagged as v0.2.1.

    [vagrant@openshift-master ~]$ openshift cli --server=http://localhost:8080 get pods
    POD                                             CONTAINER(S)        IMAGE(S)               HOST                  LABELS              STATUS
    e2bf7bd0-ac4c-11e4-aca1-0800279696e1/10.1.0.3   wildfly-container   luksa/wildflycluster   openshift-minion-2/   name=wildflyPod     Running
    e40313ca-ac4c-11e4-aca1-0800279696e1/10.1.0.4   lb-container        goldmann/mod_cluster   openshift-minion-2/   name=lbPod          Running
    e2bfc038-ac4c-11e4-aca1-0800279696e1/10.1.1.3   wildfly-container   luksa/wildflycluster   openshift-minion-1/   name=wildflyPod     Running
    [vagrant@openshift-master ~]$ openshift cli --server=http://localhost:8080 get services
    NAME                    LABELS                                    SELECTOR            IP                  PORT
    kubernetes              component=apiserver,provider=kubernetes   <none>              172.30.17.60        443
    kubernetes-ro           component=apiserver,provider=kubernetes   <none>              172.30.17.191       80
    lb-http-service         <none>                                    name=lbPod          172.30.17.123       90
    wildfly-http-service    <none>                                    name=wildflyPod     172.30.17.38        80
    wildfly-https-service   <none>                                    name=wildflyPod     172.30.17.243       443
    

    Minion 1:

    [vagrant@openshift-minion-1 ~]$ docker ps
    CONTAINER ID        IMAGE                         COMMAND                CREATED             STATUS              PORTS                                            NAMES
    a2f4d48d6fad        luksa/wildflycluster:latest   "/bin/sh -c /opt/jbo   6 minutes ago       Up 6 minutes                                                         k8s_wildfly-container.f3cd0169_e2bfc038-ac4c-11e4-aca1-0800279696e1.default.etcd_e2bfc038-ac4c-11e4-aca1-0800279696e1_700e0976   
    466a03fe0185        kubernetes/pause:go           "/pause"               6 minutes ago       Up 6 minutes        0.0.0.0:9443->8443/tcp, 0.0.0.0:9888->8080/tcp   k8s_net.9b12dab8_e2bfc038-ac4c-11e4-aca1-0800279696e1.default.etcd_e2bfc038-ac4c-11e4-aca1-0800279696e1_aa209b8e                 
    [vagrant@openshift-minion-1 ~]$ docker exec -it a2f4d48d6fad curl 172.30.17.123:90
    curl: (56) Recv failure: Connection reset by peer
    

    Minion 2:

    [vagrant@openshift-minion-2 ~]$ docker ps
    CONTAINER ID        IMAGE                         COMMAND                CREATED             STATUS              PORTS                                            NAMES
    1956ca855629        goldmann/mod_cluster:latest   "/sbin/httpd -DFOREG   5 minutes ago       Up 5 minutes                                                         k8s_lb-container.d61bad89_e40313ca-ac4c-11e4-aca1-0800279696e1.default.etcd_e40313ca-ac4c-11e4-aca1-0800279696e1_afd3a30c        
    7b0b23fd452b        kubernetes/pause:go           "/pause"               6 minutes ago       Up 6 minutes                                                         k8s_net.3e0f95f3_e40313ca-ac4c-11e4-aca1-0800279696e1.default.etcd_e40313ca-ac4c-11e4-aca1-0800279696e1_6cb50b02                 
    194bc1a088a3        luksa/wildflycluster:latest   "/bin/sh -c /opt/jbo   6 minutes ago       Up 6 minutes                                                         k8s_wildfly-container.f3cd0169_e2bf7bd0-ac4c-11e4-aca1-0800279696e1.default.etcd_e2bf7bd0-ac4c-11e4-aca1-0800279696e1_700e0976   
    68675b9bc64d        kubernetes/pause:go           "/pause"               6 minutes ago       Up 6 minutes        0.0.0.0:9443->8443/tcp, 0.0.0.0:9888->8080/tcp   k8s_net.9b12dab8_e2bf7bd0-ac4c-11e4-aca1-0800279696e1.default.etcd_e2bf7bd0-ac4c-11e4-aca1-0800279696e1_aa209b8e                 
    [vagrant@openshift-minion-2 ~]$ docker exec -it 194bc1a088a3 curl 172.30.17.123:90
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
        <head>
            <title>Test Page for the Apache HTTP Server on Fedora</title>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
            <style type="text/css">
                /*<![CDATA[*/
                body {
                    background-color: #fff;
                    color: #000;
                    font-size: 0.9em;
                    font-family: sans-serif,helvetica;
                    margin: 0;
                    padding: 0;
                }
    
    [SNIP]
    
    
  7. rajatchopra commented on Feb 4, 2015

    @rajatchopra
    Contributor

    Works for me.
    On master,

    [root@openshift-master ~]# openshift cli --server=http://localhost:8080 get se
    NAME                    LABELS                                    SELECTOR            IP                  PORT
    kubernetes              component=apiserver,provider=kubernetes   <none>              172.30.17.125       443
    kubernetes-ro           component=apiserver,provider=kubernetes   <none>              172.30.17.42        80
    lb-http-service         <none>                                    name=lbPod          172.30.17.220       90
    wildfly-http-service    <none>                                    name=wildflyPod     172.30.17.75        80
    wildfly-https-service   <none>                                    name=wildflyPod     172.30.17.95        443
    [root@openshift-master ~]# openshift cli --server=http://localhost:8080 get po
    POD                                    IP                  CONTAINER(S)        IMAGE(S)               HOST                  LABELS              STATUS
    e0e6fdcf-aca2-11e4-873e-0800279696e1   10.1.1.2            wildfly-container   luksa/wildflycluster   openshift-minion-2/   name=wildflyPod     Running
    e0eb0ea8-aca2-11e4-873e-0800279696e1   10.1.0.3            wildfly-container   luksa/wildflycluster   openshift-minion-1/   name=wildflyPod     Running
    e0fced87-aca2-11e4-873e-0800279696e1   10.1.0.2            lb-container        goldmann/mod_cluster   openshift-minion-1/   name=lbPod          Running
    

    On minion-2,

    [root@openshift-minion-2 ~]# docker ps
    CONTAINER ID        IMAGE                         COMMAND                CREATED             STATUS              PORTS                                            NAMES
    c3296c0494f4        luksa/wildflycluster:latest   "/bin/sh -c /opt/jbo   4 minutes ago       Up 4 minutes                                                         k8s_wildfly-container.ea8710c0_e0e6fdcf-aca2-11e4-873e-0800279696e1.default.api_e0e6fdcf-aca2-11e4-873e-0800279696e1_dccc3d24   
    64305fab52d4        kubernetes/pause:go           "/pause"               16 minutes ago      Up 16 minutes       0.0.0.0:9443->8443/tcp, 0.0.0.0:9888->8080/tcp   k8s_POD.db10fa80_e0e6fdcf-aca2-11e4-873e-0800279696e1.default.api_e0e6fdcf-aca2-11e4-873e-0800279696e1_36d9ff45                 
    [root@openshift-minion-2 ~]# 
    [root@openshift-minion-2 ~]# docker exec -it c3296c0494f4  curl 172.30.17.220:90
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
        <head>
            <title>Test Page for the Apache HTTP Server on Fedora</title>..
    

    On minion-1,

    [root@openshift-minion-1 ~]# docker ps
    CONTAINER ID        IMAGE                         COMMAND                CREATED             STATUS              PORTS                                            NAMES
    3c4721bff019        goldmann/mod_cluster:latest   "/sbin/httpd -DFOREG   3 minutes ago       Up 3 minutes                                                         k8s_lb-container.6b6fbe05_e0fced87-aca2-11e4-873e-0800279696e1.default.api_e0fced87-aca2-11e4-873e-0800279696e1_98456052        
    128180e380ce        luksa/wildflycluster:latest   "/bin/sh -c /opt/jbo   6 minutes ago       Up 6 minutes                                                         k8s_wildfly-container.ea8710c0_e0eb0ea8-aca2-11e4-873e-0800279696e1.default.api_e0eb0ea8-aca2-11e4-873e-0800279696e1_dd86986c   
    dd1c671b7998        kubernetes/pause:go           "/pause"               17 minutes ago      Up 17 minutes       0.0.0.0:9443->8443/tcp, 0.0.0.0:9888->8080/tcp   k8s_POD.db10fa80_e0eb0ea8-aca2-11e4-873e-0800279696e1.default.api_e0eb0ea8-aca2-11e4-873e-0800279696e1_78092a35                 
    c9f4fefd7f4e        kubernetes/pause:go           "/pause"               17 minutes ago      Up 17 minutes                                                        k8s_POD.9d83b5bb_e0fced87-aca2-11e4-873e-0800279696e1.default.api_e0fced87-aca2-11e4-873e-0800279696e1_516c42b0                 
    [root@openshift-minion-1 ~]# docker exec -it 128180e380ce curl 172.30.17.220:90
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
        <head>
            <title>Test Page for the Apache HTTP Server on Fedora</title>
            <meta http-equiv="Content-Type" content="text/html; chars..
    
  8. mrunalp commented on Feb 4, 2015

    @mrunalp
    Member

    @rajatchopra Maybe we need to look at @goldmann setup and debug it there?

  9. goldmann commented on Feb 4, 2015

    @goldmann
    ContributorAuthor

    Which revision do you use? I used the v0.2.1 tag. This is a fresh set up using:

    $ export OPENSHIFT_DEV_CLUSTER=1
    $ export OPENSHIFT_NUM_MINIONS=2
    $ export OPENSHIFT_SDN=ovs-simple
    $ vagrant up
    
  10. rajatchopra commented on Feb 4, 2015

    @rajatchopra
    Contributor

    I did it off the master branch, Marek :)

  11. goldmann commented on Feb 4, 2015

    @goldmann
    ContributorAuthor

    I badly hunt for a stable revision so we at cloud enablement can base on something ;)

    Any hints?

  12. smarterclayton commented on Feb 4, 2015

    @smarterclayton
    Contributor

    Did your fixes get in before last night? Then Marek can pull 0.2.2

    ----- Original Message -----

    I did it off the master branch, Marek :)


    Reply to this email directly or view it on GitHub:
    #712 (comment)

  13. rajatchopra commented on Feb 4, 2015

    @rajatchopra
    Contributor

    No fix was made.
    I guess we need to look at goldmann's setup itself.

  14. goldmann commented on Feb 4, 2015

    @goldmann
    ContributorAuthor

    I'll give v0.2.2 a shot and get back to you ;)

  15. goldmann commented on Feb 4, 2015

    @goldmann
    ContributorAuthor

    I can confirm that with v0.2.2 I can reach the service from any of the pods.

  16. mrunalp commented on Feb 4, 2015

    @mrunalp
    Member

    @goldmann Thanks!

  17. smarterclayton commented on Feb 12, 2015

    @smarterclayton
    Contributor

    Reopen if similar issues recur.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions