Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

Commit

Permalink
Merge of "Fix passing params to status server"
Browse files Browse the repository at this point in the history
Conflicts:
	cloud_controller/config/cloud_controller.yml
	tests

Change-Id: I39a8da8d509d153205d5b82c44ea63ee19322e07
  • Loading branch information
dieu authored and Patrick Bozeman committed Oct 28, 2011
1 parent 582e5f6 commit 4a54ead
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 6 deletions.
7 changes: 7 additions & 0 deletions cloud_controller/config/cloud_controller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,10 @@ runtimes:
python26:
version: 2.6.5

# Used for /healthz and /vars endpoints. If not provided random
# values will be generated on component start. Uncomment to use
# static values.
#status:
# port: 34500
# user: thin
# password: thin
12 changes: 9 additions & 3 deletions cloud_controller/config/final_stage/message_bus.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,15 @@

EM.next_tick do
NATS.start(:uri => AppConfig[:mbus]) do
options = {:type => 'CloudController', :config => AppConfig, :index => AppConfig[:index]}
options[:host] = CloudController.bind_address
VCAP::Component.register(options)
status_config = AppConfig[:status] || {}
VCAP::Component.register(:type => 'CloudController',
:host => CloudController.bind_address,
:index => AppConfig[:index],
:config => AppConfig,
:port => status_config[:port],
:user => status_config[:user],
:password => status_config[:password])

require File.join(File.expand_path('..', __FILE__), 'varz')
files = Dir.glob(Rails.root.join('app','subscriptions','*.rb'))
files.each { |fn| require(fn) }
Expand Down
8 changes: 8 additions & 0 deletions dea/config/dea.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,11 @@ runtimes:
version: 2.6.5
version_flag: '--version'
environment:

# Used for /healthz and /vars endpoints. If not provided random
# values will be generated on component start. Uncomment to use
# static values.
#status:
# port: 34501
# user: thin
# password: thin
9 changes: 8 additions & 1 deletion dea/lib/dea/agent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,14 @@ def run()
NATS.start(:uri => @nats_uri) do

# Register ourselves with the system
VCAP::Component.register(:type => 'DEA', :host => @local_ip, :config => @config, :index => @config['index'])
status_config = @config['status'] || {}
VCAP::Component.register(:type => 'DEA',
:host => @local_ip,
:index => @config['index'],
:config => @config,
:port => status_config['port'],
:user => status_config['user'],
:password => status_config['password'])

uuid = VCAP::Component.uuid

Expand Down
8 changes: 8 additions & 0 deletions health_manager/config/health_manager.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,11 @@ intervals:
# Time to wait before analyzing the state of an application that has been
# started/restarted
stable_state: 60

# Used for /healthz and /vars endpoints. If not provided random
# values will be generated on component start. Uncomment to use
# static values.
#status:
# port: 34502
# user: thin
# password: thin
6 changes: 5 additions & 1 deletion health_manager/lib/health_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -681,10 +681,14 @@ def configure_timers
end

def register_as_component
status_config = @config['status'] || {}
VCAP::Component.register(:type => 'HealthManager',
:host => VCAP.local_ip(@config['local_route']),
:index => @config['index'],
:config => @config)
:config => @config,
:port => status_config['port'],
:user => status_config['user'],
:password => status_config['password'])

# Initialize VCAP component varzs..
VCAP::Component.varz[:total_apps] = 0
Expand Down
8 changes: 7 additions & 1 deletion router/config/router.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ logging:
level: info
pid: /var/vcap/sys/run/router.pid

# Config for /varz and /healthz endpoints
# Used for /healthz and /vars endpoints. If not provided random
# values will be generated on component start. Uncomment to use
# static values.
#status:
# port: 34503
# user: thin
# password: thin

# Uncomment and set true to show requests-per-second stats for all aps not only top 10. If not specified or set false only 10 apps are shown
# expose_all_apps: true

0 comments on commit 4a54ead

Please sign in to comment.