oc cluster up and public-hostname

4/12/2018

I have Docker and OpenShift client installed on Ubuntu 16.04.3 LTS

[vagrant@desktop:~] $ docker --version
Docker version 18.01.0-ce, build 03596f5
[vagrant@desktop:~] $ oc version
oc v3.7.1+ab0f056
kubernetes v1.7.6+a08f5eeb62
features: Basic-Auth GSSAPI Kerberos SPNEGO

Server https://127.0.0.1:8443
openshift v3.7.1+282e43f-42
kubernetes v1.7.6+a08f5eeb62
[vagrant@desktop:~] $ 

Notice server URL https://127.0.0.1:8443.

I can start a cluster using oc cluster up

vagrant@desktop:~] $ oc cluster up --public-hostname='ocp.devops.ok' --host-data-dir='/var/lib/origin/etcd' --use-existing-config --routing-suffix='cloudapps.lab.example.com'
Starting OpenShift using openshift/origin:v3.7.1 ...
OpenShift server started.

The server is accessible via web console at:
    https://ocp.devops.ok:8443

I can access the server using https://ocp.devops.ok:8443 but then the OCP will redirect to https://127.0.0.1:8443. So it redirect to kubernetes server URL I think.

This raises the question about public-hostname. What does it do? It is not used by OpenShift I think because it redirects to Kubernetes server URL.

How do I change this setting in Kubernetes?

-- onknows
kubernetes
openshift

2 Answers

4/12/2018

I think that because --public-hostname does not specify the ip to be bound, and that ip currently is 127.0.0.1, som of the config is set to that value, and hence the oauth challenge redirects you there. I hope it might be solved in 3.10.

See this issue described in OpensShift's Origin GitHub

-- jorgemoralespou
Source: StackOverflow

4/12/2018

The problem is as it turns out is use-existing-config. If I remove that from the command there is no redirect.

-- onknows
Source: StackOverflow