Skip to content

Coder not fetching resources behind Ingress Controller in Fanout #768

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
trobert2 opened this issue Jun 13, 2019 · 1 comment
Closed

Coder not fetching resources behind Ingress Controller in Fanout #768

trobert2 opened this issue Jun 13, 2019 · 1 comment
Labels
bug Something isn't working

Comments

@trobert2
Copy link

trobert2 commented Jun 13, 2019

  • code-server 1.1140-vsc1.33.1:
  • OS Version: debian 9 stretch

Description

When running multiple coder instances in fanout, the resources cannot be fetched.
Errors from console:

GET https://coder.tools.aws.cps.vodafone.com/ide.main.0dbbd1.css net::ERR_ABORTED 404
wef4jr85v-python:36 GET https://coder.tools.aws.cps.vodafone.com/ide.main.0dbbd1.js net::ERR_ABORTED 404
wef4jr85v-python:7 GET https://coder.tools.aws.cps.vodafone.com/ide.1.0dbbd1.js net::ERR_ABORTED 404
wef4jr85v-python:36 GET https://coder.tools.aws.cps.vodafone.com/ide.main.0dbbd1.js net::ERR_ABORTED 404
manifest.2d6501a9cec51964cb818234b83e7c94.json:1 GET https://coder.tools.aws.cps.vodafone.com/manifest.2d6501a9cec51964cb818234b83e7c94.json 404

Steps to Reproduce

Deploy on kubernetes. Expose ingress like this example

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    kubernetes.io/ingress.allow-http: "false"
    nginx.ingress.kubernetes.io/app-root: /python
    nginx.ingress.kubernetes.io/auth-signin: https://$host/oauth2/start
    nginx.ingress.kubernetes.io/auth-url: https://$host/oauth2/auth
    nginx.ingress.kubernetes.io/cors-allow-credentials: "true"
    nginx.ingress.kubernetes.io/cors-allow-methods: PUT, GET, POST, OPTIONS
    nginx.ingress.kubernetes.io/cors-allow-origin: https://coder.my.dns.company.com
    nginx.ingress.kubernetes.io/enable-cors: "true"
    nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
    nginx.ingress.kubernetes.io/rewrite-target: /
  labels:
    app: coder
    flavour: python
  name: python-coder
  namespace: coder
spec:
  rules:
  - host: coder.my.dns.company.com
    http:
      paths:
      - backend:
          serviceName: python-coder
          servicePort: 8443
        path: /python
  tls:
  - hosts:
    - coder.my.dns.company.com
    secretName: coder-tls-secret

I have also tried this without success:

    nginx.ingress.kubernetes.io/configuration-snippet: |
      sub_filter_once on;
      sub_filter '<base href="/"' '<base href="/python/"';

If I define a path /* I have gotten it to work. The problem is the resources are being fetched from random sources since I have defined multiple coder instances and this path is on all definitions for that hostname. For example I would have deployed coder under /python with python tools, /go with golang tools and so on. In this scenario I have seen ide.main.0dbbd1.css being fetched from the go coder instance when I loaded python

Reading more into this I think it's related to the paths used. They should be relative and not include /.
Source: https://stackoverflow.com/questions/50871970/kubernetes-ingress-nginx-loading-resources-404

any help would be appreciated.

@trobert2
Copy link
Author

trobert2 commented Jun 13, 2019

Duplicate of #670

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant