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

Routing issue with openshift container deployment method



Hi,

I was following below method to deploy openshift all in one container
on a devel box having IP (10.0.0.1) in my private network. I was able
to access deployed app on devel box with service IP and port but no
external connectivity in same network where my devel box is currently.

Steps I followed:-
1. $ sudo docker run -d --name "origin" \ (on devel box)
        --privileged --net=host \
        -v /:/rootfs:ro -v /var/run:/var/run:rw -v /sys:/sys:ro -v
/var/lib/docker:/var/lib/docker:rw \
        -v /var/lib/openshift/openshift.local.volumes:/var/lib/openshift/openshift.local.volumes
\
        openshift/origin start

2. $ oc new-project test (on devel box after login using oc)

3. $ sudo docker exec -it origin bash (on devel box)

4. # oadm policy add-cluster-role-to-user cluster-admin test (on
openshift container)

5. $ echo \ (on devel box)
    '{"kind":"ServiceAccount","apiVersion":"v1","metadata":{"name":"router"}}' \
    | oc create -f -

6. $ oc edit scc privileged (on devel box)
...
users:
- system:serviceaccount:openshift-infra:build-controller
- system:serviceaccount:default:router

7. $ sudo docker run --rm -it --net=host
openshift/origin-haproxy-router --master https://10.0.0.1:8443 (on
devel box)

8. $ oc new-app openshift/deployment-example (on devel box)

9. $ oc status (on devel box)
In project test on server https://10.0.0.1:8443

service/deployment-example - 172.30.178.63:8080
  dc/deployment-example deploys istag/deployment-example:latest
    #1 deployed less than a second ago - 1 pod

10. $ curl -Ik 172.30.178.63:8080 (on devel)
HTTP/1.1 200 OK
Date: Tue, 20 Oct 2015 13:59:57 GMT
Content-Length: 687
Content-Type: text/html; charset=utf-8

11. $ sudo netstat -ntpl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address
State       PID/Program name
tcp        0      0 127.0.0.1:10444         0.0.0.0:*
LISTEN      30446/haproxy
tcp        0      0 0.0.0.0:80              0.0.0.0:*
LISTEN      30446/haproxy      -> haproxy running
tcp        0      0 0.0.0.0:53              0.0.0.0:*
LISTEN      15567/openshift
tcp        0      0 0.0.0.0:22              0.0.0.0:*
LISTEN      982/sshd
tcp        0      0 0.0.0.0:443             0.0.0.0:*
LISTEN      30446/haproxy      -> haproxy running
tcp        0      0 0.0.0.0:8443            0.0.0.0:*
LISTEN      15567/openshift
tcp        0      0 127.0.0.1:10443         0.0.0.0:*
LISTEN      30446/haproxy
tcp6       0      0 :::50605                :::*
LISTEN      15567/openshift
tcp6       0      0 :::22                   :::*
LISTEN      982/sshd
tcp6       0      0 :::7001                 :::*
LISTEN      15567/openshift
tcp6       0      0 :::4001                 :::*
LISTEN      15567/openshift
tcp6       0      0 :::9090                 :::*
LISTEN      1/systemd
tcp6       0      0 :::55242                :::*
LISTEN      15567/openshift
tcp6       0      0 :::10250                :::*
LISTEN      15567/openshift


Now if I try to connect it using another instance in same network
(10.0.0.2 even localhost also) then I am not able to access this
service over 80 or 443 port which haproxy router should resolve. Am I
missing something or any more info required, I would happy to provide
more details.

# curl -Ik localhost:80
<html><body><h1>503 Service Unavailable</h1>
No server available to handle the request.
</body></html>




-- 
Praveen Kumar
http://fedoraproject.org/wiki/User:Kumarpraveen
http://fedoraproject.org/
http://kumar-pravin.blogspot.com


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