6
votes

I've installed OpenShift Version 3 on CentOS7. I followed the official documentation: https://docs.openshift.org/latest/admin_guide/install/prerequisites.html#configuring-docker-storage

method 1 (Docker): https://docs.openshift.org/latest/getting_started/administrators.html#installation-methods

I chose to install OpenShift in a Docker Container. The last commmand I had to do was this one: I'm launching the server in a Docker container using images from Docker Hub.:

$ docker run -d --name "openshift-origin" --net=host --privileged \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /tmp/openshift:/tmp/openshift \
openshift/origin start

This command:

  • starts OpenShift listening on all interfaces (0.0.0.0:8443),

  • starts the web console listening on all interfaces (0.0.0.0:8443),

  • launches an etcd server to store persistent data, and

  • launches the Kubernetes system components.

    $ sudo docker ps
    
    CONTAINER ID        IMAGE               COMMAND                CREATED             STATUS              PORTS               NAMES
    
    d3f023085328        openshift/origin    "/usr/bin/openshift    2 days ago          Up 2 days                               openshift-origin
    

Now I was able to do:

$ sudo docker exec -it openshift-origin bash

So I can access openshift in my container. I can create projects and apps but the building-state is always pending. I'm not able to visit https://publicip:8443/console. Someone who can help me? The OpenShift-page loads for a second (when i'm going http://publicip:8443) but than I get a redirect_url to 10.0.0.x:8443. My master-config looks like this: https://github.com/openshift/origin/blob/master/test/old-start-configs/v1.0.0/config/openshift.local.config/master/master-config.yaml. What do I have to change?

url: https://10.0.0.x:8443/oauth/authorize?client_id=openshift-web-console&response_type=token&state=%2F&redirect_uri=https%3A%2F%2F10.0.0.x%3A8443%2Fconsole%2Foauth

EDIT:

docker run -d --name "origin" \
        --privileged --pid=host --net=host \
        -v /:/rootfs:ro -v /var/run:/var/run:rw -v /sys:/sys -v /var/lib/docker:/var/lib/docker:rw \
        -v /var/lib/origin/openshift.local.volumes:/var/lib/origin/openshift.local.volumes \
        openshift/origin start
2
Do you use the free version? Because https is only supported under the bronze and upwards plan. - Tom K.
Yes, but I can't find the information about the support of it. - lvthillo
Not really, I think RHC is for OpenShift V2, isn't it? And don't we use oc for OpenShift V3? - lvthillo
Wow, this is embarassing (for me and for Red Hat). Yeah you are right, this is the documentation vor OS v2.2. But here is the real deal (; docs.openshift.org/latest/whats_new/overview.html# - Tom K.

2 Answers

0
votes

Maybe I am wrong, but in order to be able to connect to the container on port 8443 using the host's ip, you need to publish this port on the host. This can be done in the docker run command by adding the argument -p 8443:8443

See https://docs.docker.com/reference/commandline/run/

0
votes

I'm having the same issue, but got around it with an SSH tunnel.

Try executing the following:

ssh -gf -D 8443 <publicip> -N

And then visit the IP address you are being forwarded to after setting the SOCKS proxy on your browser to localhost:8443