Skip to content

Accessing CrateDB Admin UI behind Ingress #777

Open

Description

@arjun289

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?

Activity

  1. amotl commented on Sep 14, 2022

    @amotl
    Contributor

    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]

    .factory('baseURI', function() {
    var baseURI = {};
    baseURI.getWindowLocation = function() {
    return window.location;
    };
    baseURI.getURI = function(path) {
    var basePath;
    var loc = baseURI.getWindowLocation();
    var uriParam = loc.search.match(/([\?|&])base_uri=([^&]+)/);
    if (!uriParam) {
    basePath = loc.protocol + '//' + loc.host + loc.pathname;
    } else {
    basePath = uriParam[2];
    }
    // remove trailing slash from base path and append path
    return basePath.replace(/\/+$/, '') + path;
    };
    return baseURI;
    })

  2. amotl commented on Sep 14, 2022

    @amotl
    Contributor

    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.

    Footnotes

    1. https://github.com/crate/cratedb-examples/tree/main/spikes/http-api-behind-nginx ↩

    2. https://github.com/crate/cratedb-examples/blob/main/spikes/http-api-behind-nginx/nginx.conf ↩

  3. amotl commented on Sep 29, 2022

    @amotl
    Contributor

    Dear Arjun,

    are the resources referenced above helpful to you?

    With kind regards,
    Andreas.

  4. amotl commented on Apr 3, 2026

    @amotl
    Contributor

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

    Hi again. @Kleinjohann contributed an improvement in this area just recently, in this case to the Python driver.

    I am also exploring similar details with vanilla Nginx, where I selected the /c URL path to serve CrateDB from. If there is anything you feel unanswered about, please let us know. On the other hand, we are interested if you have been able to make progress with a corresponding Ingress configuration. 🙏

    /cc @goat-ssh, @WalBeh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions