openshift-evangelists / oc-cluster-wrapper

oc cluster up bash wrapper
Apache License 2.0
144 stars 72 forks source link

Enable CORS for cluster's inner URLs #88

Open cbeldacap opened 6 years ago

cbeldacap commented 6 years ago

I'd like to know if there is a command to enable specific URLs to use the cluster's rest API rather than localhost/127.0.0.1.

In my case, I'd like to use the OpenShift rest API from a web application (Angular5 in my case, but that's irrelevant) deployed in cluster itself.

Using the openshift executable, there is something like: openshift start --cors-allowed-origins=[]

Anything similar for this?

Thanks so much in advance and congrats for the great job 😄

Cristóbal

jorgemoralespou commented 6 years ago

You can create a plugin for it. example can be seen here: https://github.com/openshift-evangelists/oc-cluster-wrapper/blob/master/plugins.d/oc-console.local.plugin#L22

Maybe I should enable this by default.

cbeldacap commented 6 years ago

@jorgemoralespou is this supposed to be added at the time of getting the cluster up?

Something like:

oc-cluster up --configPatch ...

(?)

Thanks a lot for the quick feedback!