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

Feature/#18850 Add internal virtual ips #209

Open
wants to merge 34 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
18c42c1
Adding internal virtual IPs
rgomezborder Oct 7, 2024
6e8191f
Passing sync_interface to keepalived
rgomezborder Oct 8, 2024
78e9904
Merge branch 'master' into feature/#18850_add_internal_virtual_ips
rgomezborder Oct 8, 2024
179120a
Fixing hardcoing of iface in databags depending if service is interna…
rgomezborder Oct 8, 2024
3b2d727
There is no need to pass iface sync to keepalived
rgomezborder Oct 8, 2024
c4c492d
fix linter
rgomezborder Oct 8, 2024
abecbdc
Update CHANGELOG.md
rgomezborder Oct 8, 2024
837ce9c
Delete resources/libraries/open_kafka_port.rb
rgomezborder Oct 8, 2024
7a6ae57
Update metadata.rb
rgomezborder Oct 8, 2024
3b5494d
Update prepare_system.rb
rgomezborder Oct 8, 2024
489524d
Merge branch 'master' into feature/#18850_add_internal_virtual_ips
rgomezborder Oct 11, 2024
d37e20d
Fix conflicts
rgomezborder Oct 11, 2024
9c6520a
Fix conflict
rgomezborder Oct 11, 2024
b1a8ffc
Passing virtual_ips variable to postgresql
rgomezborder Oct 14, 2024
a344962
Removing redborder-postgresql service
rgomezborder Oct 25, 2024
af15fab
Merge branch 'master' into feature/#18850_add_internal_virtual_ips
rgomezborder Oct 25, 2024
54f3135
Fix conflicts
rgomezborder Oct 25, 2024
12089b6
Fix conflicts
rgomezborder Oct 25, 2024
cbebd92
Removing consul in postgresql custom mode
rgomezborder Oct 25, 2024
e1b4fe8
Removing redborder-postgresql
rgomezborder Oct 25, 2024
e332fce
Adding consul again
rgomezborder Oct 25, 2024
56ea39f
Fixing services
rgomezborder Oct 28, 2024
08918e8
Merge branch 'master' into feature/#18850_add_internal_virtual_ips
rgomezborder Nov 4, 2024
8fbd6e6
Merge branch 'master' into feature/#18850_add_internal_virtual_ips
rgomezborder Nov 11, 2024
2518bb3
Merge branch 'master' into feature/#18850_add_internal_virtual_ips
rgomezborder Nov 13, 2024
0945466
Merge remote-tracking branch 'origin/master' into feature/#18850_add_…
rgomezborder Nov 15, 2024
9ba71f7
Merge branch 'master' into feature/#18850_add_internal_virtual_ips
rgomezborder Nov 18, 2024
564e6fc
Changing order of postgresql cookbook
rgomezborder Nov 26, 2024
c5bd32f
Merge branch 'master' into feature/#18850_add_internal_virtual_ips
rgomezborder Dec 9, 2024
e01ac1f
Merge pull request #259 from redBorder/development
rgomezborder Dec 11, 2024
5bc008e
Merge branch 'master' into feature/#18850_add_internal_virtual_ips
rgomezborder Dec 11, 2024
de69edf
Merge pull request #260 from redBorder/development
manegron Dec 18, 2024
ea60d1d
Merge pull request #261 from redBorder/development
manegron Dec 18, 2024
42f58f0
Merge branch 'master' into feature/#18850_add_internal_virtual_ips
rgomezborder Jan 2, 2025
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
9 changes: 3 additions & 6 deletions resources/attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
default['redborder']['memory_services']['redborder-mem2incident'] = { 'count': 5, 'memory': 0 }
default['redborder']['memory_services']['redborder-monitor'] = { 'count': 5, 'memory': 0, 'max_limit': 20000 }
default['redborder']['memory_services']['redborder-nmsp'] = { 'count': 10, 'memory': 0 }
default['redborder']['memory_services']['redborder-postgresql'] = { 'count': 5, 'memory': 0 }
default['redborder']['memory_services']['snmp'] = { 'count': 5, 'memory': 0, 'max_limit': 10000 }
default['redborder']['memory_services']['webui'] = { 'count': 40, 'memory': 0 }
default['redborder']['memory_services']['zookeeper'] = { 'count': 20, 'memory': 0 }
Expand All @@ -101,7 +100,7 @@

# geoip has been removed because is not a service
default['redborder']['services_group']['full'] = %w(consul chef-server zookeeper memcached rsyslog kafka logstash s3
postgresql redborder-postgresql nginx webui rb-workers druid-broker
postgresql nginx webui rb-workers druid-broker
druid-historical druid-realtime druid-coordinator f2k
redborder-monitor sfacctd redborder-dswatcher mongodb
redborder-events-counter http2k redborder-mem2incident)
Expand All @@ -117,7 +116,7 @@
default['redborder']['services_group']['webui'] = %w(consul nginx webui rb-workers)
default['redborder']['services_group']['f2k'] = %w(consul f2k)
default['redborder']['services_group']['s3'] = %w(consul nginx s3)
default['redborder']['services_group']['postgresql'] = %w(consul postgresql redborder-postgresql)
default['redborder']['services_group']['postgresql'] = %w(consul postgresql)

