I'm using OCP ver 3.9 and using jenkins pipeline to deploy to OpenShift. Usually, when I expose a route via this code:
def app = openshift.newApp("${IMAGE}:${imageStreamTag}", "--name=${appName}${appMajorVersion}")
app.narrow("svc").expose()
The exposed route will have the convention http://appName-projectName-clusterName/ (e.g. http://service1-myopenshiftproject-openshift.development.company.com.au/)
What I need is for my applications to have a common hostname (I don't want to have the application name and project name in the main/parent url --the one after the http://... ) , something like
http://openshift.development.company.com.au
I read about the hostname parameter of the oc create route command and I tried it in the Jenkins pipeline. I'm also following this link https://www.redhat.com/en/blog/how-deploy-multiple-versions-api-using-paths-openshift though for a slightly different purpose (exposing multiple api version using paths)
def app = openshift.newApp("${IMAGE}:${imageStreamTag}", "--name=${appName}${appMajorVersion}")
app.narrow("svc").expose("--path=/api/${appName}/v${appMajorVersion}", "--hostname=openshift.development.company.com.au")
The service got exposed according to the OpenShift web console, but when I try clicking the url found in the Overview tab of the OpenShift web console which lists down all the applications, this is what I got:
This site can’t be reached openshift.development.company.com.au’s server IP address could not be found.
How can this be done? Any leads are appreciated.
Related
I have configured WSO2 API Manager 4.0.0 in an AWS EC2 which runs on Amazon Linux 2. I am following this WSO2 documentation to setup my first API. I am accessing the API Manager's Dev Portal via my local machine. I am in Step 3 : Invoking my API.
When I click the Execute button under Try Out for GET requests, I get a 200 OK response, but with an error saying TypeError: Failed to fetch. I have attached a screenshot here.
I feel that the request URL mentioned here ( https://localhost:8243/hello/1.0.0 ) should have the EC2 server's IP address, instead of localhost , but I cannot find a way to modify that. What am I doing wrong here?
Output
Browser's Inspect Console Tab
The Swagger was not able to make the invocation, as it is getting refused. Try updating the API Gateway Environment configurations in the deployment.toml to the Hostnames / IP address (publicly accessible) of the EC2 instance.
Following is a sample TOML configuration of API Gateway Environments. Update the <change-this> with appropriate hostnames.
[[apim.gateway.environment]]
...
ws_endpoint = "ws://<change-this>:9099"
wss_endpoint = "wss://<change-this>:8099"
http_endpoint = "http://<change-this>:${http.nio.port}"
https_endpoint = "https://<change-this>:${https.nio.port}"
websub_event_receiver_http_endpoint = "http://<change-this>:9021"
websub_event_receiver_https_endpoint = "https://<change-this>:8021"
Once the configurations are done, restart the server and invoke the API from the Devportal Swagger UI.
I'm currently running MAMP Pro (osX 10.9.4) with several different virtual servers on my local machine, one for each of my client's projects. I've been trying to connect to the Google API use OAuth and have everything working just fine when 'REDIRECT URIS' is set to:
http://localhost:8888
However, as mentioned I've got several of these servers running,
e.g. 'https://clientname1:8890' or 'https://clientname2:8890'
Whenever I enter those into the API console I just get a 'Whoops' message telling me something has gone wrong Google's end:
"Server Error: Whoops! Our bad."
It seems as though only 'localhost' is allowed via the API for local testing, is there anyway I can set it up so I can test off any of my local servers?
I had to add my localhost to the allowed referrers list to test locally. Without that inclusion, I get 403 Forbidden errors. You probably just need to add clientname1 and clientname2 or clientname1:8890 and clientname2:8890 to the allowed referrers list in the Google Developers Console. Mine's set under public api access, so maybe it's going to be another problem for you depending what API you're using and how you're using it. Hope it helps -
I've created a Silverlight application that uses a service. The service is defined in the web project in that solution. The silverlight application references it and uses it.
Everything works locally on my dev machine when I run the application in Visual Studio.
I note that the url im given from VS is: http://localhost:50453/Default.htm
But when I deploy this (by filesystem copy deploy option) the web page starts and it looks okey except that it seems to have a problem using the service.
In the Silverlight application, if I look at the reference settings the url to the service is: http://localhost:50453/SilverlightService.svc and thats probably whats wrong, as the server that Im deploying to does not have a clue whats on port 50453.
So Im trying to change this port to 80 on my dev machine but Im out of luck. My web project does not have any property where I can change the port. Opened URL and URL is locked at http://localhost:50453 :-/
How can I change the my dev environment to match the production environment with port 80?
For sure you can change the web project's URL in project properties, but this is not a good solution because you'll get the same problems when accessing the SL application from a remote computer.
You need to set the service URL programmatically, like above:
ServiceReference1.Service1Client svc = new ServiceReference1.Service1Client();
Uri serviceUri = new Uri(System.Windows.Browser.HtmlPage.Document.DocumentUri, "Service1.svc");
svc.Endpoint.Address = new System.ServiceModel.EndpointAddress(serviceUri);
This solution uses the same URL that you are using to access the Silverlight Application.
Just trying to get fancy. I know I can do this by creating an app and putting a getQueryParam into a jsp file and forward like that.
But I wanted to see if this is possible.
I am working on an application that points to an xml datasource. So the URL on the server is simply "/safe" because it uses the app URL to go to (domain.com/safe). What I wanted to see if it was possible to create a mapping in tomcat 7 that allows (localhost/safe) to be forwarded or treated like (domain.com/safe).
so when editing my application locally I don't have to change the httpService back and forth
What you need to configure is virtual hosting. Read about this and the Host container in the official Tomcat documentation.
I need to put a crossdomain.xml file in my Windows Azure Web Role. But where ?
I tried to put it in : F:\sitesroot\0
But my Unity3D Web App says : Exception: Unable to connect, as no valid crossdomain policy was found.
I don't know what I am missing. Unity uses by default port (843).
Where to put the crossdomain.xml
Any help is welcome !
CrossDomainPolicy.xml must be at the root of your application.
If you are using single Web Role just add CrossDomainPolicy.xml at the root of your application and set it up correctly as below:
Depends on how many "sites" sections you have in your role's ServiceDefinition.csdef , you will get that many \sitesroot\0 and \sitesroot\1 and CrossDomainPolicy.xml will be distributed to all depend on your role solution settings.
Once I discussed this in my following blog:
Silverlight front end calling to WCF Service, all in one Windows Azure Web Role Sample
You mentioned port 843, which sounds like it would need the Flash protocol, which is a TCP socket listener on port 843 that responds with the cross domain policy when it receives the text <policy-file-request/>. Do you need to be doing that? Does your app use sockets?
Avkash's answer is correct for where the XML file should go if you just need to serve it via port 80 from your web app, but if you need to do raw sockets, you'll need to be running something on the server that handles that.