Using a custom domain with openshift v3 - openshift

I've been trying to use Openshift Online v3 to host a web app. It works fine with the red hat-provided domain, but I can't get the routing working to get it to work on any other domain. all I get is:
Application is not available
The application is currently not serving requests at this endpoint. It may not have been started or is still starting.
Possible reasons you are seeing this page:
The host doesn't exist. Make sure the hostname was typed correctly and that a route matching this hostname exists.
The host exists, but doesn't have a matching path. Check if the URL path was typed correctly and that the route was created using the desired path.
Route and path matches, but all pods are down. Make sure that the resources exposed by this route (pods, services, deployment configs, etc) have at least one pod running.
Does anybody know how to do a custom domain in Openshift v3?

Step 1: Create two routes in openshift v3 console. One provided default by the openshift (*.openshiftapps.com) and create another route with the host name as your domain name.
Step 2: Go to domain registrar and add a CNAME record for your domain which points to *.openshiftapps.com domain
Wait for the CNAME addition to take effect and access your domain name from the browser, now it should get the page loaded properly.

As was the case with OpenShift Online Developer Preview, the GA free OpenShift Online starter tier does not support custom domains. Custom domains will only be available when the full paid tier is available. The only option in the interim is to use a proxy in front. One option is to use Cloudflare as that proxy.

Take a look at these docs.
$ oc create route edge --service=frontend \
--cert=${MASTER_CONFIG_DIR}/ca.crt \
--key=${MASTER_CONFIG_DIR}/ca.key \
--ca-cert=${MASTER_CONFIG_DIR}/ca.crt \
--hostname=www.example.com

For starter (free) plan, you may try hidden redirected URL. Some DNS providers provide such service.

Related

"The host is unknown to Read the Docs" while hosting local RTD server

I'm trying to see whether I can host RTD privately (behind a VPN). I spun up an AWS EC2 instance and set it up using the Docker image and instructions here. Everything worked fine, but when I go to http://<internal_ip> to test it I get a page with the message
404 - Invalid Host
The host "" is unknown to Read the Docs
If you control this domain and believe this is in error, please review our custom domain documentation. In the past, we allowed custom domains to point to us without configuring the domain in the Read the Docs dashboard and we attempted to intelligently guess the correct project based on DNS settings. Now, we believe that explicit is better than implicit. Below are some steps to help you get your domain working again:
Ensure you have a CNAME record pointing to readthedocs.io
Add your desired domain in the Read the Docs dashboard for your project (under Your Project >> Admin >> Domains)
It points me to this page, but it seems to me that those instructions assume I'm hosting my project on the public readthedocs.io site. Any ideas on how I can get this to work on my private server?

Openshift Login Plugin Jenkins - Invalid Request

I tried to setup-up a custom jenkins image, based on the redhat jenkins image. The redhat jenkins image, has the Openshift Login Plugin, installed already.
After, the image started up properly, I tried to login, with my Openshift credentials, but it didn't work.
I just saw the the following error message:
"error":"invalid_request","error_description":"The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed.","state":"xxxxxxxxxxxxxxxxxxx"
and there was another message in the OS terminal of the running pod.
I read about several other issues from the Openshift Login Plugin, but also an update to Version 1.0.12 didn't fix my problems.
My Problem was, that I didn't knew, that each Openshift Service Account has a redirect reference - specially configured for one deployment.
I already used the Service Account, I used for the above mentioned Jenkins, for another Jenkins Deployment, because of this Openshift added the redirect reference, configured for this "older" deployment.
In our Openshift Setup (3.11), you aren't able to find the redirection configuration within the Service Account settings that you can find under Resources --> Membership --> Service Accounts. Instead you have to look and edit the YAML File of the Service Account, that you can find under Resources --> Other Resources --> Service Account.
serviceaccounts.openshift.io/oauth-redirectreference.jenkins
Since this is quite tricky to find out, I hope that I could possibly save somebody a few hours of searching.

"Route not admitted by a router" on Openshift Online v3

I have an application deployed on Openshift Online v3 starter plan which (used to) run well until yesterday. Yesterday I had to publish a new version of my application. Apparently, the platform encountered some problems redeploying it, I had to cancel some processes which seemed locked or continually restarting.
Finally I managed to have my pod running with the new version, the logs look fine.
The issue now is that my app is no longer exposed. When hitting the URL which was assigned to me, I got the infamous "not available" OO page:
Application is not available
The application is currently not serving requests at this endpoint. It may not have been started or is still starting.
Possible reasons you are seeing this page:
The host doesn't exist. Make sure the hostname was typed correctly and that a route matching this hostname exists.
The host exists, but doesn't have a matching path. Check if the URL path was typed correctly and that the route was created using the desired path.
Route and path matches, but all pods are down. Make sure that the resources exposed by this route (pods, services, deployment configs, etc) have at least one pod running.
I checked these 3 suggestions, and got sure that my host existed, that the path was correct, and that my pods where up. So, not understanding what the real issue was, I dropped the existing route and created a new one.
It's been 2 hours now, and the route UI keeps displaying this message:
The route is not accepting traffic yet because it has not been admitted by a router.
My understanding is that the router which should admit my route is not part of my project, it is managed by Openshift Online, am I right ?
So what could I do now to unlock my new route ?
Thanks for your suggestions
There it is ! My application is reachable again at last : It took 2 days for the router to setup my route. No action required from my part.
But the starter platform is still experiencing difficulties, so I will avoid any redeployment until the status turns green again.

Openshift 3 Online Starter & Routing

I have a starter (free) tier account with Openshift online. I have an application consisting of two pods, a Node and a Mongo. The pods build and deploy; from the terminal that executes in the web console on the running Node pod I can run curl localhost:8080 and the Node process obligingly spits back my base page.
I have a route that was autogenerated; the web console gives me a link to <myappname>.stuff.starter-east-1.openshiftapps.com and appears to correctly reference the Node service that sits on top of the running Node pod.
However, when I point my browser at that hostname, I get the Openshift error page that tells me that either the route or path was not typed correctly, or the pod isn't running.
I have tried this with my own code and with the example node packages and I see the same thing.
When I use the oc tool to query things about my application, I see that I don't have a router resource - but the route claims to have been exposed on a router. So I think I'm using some kind of default router in the node, and I don't have to launch one in my project, but I'm not sure. Most of the other questions around this topic are for people using the Enterprise product and running on their own hardware, where they have more control at the admin layer over the router package; all the suggestions seem to imply that for the Online product this 'just works'. Any ideas what I am missing?
Update : After some period of time, the example project did work and a browser request was serviced with the basic example page. Looking at the two setups I cannot see any differences, or why my route (in my custome app) never gets activated but the sample project route does.
Turns out the issue was that my application (node) was listening to localhost:8080, when it needs to be listening to 0.0.0.0:8080. I'm not enough of a networking guy to explain why that matters to the router but it does.

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

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?
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