Search code examples
dockeropenshift-originfabric8

Install Fabric8 on openshift docker instance


I try to get started with fabric 8 and open shift on docker. An open shift instance (single docker container) is running as described here: https://docs.openshift.org/latest/getting_started/administrators.html#running-in-a-docker-container. I installed fabric 8 as http://fabric8.io/guide/getStarted/openshift.html and now the basic pods are running.

But I cannot reach the service

oc get services
NAME              CLUSTER_IP       EXTERNAL_IP   PORT(S)                 SELECTOR                                                 AGE
docker-registry   172.30.194.44    <none>        5000/TCP                docker-registry=default                                  18h
fabric8           172.30.178.196                 80/TCP                  group=io.fabric8.apps,project=console,provider=fabric8   18h
kubernetes        172.30.0.1       <none>        443/TCP,53/UDP,53/TCP   <none>                                                   20h
router            172.30.77.252    <none>        80/TCP                  router=router                                            18h
oc describe service fabric8
Name:           fabric8
Namespace:      default
Labels:         group=io.fabric8.apps,project=console,provider=fabric8,version=2.2.116
Selector:       group=io.fabric8.apps,project=console,provider=fabric8
Type:           LoadBalancer
IP:         172.30.178.196
Port:           <unnamed>   80/TCP
NodePort:       <unnamed>   30308/TCP
Endpoints:      172.17.0.2:9090
Session Affinity:   None
No events.

ping 172.17.0.2:9090
ping: unknown host 172.17.0.2:9090
gheiler@testCluster:~$ ping 172.30.178.196
PING 172.30.178.196 (172.30.178.196) 56(84) bytes of data.
From 62.218.18.245 icmp_seq=1 Destination Host Unreachable
From 62.218.18.245 icmp_seq=2 Destination Host Unreachable

In the troubleshooting section of: http://fabric8.io/guide/getStarted/openshift.html some ideas like

corsAllowedOrigins:
  - .*

are suggested. But I do not know how to enable them in the docker container. Do you have any ideas why I cannot reach my basic fabric8 console?


Solution

  • If you are trying to access a service on OpenShift remotely then you need to ensure you've deployed a router & added a Route. You can read more on routing in OpenShift at https://docs.openshift.com/enterprise/3.0/architecture/core_concepts/routes.html.

    In this case if you add a route with:

    cat <<EOF | kubectl create -f - apiVersion: v1 kind: Route metadata: name: fabric8-console pec: host: <EXTERNALLY_RESOLVE_DNS> to: kind: Service name: fabric8 EOF

    As some extra info, you cannot target ping at a port. Ping uses a different network protocol, ICMP, which doesn't have the notion of ports. Also, both services & pods don't respond to ping so you will not be able to ping them. If you're trying to check connectivity then you can use the nc utility:

    nc -v  <address> <port>
    

    This will report connection success if the address/port is reachable. Note that in OpenShift, pod IPs & service IPs are generally only routeable inside the cluster, i.e. on nodes, so trying this from outside the cluster will probably fail.