cloudfoundry/cloud_controller_ng

Removing loggregator endpoints from advertised endpoints when unavailable

acrmp opened this issue · 1 comments

Issue

As operators adopt the shared nothing logging and metrics architecture they may at the same time want to disable the older firehose loggregator architecture. We're not sure how this should affect which endpoints the Cloud Controller should advertise.

Context

Currently the Cloud Controller advertises endpoints for the Loggregator Traffic Controller and Reverse Log Proxy Gateway in the root controller:

$ cf curl / | jq -r '.links | [.logging, .log_stream][] | .href'
wss://doppler.sys.example.com:443
https://log-stream.sys.example.com

The Traffic Controller endpoint is also advertised under /v2/info:

$ cf curl /v2/info | jq -r '.doppler_logging_endpoint'
wss://doppler.sys.yarn-519593.cf-app.com:443

As operators may choose to no longer deploy these components we're wondering what the Cloud Controller should serve in these responses.

  • The Cloud Controller could stop having entries for these endpoints altogether when they are not deployed.
  • The Cloud Controller could have entries but with null values as may be already the case for some endpoints.
  • The Cloud Controller could continue to return these endpoints even though they are not actually available.

We believe currently the Cloud Controller always advertises these endpoints.

We'd think we'd like to not return endpoints that don't exist. However we're not sure what the impact of doing so might be on clients that are looking at these fields?

CC @rroberts2222

Gerg commented

Looks like we already have a pattern for returning null for the root (/) endpoint:

def credhub_link
return if config.get(:credhub_api, :external_url).blank?
{ href: config.get(:credhub_api, :external_url) }
end
def routing_link
return if config.get(:routing_api).blank?
{ href: config.get(:routing_api, :url) }
end