Skip to content

Commit

Permalink
Remove PowerDNS
Browse files Browse the repository at this point in the history
The PowerDNS package has not been updated since 2016. This commit
removes:
- package
- job
- all config values under `dns` except `domain_name`
- models under `src/bosh-director/lib/bosh/director/models/dns/`
  - all mention or use of `dns_db` which was a separate database
    configuration for these models

[#183367522]
  • Loading branch information
aramprice committed Feb 24, 2024
1 parent 23b5e39 commit 10135a6
Show file tree
Hide file tree
Showing 54 changed files with 34 additions and 1,203 deletions.
4 changes: 0 additions & 4 deletions config/blobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ postgres/postgresql-15.6.tar.gz:
size: 30299236
object_id: 8cc25480-8de8-4f0b-56a2-b359ff6838dc
sha: sha256:3a08314af1714671213a8a4f6bd646d0b1cdc94b029e8988944ab04d4b8cf2d2
powerdns/pdns-static_3.3.1-1_amd64.deb:
size: 9353694
object_id: 6e861aa6-2e83-4027-a1e8-0ebec995c274
sha: 22bb46aa0b3e7671e0ee9aa30ed95c38841106ab
s3cli/s3cli-0.0.271-linux-amd64:
size: 18505101
object_id: c522f7df-db20-4418-6207-f227e7c8874a
Expand Down
26 changes: 0 additions & 26 deletions jobs/director/spec
Original file line number Diff line number Diff line change
Expand Up @@ -336,35 +336,9 @@ properties:
default: false

# DNS
dns.address:
description: Address of the powerdns server
dns.domain_name:
description: TLD of the dns zone used by bosh
default: bosh
dns.db.adapter:
description: DNS Database adapter
default: postgres
dns.db.user:
description: DNS Database user
default: bosh
dns.db.password:
description: DNS Database password
dns.db.host:
description: DNS Database host
default: 127.0.0.1
dns.db.port:
description: Port that the powerdns database listens on
default: 5432
dns.db.database:
description: Name of the powerdns database
default: bosh
dns.db.connection_options:
description: |
Additional options for the powerdns database.
The below default applies to postgres databases. For config options for mysql dbs, refer to the mysql2 gem options.
default:
max_connections: 32 #Maximum size of the connection pool
pool_timeout: 10 #Number of seconds to wait if a connection cannot be acquired before raising an error

# Events
director.events.record_events:
Expand Down
26 changes: 2 additions & 24 deletions jobs/director/templates/director.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -169,32 +169,10 @@ params['scan_and_fix'] = {
'auto_fix_stateful_nodes' => p('director.auto_fix_stateful_nodes')
}

if_p('dns.db.adapter', 'dns.db.user', 'dns.db.password', 'dns.db.host',
'dns.db.port', 'dns.db.database', 'dns.db.connection_options', 'dns.address') do
|adapter, user, password, db_host, port, database, connection_options, address|
if_p('dns.domain_name') do |domain_name|
params['dns'] = {
'server' => address,
'flush_command' => '/var/vcap/jobs/powerdns/bin/powerdns_ctl flush',
'db' => {
'adapter' => adapter,
'user' => user,
'password' => password,
'host' => db_host,
'port' => port,
'database' => database,
'connection_options' => connection_options
}
'domain_name' => domain_name
}

if_p('dns.domain_name') do |domain_name|
params['dns']['domain_name'] = domain_name
end
end.else do
if_p('dns.domain_name') do |domain_name|
params['dns'] = {
'domain_name' => domain_name
}
end
end

if p('blobstore.provider') == 's3'
Expand Down
5 changes: 0 additions & 5 deletions jobs/powerdns/monit

This file was deleted.

53 changes: 0 additions & 53 deletions jobs/powerdns/spec

This file was deleted.

1 change: 0 additions & 1 deletion jobs/powerdns/spec.yml

This file was deleted.

44 changes: 0 additions & 44 deletions jobs/powerdns/templates/pdns.conf.erb

This file was deleted.

37 changes: 0 additions & 37 deletions jobs/powerdns/templates/powerdns_ctl.erb

This file was deleted.

10 changes: 0 additions & 10 deletions packages/powerdns/packaging

This file was deleted.

4 changes: 0 additions & 4 deletions packages/powerdns/spec

This file was deleted.

1 change: 0 additions & 1 deletion packages/powerdns/spec.yml

This file was deleted.

5 changes: 2 additions & 3 deletions spec/director.yml.erb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,10 @@
end
end

context 'when domain name specified without all other dns properties' do
context 'when dns.domain_name specified' do
before do
merged_manifest_properties['dns'] = {
'domain_name' => 'domain.name'
'domain_name' => 'fake.domain.name'
}
end

Expand Down Expand Up @@ -617,7 +617,6 @@
let(:erb_yaml) { File.read(File.join(File.dirname(__FILE__), '../jobs/director/templates/director.yml.erb')) }

subject(:parsed_yaml) do

binding = Bosh::Template::EvaluationContext.new(
{
'job' => {'name' => 'i_like_bosh'},
Expand Down
7 changes: 2 additions & 5 deletions src/bosh-dev/lib/bosh/dev/sandbox/main.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ def initialize(db_opts, debug, test_env_number)

@logger.level = ENV.fetch('LOG_LEVEL', 'DEBUG')

@dns_db_path = sandbox_path('director-dns.sqlite')
@task_logs_dir = sandbox_path('boshdir/tasks')
@blobstore_storage_dir = sandbox_path('bosh_test_blobstore')
@verify_multidigest_path = File.join(REPO_ROOT, 'tmp', 'verify-multidigest', 'verify-multidigest')
Expand Down Expand Up @@ -278,7 +277,6 @@ def stop

@sandbox_log_file.close unless @sandbox_log_file == STDOUT

FileUtils.rm_f(dns_db_path)
FileUtils.rm_rf(agent_tmp_path)
FileUtils.rm_rf(blobstore_storage_dir)
end
Expand All @@ -289,9 +287,8 @@ def run

loop { sleep 60 }

# rubocop:disable HandleExceptions
rescue Interrupt
# rubocop:enable HandleExceptions
# Ignored
ensure
stop
@logger.info('Stopped sandbox')
Expand Down Expand Up @@ -580,6 +577,6 @@ def get_nats_client_ca_private_key_path
File.join(SANDBOX_ASSETS_DIR, 'nats_server', 'certs', 'rootCA.key')
end

attr_reader :director_tmp_path, :dns_db_path, :task_logs_dir
attr_reader :director_tmp_path, :task_logs_dir
end
end
4 changes: 1 addition & 3 deletions src/bosh-director/bin/bosh-director-migrate
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,9 @@ director_db = config.db
# Configure the singleton for migrations that need access to this config. There does not appear
# to be a way to pass additional data or objects into Sequel gem migrations.
if director_db.table_exists?(:releases)
config.configure_evil_config_singleton!(preload_db_classes: false)
config.configure_evil_config_singleton!
end
abort 'Director database config missing from config file' unless director_db
dns_db = config.dns_db

DBMigrator.new(director_db, :director).migrate
DBMigrator.new(dns_db, :dns).migrate
DBMigrator.new(director_db, :cpi, cpi: config.cpi).migrate
25 changes: 0 additions & 25 deletions src/bosh-director/db/migrations/dns/20120123234908_initial.rb

This file was deleted.

1 change: 0 additions & 1 deletion src/bosh-director/lib/bosh/director.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ module Director
require 'bosh/director/dns/dns_encoder'
require 'bosh/director/dns/local_dns_encoder_manager'
require 'bosh/director/dns/local_dns_manager'
require 'bosh/director/dns/power_dns_manager'
require 'bosh/director/dns/dns_records'
require 'bosh/director/errors'
require 'bosh/director/ext'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
module Bosh::Director
module Api::Controllers
class InfoController < BaseController
def initialize(config)
super(config)
@powerdns_manager = PowerDnsManagerProvider.create
end

def requires_authentication?
false
Expand All @@ -27,10 +23,6 @@ def requires_authentication?
'status' => Config.local_dns_enabled?,
'extras' => { 'domain_name' => Config.root_domain },
},
'power_dns' => {
'status' => @powerdns_manager.dns_enabled?,
'extras' => { 'domain_name' => @powerdns_manager.root_domain },
},
'snapshots' => {
'status' => Config.enable_snapshots,
},
Expand Down
4 changes: 0 additions & 4 deletions src/bosh-director/lib/bosh/director/cloudcheck_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ def recreate_vm(instance_model, wait_for_running = true)
true,
)

powerdns_manager = PowerDnsManagerProvider.create
local_dns_manager = LocalDnsManager.create(Config.root_domain, @logger)
dns_names_to_ip = {}

Expand Down Expand Up @@ -103,11 +102,8 @@ def recreate_vm(instance_model, wait_for_running = true)
end

@logger.debug("Updating DNS record for instance: #{instance_model.inspect}; to: #{dns_names_to_ip.inspect}")
powerdns_manager.update_dns_record_for_instance(instance_model, dns_names_to_ip)
local_dns_manager.update_dns_record_for_instance(instance_plan_to_create)

powerdns_manager.flush_dns_cache

cloud_check_procedure = lambda do
blobstore_client = App.instance.blobstores.blobstore

Expand Down
Loading

0 comments on commit 10135a6

Please sign in to comment.