Locust UI not rendering properly due to 404 responses for static files e.g. https://locust.test.mywebsite.com/static/jquery.tools.min.js

28 views Asked by At

Locust is deployed using helm-chart version 0.31.5 from deliveryhero. I enabled the ingress and in my k8s cluster, aws-loadbalancer-controller successfully creates the required ALB listener and Target Group to facilitate access to the UI via browser. Meanwhile external-dns creates a Route 53 DNS A record e.g. locust.test.mywebsite.com mapped to the ALB DNS and I can access the UI in a browser with the URL https://locust.test.mywebsite.com....but the page renders without the benefit of the css, js or image files.

Its evident that the browser has requested these files but the requests have resulted in a 404 e.g. https://locust.test.mywebsite.com/static/jquery.tools.min.js -> 404 Not Found

In the leader container, I can see the files are available in this directory: /opt/venv/lib/python3.10/site-packages/locust/static. This is the ingress configuration i've applied.

ingress:
  enabled: true
  annotations:
    alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:eu-west-1:REDACTED:certificate/2fc08733-cf52-4a05-8a6f-a1f6bb5e9d0a
    alb.ingress.kubernetes.io/group.name: internal-support
    alb.ingress.kubernetes.io/healthcheck-interval-seconds: '10'
    alb.ingress.kubernetes.io/healthcheck-path: /
    alb.ingress.kubernetes.io/healthcheck-port: traffic-port
    alb.ingress.kubernetes.io/healthcheck-timeout-seconds: '5'
    alb.ingress.kubernetes.io/healthy-threshold-count: '2'
    alb.ingress.kubernetes.io/listen-ports: '[{"HTTPS":443}]'
    alb.ingress.kubernetes.io/load-balancer-name: locust-internal-support
    alb.ingress.kubernetes.io/scheme: internal
    alb.ingress.kubernetes.io/ssl-policy: ELBSecurityPolicy-TLS-1-2-2017-01
    alb.ingress.kubernetes.io/target-type: ip
    alb.ingress.kubernetes.io/unhealthy-threshold-count: '2'
    kubernetes.io/ingress.class: alb
    kubernetes.io/tls-acme: 'true'
    external-dns.alpha.kubernetes.io/instance: internal-test
  hosts:
    - host: locust.test.mywebsite.com
      pathType: ImplementationSpecific
      path: /

The UI renders fine if I use port forwarding e.g.

kubectl port-forward svc/locust -n testing 8080:8089

....and subsequently in browser: http://localhost:8080/

0

There are 0 answers