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 to set up HAProxy as load balancing solution #100

Closed
arifcse019 opened this Issue Mar 13, 2017 · 13 comments

Comments

Projects
None yet
3 participants
@arifcse019

arifcse019 commented Mar 13, 2017

Hi,

There is an option in the openshift ansible palybook to setup HAProxy as a load balancer in a multi master cluster https://docs.openshift.org/latest/install_config/install/advanced_install.html#multiple-masters. Can we have something similar in this Chef cookbook?

Thanks
Arif

@IshentRas

This comment has been minimized.

Show comment
Hide comment
@IshentRas

IshentRas Mar 13, 2017

Owner

@arifcse019 We are working on it. Stay tuned. Good idea.

Owner

IshentRas commented Mar 13, 2017

@arifcse019 We are working on it. Stay tuned. Good idea.

@IshentRas

This comment has been minimized.

Show comment
Hide comment
@IshentRas

IshentRas Apr 29, 2017

Owner

Sorry for the delay putting that functionality in... Should not be long now.

Owner

IshentRas commented Apr 29, 2017

Sorry for the delay putting that functionality in... Should not be long now.

@arifcse019

This comment has been minimized.

Show comment
Hide comment
@arifcse019

arifcse019 Apr 30, 2017

Thanks for letting know, looking forward to it

arifcse019 commented Apr 30, 2017

Thanks for letting know, looking forward to it

@IshentRas

This comment has been minimized.

Show comment
Hide comment
@IshentRas
Owner

IshentRas commented May 21, 2017

@IshentRas

This comment has been minimized.

Show comment
Hide comment
@IshentRas

IshentRas May 21, 2017

Owner
  "lb_servers": [
    {
      "fqdn": "lb1-server.domain.local",
      "ipaddress": "1.1.1.4"
    },
  ],
Owner

IshentRas commented May 21, 2017

  "lb_servers": [
    {
      "fqdn": "lb1-server.domain.local",
      "ipaddress": "1.1.1.4"
    },
  ],
@ianmiell

This comment has been minimized.

Show comment
Hide comment
@ianmiell

ianmiell May 21, 2017

Collaborator

Is this required, or optional? Tests failed with:


================================================================================
Recipe Compile Error in /root/chef-solo-example/cookbooks/cookbook-openshift3/recipes/default.rb
================================================================================

NoMethodError
-------------
undefined method `find' for nil:NilClass

Cookbook Trace:
---------------
  /root/chef-solo-example/cookbooks/cookbook-openshift3/recipes/common.rb:16:in `from_file'
  /root/chef-solo-example/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/run_context.rb:347:in `load_recipe'
  /root/chef-solo-example/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/run_context.rb:303:in `block in include_recipe'
  /root/chef-solo-example/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/run_context.rb:302:in `each'
  /root/chef-solo-example/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/run_context.rb:302:in `include_recipe'
  /root/chef-solo-example/cookbooks/cookbook-openshift3/recipes/default.rb:36:in `from_file'
  /root/chef-solo-example/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/run_context.rb:347:in `load_recipe'

Relevant File Content:
----------------------
/root/chef-solo-example/cookbooks/cookbook-openshift3/recipes/common.rb:

  9:  
 10:  iptables_rule 'firewall_jump_rule' do
 11:    action :enable
 12:  end
 13:  
 14:  lb_servers = node['cookbook-openshift3']['lb_servers']
 15:  
 16>> if lb_servers.find { |lb| lb['fqdn'] == node['fqdn'] }
 17:    package 'haproxy'
 18:  
 19:    node['cookbook-openshift3']['enabled_firewall_rules_lb'].each do |rule|
 20:      iptables_rule rule do
 21:        action :enable
 22:      end
 23:    end
 24:  
 25:    directory '/etc/systemd/system/haproxy.service.d' do

[2017-05-21T19:50:04+00:00] ERROR: Running exception handlers
[2017-05-21T19:50:04+00:00] ERROR: Exception handlers complete
[2017-05-21T19:50:04+00:00] FATAL: Stacktrace dumped to /root/chef-solo-example/cache/chef-stacktrace.out
[2017-05-21T19:50:04+00:00] ERROR: undefined method `find' for nil:NilClass
[2017-05-21T19:50:04+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
Collaborator

ianmiell commented May 21, 2017

Is this required, or optional? Tests failed with:


================================================================================
Recipe Compile Error in /root/chef-solo-example/cookbooks/cookbook-openshift3/recipes/default.rb
================================================================================

NoMethodError
-------------
undefined method `find' for nil:NilClass

