Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove PowerDNS #2501

Merged
merged 2 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.279-linux-amd64:
size: 18496144
object_id: a4445869-9b78-431b-5448-11810142b89c
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Sequel.migration do
down do
alter_table(:instances) do
add_column :dns_records, String, text: true
end
end

up do
alter_table(:instances) do
drop_column :dns_records
end
end
end
25 changes: 0 additions & 25 deletions src/bosh-director/db/migrations/dns/20120123234908_initial.rb

This file was deleted.

3 changes: 2 additions & 1 deletion src/bosh-director/db/migrations/migration_digests.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,5 +160,6 @@
"20190325095716_remove_resurrection_paused": "546c855e7d2ee00a4f9867ab1d819847781a06de",
"20190327222054_scale_dns_blob_version": "2460bacc06eae7368d9322a97bfe781a10c59d3f",
"20210902232124_add_blobstore_and_nats_shas_to_vms": "34aaaf22c8e5074a96b2666f1bd30a2f41652e24",
"20230103143246_add_permanent_nats_credentials_to_vms": "a01b24aa3891d6bb0eb4e4032553d4e9871a19e0"
"20230103143246_add_permanent_nats_credentials_to_vms": "a01b24aa3891d6bb0eb4e4032553d4e9871a19e0",
"20240319204601_remove_dns_records_from_instances": "bb637d410772d09caabdb68a1126fbc9f9b4deec"
}
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 @@ -48,7 +48,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
Loading