How to enable CORS in OpenShift 4 or ROSA

Solution Verified - Updated -

Environment

  • Red Hat OpenShift Container Platform (RHOCP)
    • 4
  • Red Hat OpenShift Service in AWS (ROSA)

Issue

  • How to enable CORS in OpenShift 4
  • Is it possible to enable CORS in OCP 4?

Resolution

OpenShift 4 (RHOCP)

Refer to the documentation to enable access to the API server or the OAuth server from a JavaScript application using a different hostname: "Allowing JavaScript-based access to the API server from additional hosts".

ROSA

This feature is not supported.

Root Cause

The default OCP configuration only allows the OpenShift web console to send requests to the API server.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments