Origin: Change http-redirect to local IP

Created on 13 Sep 2016  路  5Comments  路  Source: openshift/origin

[provide a description of the issue]

Version

[provide output of the openshift version or oc version command]

Steps To Reproduce

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

Current Result

Have redirecte to local IP (192.168.1.45)

Expected Result

Need use domain (or Public IP over NAT)

Additional Information

How I can change local IP?
where I can see the variables used to start the container?

kinquestion

Most helpful comment

add --public-master=https://<domain or IP>:8443 when starting

All 5 comments

add --public-master=https://<domain or IP>:8443 when starting

Have you considered using oc cluster up --public-hostname=192.168.1.45? Seems easier than using docker run in that manner. There are various flags that allow you to use local configuration as well. If you evaluated it and ruled it out, it'd help us to understand why. Any other information that you can share about your use case would help give us context as well.

Feel free to reopen if you have any follow-up.

@liggitt

add --public-master=https://:8443 when starting

Very fine! How add SSL certificate?
where you will find a description of this option? What are the options still exist?

@Evgeniy-Bondarenko Try openshift start --help (in your case, of course, you'll need all the docker commands/flags beforehand). You will need to write the configuration first --write-config, then the SSL settings should be in master-config.yaml (otherwise you can also look at wherever your openshift.local.config is written, and there should be keypairs in there)

Options:
      --certificate-authority=[]: Optional files containing signing authorities to use (in addition to the generated signer) to verify the API server's serving certificate.
      --cors-allowed-origins=[]: List of allowed origins for CORS, comma separated.  An allowed origin can be a regular expression to support subdomain matching.  CORS is enabled for localhost, 127.0.0.1, and the asset server by default.
      --create-certs=true: Indicates whether missing certs should be created.
      --dns='tcp://0.0.0.0:8053': The address to listen for DNS requests on.
      --etcd='https://0.0.0.0:4001': The address of the etcd server (host, host:port, or URL). If specified, no built-in etcd will be started.
      --etcd-dir='openshift.local.etcd': The etcd data directory.
      --hostname='limelight': The hostname to identify this node with the master.
      --images='openshift/origin-${component}:${version}': When fetching images used by the cluster for important components, use this format on both master and nodes. The latest release will be used by default.
      --latest-images=false: If true, attempt to use the latest images for the cluster instead of the latest release.
      --listen='https://0.0.0.0:8443': The address to listen for connections on (scheme://host:port).
      --master='https://localhost:8443': The master address for use by OpenShift components (host, host:port, or URL). Scheme and port default to the --listen scheme and port. When unset, attempt to use the first public IPv4 non-loopback address registered on this host.
      --master-config='': Location of the master configuration file to run from. When running from configuration files, all other command-line arguments are ignored.
      --network-plugin='': The network plugin to be called for configuring networking for pods. Optional for OpenShift network plugin, node will auto detect network plugin configured by OpenShift master.
      --node-config='': Location of the node configuration file to run from. When running from configuration files, all other command-line arguments are ignored.
      --pause=false: If true, wait for a signal before starting the controllers.
      --portal-net='172.30.0.0/16': The CIDR string representing the network that portal/service IPs will be assigned from. This must not overlap with any IP ranges assigned to nodes for pods.
      --print-ip=false: Print the IP that would be used if no master IP is specified and exit.
      --public-master='https://localhost:8443': The master address for use by public clients, if different (host, host:port, or URL). Defaults to same as --master.
      --volume-dir='openshift.local.volumes': The volume storage directory.
      --write-config='': Directory to write an initial config into.  After writing, exit without starting the server.

Here's what mine looks like:

$ ls openshift.local.config/master
admin.crt               master.kubelet-client.crt    openshift-registry.kubeconfig
admin.key               master.kubelet-client.key    openshift-router.crt
admin.kubeconfig        master.proxy-client.crt      openshift-router.key
ca-bundle.crt           master.proxy-client.key      openshift-router.kubeconfig
ca.crt                  master.server.crt            policy.json
ca.key                  master.server.key            serviceaccounts.private.key
ca.serial.txt           openshift-master.crt         serviceaccounts.public.key
etcd.server.crt         openshift-master.key         service-signer.crt
etcd.server.key         openshift-master.kubeconfig  service-signer.key
master.etcd-client.crt  openshift-registry.crt
master.etcd-client.key  openshift-registry.key
Was this page helpful?
0 / 5 - 0 ratings