Skip to content

Commit

Permalink
Merge pull request #309 from cloudfoundry/remove-garden-healthchecker
Browse files Browse the repository at this point in the history
Revert "Enable HTTP healthchecker for garden process"
  • Loading branch information
ameowlia authored Oct 30, 2023
2 parents b67f644 + 08ba52d commit 63ec368
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 116 deletions.
8 changes: 0 additions & 8 deletions jobs/garden/monit
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,3 @@ check process garden

group vcap
<% end %>

check process garden-healthchecker
with pidfile /var/vcap/sys/run/bpm/garden/garden-healthchecker.pid
start program "/var/vcap/jobs/bpm/bin/bpm start garden -p garden-healthchecker"
stop program "/var/vcap/jobs/bpm/bin/bpm stop garden -p garden-healthchecker"
if 1 restarts within 1 cycles then exec "/var/vcap/packages/garden-runc-healthchecker/bin/restart-monit-job garden <%= p('healthchecker.failure_counter_file') %>"
depends on garden
group vcap
5 changes: 0 additions & 5 deletions jobs/garden/spec
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ templates:
bin/containerd_utils.erb: bin/containerd_utils
bin/pre-start: bin/pre-start
bin/post-start: bin/post-start
config/healthchecker.yml.erb: config/healthchecker.yml

packages:
- guardian
Expand Down Expand Up @@ -309,7 +308,3 @@ properties:
logging.format.timestamp:
description: "Format for timestamp in component logs. Valid values are 'unix-epoch' and 'rfc3339'."
default: "unix-epoch"

healthchecker.failure_counter_file:
description: "File used by the healthchecker to monitor consecutive failures."
default: /var/vcap/data/garden/counters/consecutive_healthchecker_failures.count
36 changes: 0 additions & 36 deletions jobs/garden/templates/bin/restart-garden.erb

This file was deleted.

13 changes: 0 additions & 13 deletions jobs/garden/templates/config/bpm.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,3 @@ processes:
shared: true
writable: true
<%- } } -%>
- name: garden-healthchecker
executable: /var/vcap/packages/garden-runc-healthchecker/bin/healthchecker
args:
- -c
- /var/vcap/jobs/garden/config/healthchecker.yml
additional_volumes:
<%- if p('garden.listen_network') == "unix" -%>
- path: /var/vcap/data/garden/garden.sock
writable: true
mount_only: true
<%- end -%>
- path: <%= File.dirname(p('healthchecker.failure_counter_file')) %>
writable: true
25 changes: 0 additions & 25 deletions jobs/garden/templates/config/healthchecker.yml.erb

This file was deleted.

30 changes: 1 addition & 29 deletions spec/jobs/garden_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,6 @@
expect(rendered_template['server']['cpu-entitlement-per-share']).to eql(0)
end

context 'healthchecker' do
let(:template) { job.template('config/healthchecker.yml') }
let(:rendered_template) { YAML.load(template.render(properties)) }

it 'parses out the correct health endpoint' do
expect(rendered_template['healthcheck_endpoint']).to eql({
'socket' => '/var/vcap/data/garden/garden.sock',
'path' => '/ping',
})
end
end

context 'cpu throttling' do
context 'by default' do
it 'sets the enable cpu throttling per share to false' do
Expand Down Expand Up @@ -239,34 +227,18 @@
end

context 'with a listen address' do
before do
it 'switches to a listen address and port' do
properties.merge!(
'garden' => {
'listen_network' => 'tcp',
'listen_address' => '127.0.0.1:5555'
}
)
end

it 'switches to a listen address and port' do
rendered_template = IniParse.parse(template.render(properties))
expect(rendered_template['server']['bind-ip']).to eql('127.0.0.1')
expect(rendered_template['server']['bind-port']).to eql(5555)
end

context 'healthchecker' do
let(:template) { job.template('config/healthchecker.yml') }
let(:rendered_template) { YAML.load(template.render(properties)) }

it 'parses out the correct health endpoint' do
expect(rendered_template['healthcheck_endpoint']).to eql({
'port' => 5555,
'host' => '127.0.0.1',
'path' => '/ping',
})
end
end

# it 'throws an exception if the ip is invalid' do
# properties.merge!({
# 'garden' => {
Expand Down

0 comments on commit 63ec368

Please sign in to comment.