default['redborder']['services'] = {}
default['redborder']['services']['chef-client'] = true
Expand Down Expand Up @@ -155,7 +154,6 @@
default['redborder']['services']['redborder-mem2incident'] = false
default['redborder']['services']['redborder-monitor'] = true
default['redborder']['services']['redborder-nmsp'] = false
default['redborder']['services']['redborder-postgresql'] = false
default['redborder']['services']['redborder-scanner'] = false
default['redborder']['services']['rsyslog'] = true
default['redborder']['services']['s3'] = false
Expand Down Expand Up @@ -199,7 +197,6 @@
default['redborder']['systemdservices']['redborder-mem2incident'] = ['redborder-mem2incident']
default['redborder']['systemdservices']['redborder-monitor'] = ['redborder-monitor']
default['redborder']['systemdservices']['redborder-nmsp'] = ['redborder-nmsp']
default['redborder']['systemdservices']['redborder-postgresql'] = ['redborder-postgresql']
default['redborder']['systemdservices']['redborder-scanner'] = ['redborder-scanner']
default['redborder']['systemdservices']['rsyslog'] = ['rsyslog']
default['redborder']['systemdservices']['s3'] = ['minio']
Expand All @@ -215,7 +212,7 @@
default['redborder']['druid']['historical']['maxsize'] = -1

# Virtual Ips
default['redborder']['manager']['virtual_ips'] = { external: [ { service: 'webui', deps: ['nginx'] }, { service: 'f2k' }, { service: 'sfacctd' }, { service: 'kafka' } ] }
default['redborder']['manager']['virtual_ips'] = { internal: [{ service: 'postgresql' }], external: [{ service: 'webui', deps: ['nginx'] }, { service: 'f2k' }, { service: 'sfacctd' }, { service: 'kafka' }] }

# Realtime
default['redborder']['druid']['realtime']['partition_num'] = 0
Expand Down
18 changes: 15 additions & 3 deletions resources/libraries/get_virtual_ip_info.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ def get_virtual_ip_info(managers)
hash['virtual'] = true
hash['run_anywhere'] = true
has_any_virtual_ip = true if hash['ip'] && manager_services[service['service']]
hash['iface'] = node['redborder']['management_interface']
if type.to_s == 'external'
hash['iface'] = node['redborder']['management_interface']
elsif type.to_s == 'internal'
hash['iface'] = node['redborder']['sync_interface']
end
if manager_services[service['service']]
all_deps_enabled = true
unless service['deps'].nil?
Expand All @@ -44,7 +48,11 @@ def get_virtual_ip_info(managers)
hash['run_anywhere'] = false
nodeservice = nil
managers.each do |m|
hash['iface'] = node['redborder']['management_interface']
if type.to_s == 'external'
hash['iface'] = node['redborder']['management_interface']
elsif type.to_s == 'internal'
hash['iface'] = node['redborder']['sync_interface']
end
run_anywhere_flag = false

if m.name == node.name
Expand All @@ -61,7 +69,11 @@ def get_virtual_ip_info(managers)

if nodeservice.nil?
managers.each do |m|
hash['iface'] = node['redborder']['management_interface']
if type.to_s == 'external'
hash['iface'] = node['redborder']['management_interface']
elsif type.to_s == 'internal'
hash['iface'] = node['redborder']['sync_interface']
end
run_anywhere_flag = false
run_anywhere_flag = m['redborder']['manager']['services']['overwrite'][service['service']] unless m['redborder']['manager']['services']['overwrite'].nil?
run_anywhere_flag = m['redborder']['manager']['services'][m['redborder']['manager']['mode']][service['service']] if run_anywhere_flag != true && !m['redborder']['manager']['services'][m['redborder']['manager']['mode']].nil?
Expand Down
34 changes: 17 additions & 17 deletions resources/recipes/configure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,23 @@
end
end

# Determine external
begin
external_services = data_bag_item('rBglobal', 'external_services')
rescue
external_services = {}
end

postgresql_config 'Configure postgresql' do
if manager_services['postgresql'] && external_services['postgresql'] == 'onpremise'
cdomain node['redborder']['cdomain']
ipaddress node['ipaddress_sync']
action [:add, :register]
else
action [:remove, :deregister]
end
end

zookeeper_config 'Configure Zookeeper' do
if manager_services['zookeeper']
port node['zookeeper']['port']
Expand Down Expand Up @@ -605,23 +622,6 @@
end
end

# Determine external
begin
external_services = data_bag_item('rBglobal', 'external_services')
rescue
external_services = {}
end

postgresql_config 'Configure postgresql' do
if manager_services['postgresql'] && external_services['postgresql'] == 'onpremise'
cdomain node['redborder']['cdomain']
ipaddress node['ipaddress_sync']
action [:add, :register]
else
action [:remove, :deregister]
end
end

s3_secrets = {}

begin
Expand Down
Loading