hashicorp / nomad

Nomad is an easy-to-use, flexible, and performant workload orchestrator that can deploy a mix of microservice, batch, containerized, and non-containerized applications. Nomad is easy to operate and scale and has native Consul and Vault integrations.
https://www.nomadproject.io/
Other
14.81k stars 1.94k forks source link

Nomad UI: Service Health visualisation for Consul provided health checks #14882

Open fraenku opened 1 year ago

fraenku commented 1 year ago

Nomad version

1.4.1

Operating system and Environment details

Linux 3.10.0-1160.76.1.el7.x86_64 x86_64 (CentOS Linux release 7.9.2009 (Core))

Issue

With version 1.4.0 you introduced the ability to configure health checks for native Nomad services. This is also integrated into the UI with a nice visualisation of the history of the health-checks (by small green or red quadrandts).

However I would expect the same feature also when switching to consul as provider which is not the case: image

Reproduction steps

Submit a job with health-checks and consul as provider (which is the default)

Expected Result

I expect to see the health-check of the service and it's visualisation over time in the service-details-panel also in the case that I use consul as service-provider

Job file (if appropriate)

See here an example Here is the job-file `job "fail-service" { datacenters = ["isys_poc"]

type = "service"

group "fail-service" { count = 1

network {
  port "http" {
    to = 8080
    }
}

task "fail-service" {
  driver = "docker"
  config {
    image = "thobe/fail_service:v0.0.12"
    ports = ["http"]
  }

  service {
    name = "${TASK}"
    port = "http"
    check {
      name     = "fail_service health using http endpoint '/health'"
      port     = "http"
      type     = "http"
      path     = "/health"
      method   = "GET"
      interval = "10s"
      timeout  = "2s"
    }
  }

  env {
    HEALTHY_FOR    = -1 # Stays healthy forever
  }

  resources {
    cpu    = 100 # MHz
    memory = 256 # MB
  }
}

} }`

jrasell commented 1 year ago

Hi @fraenku and thanks for raising this issue. This is expected behaviour in the current Nomad context as neither the UI or the HTTP API understands how to proxy this type of request to the Consul API. There are also a number of configuration and scaling problems to understand and solve before having this sort of functionality.

The functionality within https://github.com/hashicorp/nomad/pull/14537 provided the ability to link out to the Consul UI if you have configured the UI block correctly.

I will mark this issue for further discussion as an enhancement, however, I do not believe this would be something that will be looked at in the near/medium time frame.

arion-hjortur-arnthorsson commented 1 year ago

We have nomad jobs with multiple Consul services and being able to quickly visualise status would be handy.

Even if the status would only be the latest, the history is nice but less important.

thatsk commented 1 year ago

I was in the impression also that consul's health check history will be visible in nomad UI and don't want to go to consul UI we can use nomad UI in one shot for all but seems like its not yet developed

thatsk commented 1 year ago

@jrasell Correct me if I am wrong if we use nomad native service discovery then it should show the history Correctly in the UI itself.

jrasell commented 1 year ago

@thatsk yes, health check statuses for services using Nomad naive service discovery will show in the Nomad UI.

thatsk commented 1 year ago

but not for consul and it still on roadmap