Skip to content
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

Prometheus pack is misconfigured #160

Open
AAverin opened this issue Oct 1, 2023 · 1 comment
Open

Prometheus pack is misconfigured #160

AAverin opened this issue Oct 1, 2023 · 1 comment

Comments

@AAverin
Copy link

AAverin commented Oct 1, 2023

Prometheus pack has hardcoded paths to local/config that don't exist on the configured volume. Configured volume is not used correctly in the template.

@AAverin
Copy link
Author

AAverin commented Oct 4, 2023

Took some time to figure this out. The way local/config should be better explained and documented.
Missing part is this pre-task that will make sure prometheus uid/gid will have access to the mounted volume.

# Prometheus running in its own uid:gid doesn't have access to mounted volume by default
    # Running pre-task to change ownership
    # https://github.com/hashicorp/nomad/issues/8892
    # https://github.com/prometheus/prometheus/issues/5976
    task "prep-disk" {
      driver = "docker"
      volume_mount {
        volume      = "prometheus"
        destination = "/prometheus"
        read_only   = false
      }
      config {
        image        = "busybox:latest"
        command      = "sh"
        args         = ["-c", "chown -R 65534:65534 /prometheus"]
      }
      resources {
        cpu    = 200
        memory = 128
      }

      lifecycle {
        hook    = "prestart"
        sidecar = false
      }
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant