crate / crate-admin

The admin user interface for CrateDB.
Apache License 2.0
26 stars 18 forks source link

Accessing CrateDB Admin UI behind Ingress #777

Open arjun289 opened 1 year ago

arjun289 commented 1 year ago

I am running a cluster of 3 CrateDB nodes on Kubernetes. I have set up an ingress to access the admin UI on path /db. However, I think to access it on this path I probably need to do some configuration so static files are served from the /db path, or the requests are routed on this path. How to do this configuration?

amotl commented 1 year ago

Dear Arjun,

thank you for writing in.

In general, the Admin UI itself can be hosted on any path. However, it has to know about the CrateDB HTTP API endpoint, usually available at /_sql.

I have set up an ingress to access the admin UI on path /db.

I see. So, the HTTP API endpoint of CrateDB itself would also be available at /db/_sql?

At [1], I've referenced the utility function which computes the base URI used to access the database HTTP API. We will have to check if that would need corresponding adjustments.

With kind regards, Andreas.

[1] https://github.com/crate/crate-admin/blob/83e2a3aa8d7fbeb2dc07ae5255ae67a7ae3bfb7b/app/scripts/services/sql.js#L20-L40

amotl commented 1 year ago

Hi again,

I've added an example at ^1, which outlines how to configure Nginx to reverse-proxy the CrateDB HTTP API endpoint to the /db subdirectory. The nginx.conf is at ^2. Maybe you can use it as an inspiration to configure the K8s Ingress component appropriately.

With kind regards, Andreas.

amotl commented 1 year ago

Dear Arjun,

are the resources referenced above helpful to you?

With kind regards, Andreas.