Skip to content
This repository has been archived by the owner on Jul 16, 2021. It is now read-only.

Support Helm deployment without Ingress controller #235

Closed
migmartri opened this issue Apr 13, 2017 · 1 comment · Fixed by #266
Closed

Support Helm deployment without Ingress controller #235

migmartri opened this issue Apr 13, 2017 · 1 comment · Fixed by #266
Labels

Comments

@migmartri
Copy link
Contributor

Currently, Monocular requires the use of an Ingress Controller by having /api as default. This was done in order to simplify the setup and avoid CORS issues.

We want to support deployment in which backend and frontend are in different hostnames.

  • Configure the UI to use this hostname for communications with the backend. This is currently supported (but not used) by passing the backendHostname property in the overrides.js. This file gets mapped using the config map ui-config.yaml. We need to extend this config map to read a new value in the values.yaml.

  • In the backend, whitelist the UI domain using the CORS configuration module. We also need to We add a new option in the values.yaml to define the UI hostname. For example frontendHostname.

CORS is currently configured in src/api/config/cors/cors.go. Currently it only whitelist everything if ENVIRONMENT=development. We should extend this to read the domain frontendHostname via env variables or command line flags.

Summarizing:

1 - Add frontendHostname and backendHostname properties in the values.yaml file.
2 - Change ui-config.yaml to expose backendHostname
3 - Modify src/api/config/cors/cors.go to whitelist frontendHostname

cc/ @ursuad @prydonius refs #234

@migmartri
Copy link
Contributor Author

@ursuad, as a workaround in the meantime you can:

1 - Change deployment/monocular/templates/ui-config.yaml to expose backendHostname

data:
  overrides.js: |-
    window.monocular = {
      overrides: {
        googleAnalyticsId: '{{.Values.ui.googleAnalyticsId}}',
        appName: '{{.Values.ui.appName}}',
        releasesEnabled: {{.Values.api.config.releasesEnabled}},
        backendHostname: "Your hostname or read it from values.yaml"
      }
    };

2 - Run the backend with the env variable ENVIRONMENT set to development (ENVIRONMENT=development) , NOTE this will whitelist all the domains allowing them to talk to the API. Basically disable CORS.

In deployment/monocular/templates/api-deployment.yaml

Add

... your pod definition...
         env:
         - name: ENVIRONMENT
           value: development

3 - Re-reploy

I hope it helps.

prydonius pushed a commit to prydonius/monocular that referenced this issue Jun 6, 2017
prydonius added a commit that referenced this issue Jun 7, 2017
* enable configuring CORS to remove same-domain requirement

fixes #235

* make backendHostname UI option configurable in chart
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant