question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

kafka-manager does not work when deployed in subpath.

See original GitHub issue

When deployed using subpath the image isn’t working as the urls and js in the index.html are absolute.

So what I did is a kubernetes deployment with a ingress controller which basically creates a nginx reverse proxy on a subpath.

E.g. http://development.myenvironment.com/kafka-manager/

Failed to load resource: the server responded with a status of 404 (Not Found)
/vassets/stylesheets/2b56540dba204490b0a8b01818b05991-index.min.css Failed to load resource: the server responded with a status of 404 (Not Found)
bootstrap.min.css Failed to load resource: the server responded with a status of 404 (Not Found)
c7d17af297af222b85192c2df48b8390-chartist.min.js Failed to load resource: the server responded with a status of 404 (Not Found)
/vassets/chartist/stylesheets/0dd8d6c6dca261528d9be38904d656d3-chartist.min.css Failed to load resource: the server responded with a status of 404 (Not Found)
jquery.min.js Failed to load resource: the server responded with a status of 404 (Not Found)
/vassets/chartist/stylesheets/0dd8d6c6dca261528d9be38904d656d3-chartist.min.css Failed to load resource: the server responded with a status of 404 (Not Found)
/vassets/dataTables/stylesheets/49765a39721f9ac7365f6a01962c52ef-dataTables.bootstrap.css Failed to load resource: the server responded with a status of 404 (Not Found)
/vassets/stylesheets/2b56540dba204490b0a8b01818b05991-index.min.css Failed to load resource: the server responded with a status of 404 (Not Found)
c7d17af297af222b85192c2df48b8390-chartist.min.js Failed to load resource: the server responded with a status of 404 (Not Found)
bootstrap.min.js Failed to load resource: the server responded with a status of 404 (Not Found)
280ff6aaaba888ccb486e669fd200b8e-jquery.dataTables.min.js Failed to load resource: the server responded with a status of 404 (Not Found)
8e519890a2e2499da2b753c65a5dc27c-dataTables.bootstrap.js Failed to load resource: the server responded with a status of 404 (Not Found)
2af62f58ee2baf495c9b3a9a1c30ce03-favicon.png Failed to load resource: the server responded with a status of 404 (Not Found)
jquery.min.js Failed to load resource: the server responded with a status of 404 (Not Found)
bootstrap.min.js Failed to load resource: the server responded with a status of 404 (Not Found)
280ff6aaaba888ccb486e669fd200b8e-jquery.dataTables.min.js Failed to load resource: the server responded with a status of 404 (Not Found)
8e519890a2e2499da2b753c65a5dc27c-dataTables.bootstrap.js Failed to load resource: the server responded with a status of 404 (Not Found)
bootstrap.min.css Failed to load resource: the server responded with a status of 404 (Not Found)
49765a39721f9ac7365f6a01962c52ef-dataTables.bootstrap.css Failed to load resource: the server responded with a status of 404 (Not Found)
2b56540dba204490b0a8b01818b05991-index.min.css Failed to load resource: the server responded with a status of 404 (Not Found)
0dd8d6c6dca261528d9be38904d656d3-chartist.min.css Failed to load resource: the server responded with a status of 404 (Not Found)

Is there a way to configure the image to run in a subpath of the url.

I also created the ticket on the repo of the docker image I am using. I hope someone knows if we can support this in an easy matter.

https://github.com/sheepkiller/kafka-manager-docker/issues/21

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:3
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
vxavictor513commented, Nov 16, 2019

Found a solution from https://github.com/yahoo/kafka-manager/issues/218.

  1. Overriding play.http.context using Java options.

     -Dplay.http.context=/kafka-manager/
    
  2. Configure load balancer rewrite rule so that it does not strip the subpath.


This works for stable/kafka-manager Helm chart too. Below is an example that uses NGINX ingress.

Note: livenessProbe.httpGet.path and readinessProbe.httpGet.path need to be appended with the subpath.

    livenessProbe:
      httpGet:
        path: /kafka-manager/api/health
        port: kafka-manager
      initialDelaySeconds: 60
      timeoutSeconds: 30
      failureThreshold: 10

    readinessProbe:
      httpGet:
        path: /kafka-manager/api/health
        port: kafka-manager

    javaOptions: '-Dplay.http.context=/kafka-manager/'

    ingress:
      enabled: true
      annotations:
        kubernetes.io/ingress.class: nginx
        nginx.ingress.kubernetes.io/rewrite-target: /kafka-manager/$2
      path: /kafka-manager(/|$)(.*)
      hosts:
        - sample.my-domain.com
0reactions
swathimocharlacommented, Jan 4, 2019

hi @marcofranssen , were you able to do this? I am trying to do the same for kafka-manager and access it via http://edge-node-ip/kafka-manager I am able to load kafka-manager’s UI. But there are 2 issues.

  1. The UI is not rendering correctly
  2. Clicking on any links like “add cluster” is redirecting to / from /kafka-manager
Read more comments on GitHub >

github_iconTop Results From Across the Web

kafka-manager does not work when deployed in subpath. #374
When deployed using subpath the image isn't working as the urls and js in the index.html are absolute. So what I did is...
Read more >
Issue with Vue application deployed to subdirectory when ...
Now, the issue I'm running into is that (after deploying a production build) when I visit /deploypath it works, however any other path...
Read more >
kafka-manager-docker - Bountysource
When deployed using subpath the image isn't working as the urls and js in the index.html are absolute. So what I did is...
Read more >
Guide: How To Deploy Preact from a Subdirectory
A step-by-step guide on how to deploy a Preact app from a nested subdirectory, with instructions on updating Webpack, preact-router, ...
Read more >
Spring | Programmatic Ponderings
In Part Two of this post, we will review how to deploy and run the storefront API components in a local development environment...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found