Cookbook Trace:
---------------
  /root/chef-solo-example/cookbooks/cookbook-openshift3/recipes/common.rb:16:in `from_file'
  /root/chef-solo-example/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/run_context.rb:347:in `load_recipe'
  /root/chef-solo-example/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/run_context.rb:303:in `block in include_recipe'
  /root/chef-solo-example/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/run_context.rb:302:in `each'
  /root/chef-solo-example/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/run_context.rb:302:in `include_recipe'
  /root/chef-solo-example/cookbooks/cookbook-openshift3/recipes/default.rb:36:in `from_file'
  /root/chef-solo-example/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/run_context.rb:347:in `load_recipe'

Relevant File Content:
----------------------
/root/chef-solo-example/cookbooks/cookbook-openshift3/recipes/common.rb:

  9:  
 10:  iptables_rule 'firewall_jump_rule' do
 11:    action :enable
 12:  end
 13:  
 14:  lb_servers = node['cookbook-openshift3']['lb_servers']
 15:  
 16>> if lb_servers.find { |lb| lb['fqdn'] == node['fqdn'] }
 17:    package 'haproxy'
 18:  
 19:    node['cookbook-openshift3']['enabled_firewall_rules_lb'].each do |rule|
 20:      iptables_rule rule do
 21:        action :enable
 22:      end
 23:    end
 24:  
 25:    directory '/etc/systemd/system/haproxy.service.d' do

[2017-05-21T19:50:04+00:00] ERROR: Running exception handlers
[2017-05-21T19:50:04+00:00] ERROR: Exception handlers complete
[2017-05-21T19:50:04+00:00] FATAL: Stacktrace dumped to /root/chef-solo-example/cache/chef-stacktrace.out
[2017-05-21T19:50:04+00:00] ERROR: undefined method `find' for nil:NilClass
[2017-05-21T19:50:04+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
@arifcse019

This comment has been minimized.

Show comment
Hide comment
@arifcse019

arifcse019 May 22, 2017

@IshentRas great, thanks a lot! FYI @urbanchaosmnky, the load balancer feature is in!

arifcse019 commented May 22, 2017

@IshentRas great, thanks a lot! FYI @urbanchaosmnky, the load balancer feature is in!

@IshentRas

This comment has been minimized.

Show comment
Hide comment
@IshentRas

IshentRas May 22, 2017

Owner

@ianmiell Fixed by new version https://github.com/IshentRas/cookbook-openshift3/blob/master/CHANGELOG.md#v11051
Thanks for spotting this one. (Tests are useful 👍 )

Owner

IshentRas commented May 22, 2017

@ianmiell Fixed by new version https://github.com/IshentRas/cookbook-openshift3/blob/master/CHANGELOG.md#v11051
Thanks for spotting this one. (Tests are useful 👍 )

@ianmiell

This comment has been minimized.

Show comment
Hide comment
@ianmiell

ianmiell May 22, 2017

Collaborator
Collaborator

ianmiell commented May 22, 2017

@ianmiell

This comment has been minimized.

Show comment
Hide comment
@ianmiell

ianmiell May 22, 2017

Collaborator
Collaborator

ianmiell commented May 22, 2017

@IshentRas

This comment has been minimized.

Show comment
Hide comment
@IshentRas

IshentRas May 22, 2017

Owner

@ianmiell Fixed in new version 1.10.52 👍
{noformat}
rubocop -r cookstyle -D
Inspecting 60 files
............................................................

60 files inspected, no offenses detected
{noformat}

Owner

IshentRas commented May 22, 2017

@ianmiell Fixed in new version 1.10.52 👍
{noformat}
rubocop -r cookstyle -D
Inspecting 60 files
............................................................

60 files inspected, no offenses detected
{noformat}

@ianmiell

This comment has been minimized.

Show comment
Hide comment
@ianmiell

ianmiell May 24, 2017

Collaborator

Can this be closed now?

Collaborator

ianmiell commented May 24, 2017

Can this be closed now?

@arifcse019

This comment has been minimized.

Show comment
Hide comment
@arifcse019

arifcse019 May 24, 2017

Works like a charm, thanks!

arifcse019 commented May 24, 2017

Works like a charm, thanks!

@arifcse019 arifcse019 closed this May 29, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment