spinnaker: Spin-monitoring-daemon can't hit metrics endpoint on Gate

Title

spin-monitoring-daemon can’t hit metrics endpoint on Gate when configured via Halyard

Cloud Provider

Spinnaker running on Kubernetes deployed via halyard

Environment

1.2.2 halyard at least, I don’t see anything in 1.2.2 -> 1.4.2 that would have addressed this. I see the same issue on a non-halyard deployed gate instance that we backported the spin-monitoring-daemon to. That gate is running off v4.6.3

Feature Area

Spin-monitoring-daemon connecting to gate

Description

➜  gate git:(master) ✗ kk logs -f spin-gate-v000-kw3bw -n spinnaker-lab -c spin-monitoring-daemon
19:38:09 Loaded config from /opt/spinnaker-monitoring/config/spinnaker-monitoring.yml
19:38:09 Updating catalog from /opt/spinnaker-monitoring/registry at 1507232262
19:38:09 loading /opt/spinnaker-monitoring/registry/gate.yml
19:38:09 gate failed https://localhost/spectator/metrics with <urlopen error [Errno 111] Connection refused>
19:38:09 Collection times 8 (ms): {'gate': 8}
19:38:09 Starting Monitor
19:38:09 Starting HTTP server on host=0.0.0.0, port=8008

Here is my hal managed metrics config

/opt/spinnaker-monitoring/config # cat spinnaker-monitoring.yml
## WARNING
## This file was autogenerated, and _will_ be overwritten by Halyard.
## Any edits you make here _will_ be lost.

datadog:
  enabled: false
prometheus:
  enabled: true
  add_source_metalabels: true
stackdriver:
  enabled: false
period: 30
enabled: true

server:
  host: 0.0.0.0
  port: 8008

monitor:
  period: 30
  metric_store:
  - prometheus

# halconfig
/opt/spinnaker-monitoring/registry # cat gate.yml
## WARNING
## This file was autogenerated, and _will_ be overwritten by Halyard.
## Any edits you make here _will_ be lost.

metrics_url: https://localhost/spectator/metrics

Relevant part of the gate.yml

/opt/spinnaker/config # cat gate.yml
## WARNING
## This file was autogenerated, and _will_ be overwritten by Halyard.
## Any edits you make here _will_ be lost.

spectator:
  applicationName: ${spring.application.name}
  webEndpoint:
    enabled: true

Steps to Reproduce

Deploy spinnaker via halyard and set up spin-monitoring-daemon as a feature. All the services seem to be working minus gate, I noticed in the gate.yml in the registry folder that the metrics_url is missing the port number for the gate instance. That seems to be part of the problem. Another problem I haven’t been able to track down is that the gate process doesn’t seem to listen on localhost:8084 or 0.0.0.0:8084 which might be unrelated…

On our non-halyard managed gate install running the spinnaker monitoring sidecar, we do have a well formed metrics_url but are finding that gate is not returning the /spectator/metrics endpoint because it either is protected via auth, or something else weird is going on.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 20 (11 by maintainers)

Most upvoted comments

@seanpeters86 - Try adding

basicAuthEnabled: true
username: foo
password: bar

The fields are undocumented, but the code supports them: https://github.com/spinnaker/halyard/blob/master/halyard-deploy/src/main/java/com/netflix/spinnaker/halyard/deploy/spinnaker/v1/service/ServiceSettings.java#L52-L53

Note: this currently doesn’t work if you’re using LDAP as the authentication provider - fix for that is here, (but could use validation): https://github.com/spinnaker/gate/pull/664

👍