How to add a custom hostname for project in OpenShift Online (Next Gen) Developer Preview

妖精的绣舞 提交于 2020-01-15 09:27:06

问题


How can I put a custom host name for the new project created in the OpenShift (Next Gen) Developer Preview?

It was pretty straight forward for the previous version where I have to add an alias and add the required CNAME entry in DNS. For this version, I tried both CNAME and A. First I add a CNAME to the default address provided by the platform; then I tried adding A record for the address to the Cluster IP shown in the service. Both methods failed to solve it unfortunately!

I can see a router object in the site but not sure what to do!

Anyone any idea?


回答1:


At this point in time, the developer preview does not permit you to add a custom hostname through the platform itself. OpenShift does support the concept, but it is disabled for now.

The only way to can achieve the same result at the moment is to run your site behind a CDN such as CloudFlare, or your own separate proxy outside of OpenShift, with those terminating the request for your custom host name and then forwarding it.

That said, how it would usually be done if enabled is by creating a new route with the specified hostname.

oc expose service myapp --name myapp-public --hostname www.example.com


来源:https://stackoverflow.com/questions/39099676/how-to-add-a-custom-hostname-for-project-in-openshift-online-next-gen-develope

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!