Skip to content

Commit

Permalink
release v1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jtimberman committed Dec 14, 2012
1 parent 3e76667 commit 6b7a212
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 19 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## v1.2.0:

* [COOK-1936] - use frontend / backend logic
* [COOK-1937] - cleanup for configurations
* [COOK-1938] - more flexibility for options
* [COOK-1939] - reloading haproxy is better than restarting
* [COOK-1940] - haproxy stats listen on 0.0.0.0 by default
* [COOK-1944] - improve haproxy performance

## v1.1.4:

* [COOK-1839] - add httpchk configuration to `app_lb` template
Expand Down
104 changes: 86 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,95 @@ Requirements
Attributes
==========

* `node['haproxy']['incoming_port']` - sets the port on which haproxy listens
* `node['haproxy']['member_port']` - the port that member systems will be listening on, default 80
* `node['haproxy']['enable_admin']` - whether to enable the admin interface. default true. Listens on port 22002.
* `node['haproxy']['app_server_role']` - used by the `app_lb` recipe to search for a specific role of member systems. Default `webserver`.
* `node['haproxy']['httpchk']` - used by the `app_lb` recipe. If set, will configure httpchk in haproxy.conf
* `node['haproxy']['ssl_httpchk']` - used by the `app_lb` recipe. If set and enable_ssl is true, will configure httpchk in haproxy.conf for the ssl_applicaiton section
* `node['haproxy']['balance_algorithm']` - sets the load balancing algorithm; defaults to roundrobin.
* `node['haproxy']['member_max_connections']` - the maxconn value to be set for each app server
* `node['haproxy']['x_forwarded_for']` - if true, creates an X-Forwarded-For header containing the original client's IP address. This option disables KeepAlive.
* `node['haproxy']['enable_ssl']` - whether or not to create listeners for ssl, default false
* `node['haproxy']['ssl_member_port']` - the port that member systems will be listening on for ssl, default 8443
* `node['haproxy']['ssl_incoming_port']` - sets the port on which haproxy listens for ssl, default 443
* `node['haproxy']['incoming_address']` - sets the address to bind the
haproxy process on, 0.0.0.0 (all addresses) by default
* `node['haproxy']['incoming_port']` - sets the port on which haproxy
listens
* `node['haproxy']['member_port']` - the port that member systems will
be listening on, default 80
* `node['haproxy']['app_server_role']` - used by the `app_lb` recipe
to search for a specific role of member systems. Default
`webserver`.
* `node['haproxy']['balance_algorithm']` - sets the load balancing
algorithm; defaults to roundrobin.
* `node['haproxy']['enable_ssl']` - whether or not to create listeners
for ssl, default false
* `node['haproxy']['ssl_incoming_address']` - sets the address to bind
the haproxy on for SSL, 0.0.0.0 (all addresses) by default
* `node['haproxy']['ssl_member_port']` - the port that member systems
will be listening on for ssl, default 8443
* `node['haproxy']['ssl_incoming_port']` - sets the port on which
haproxy listens for ssl, default 443
* `node['haproxy']['httpchk']` - used by the `app_lb` recipe. If set,
will configure httpchk in haproxy.conf
* `node['haproxy']['ssl_httpchk']` - used by the `app_lb` recipe. If
set and `enable_ssl` is true, will configure httpchk in haproxy.conf
for the `ssl_applicaiton` section
* `node['haproxy']['enable_admin']` - whether to enable the admin
interface. default true. Listens on port 22002.
* `node['haproxy']['admin']['address_bind']` - sets the address to
bind the administrative interface on, 127.0.0.1 by default
* `node['haproxy']['admin']['port']` - sets the port for the
administrative interface, 22002 by default
* `node['haproxy']['pid_file']` - the PID file of the haproxy process,
used in the tuning recipe.
* `node['haproxy']['defaults_options']` - an array of options to use
for the config file's `defaults` stanza, default is
["httplog", "dontlognull", "redispatch"]
* `node['haproxy']['defaults_timeouts']['connect']` - connect timeout
in defaults stanza
* `node['haproxy']['defaults_timeouts']['client']` - client timeout in
defaults stanza
* `node['haproxy']['defaults_timeouts']['server']` - server timeout in
defaults stanza
* `node['haproxy']['x_forwarded_for']` - if true, creates an
X-Forwarded-For header containing the original client's IP address.
This option disables KeepAlive.
* `node['haproxy']['member_max_connections']` - the maxconn value to
be set for each app server
* `node['haproxy']['user']` - user that haproxy runs as
* `node['haproxy']['group']` - group that haproxy runs as
* `node['haproxy']['global_max_connections']` - in the `app_lb`
config, set the global maxconn
* `node['haproxy']['member_max_connections']` - in both configs, set
the maxconn per member
* `node['haproxy']['frontend_max_connections']` - in the `app_lb`
config, set the the maxconn per frontend member
* `node['haproxy']['frontend_ssl_max_connections']` - in the `app_lb`
config, set the maxconn per frontend member using SSL

Recipes
=======

## default

Sets up haproxy using statically defined configuration. To override
the configuration, modify the templates/default/haproxy.cfg.erb file
directly, or supply your own and override the cookbook and source by
reopening the `template[/etc/haproxy/haproxy.cfg]` resource.

## app\_lb

Sets up haproxy using dynamically defined configuration through
search. See __Usage__ below.

## tuning

Uses the community `cpu` cookbook's `cpu_affinity` LWRP to set
affinity for the haproxy process.

Usage
=====

Use either the default recipe or the `app_lb` recipe.

When using the default recipe, modify the haproxy.cfg.erb file with listener(s) for your sites/servers.
When using the default recipe, modify the haproxy.cfg.erb file with
listener(s) for your sites/servers.

The `app_lb` recipe is designed to be used with the application cookbook, and provides search mechanism to find the appropriate application servers. Set this in a role that includes the haproxy::app_lb recipe. For example,
The `app_lb` recipe is designed to be used with the application
cookbook, and provides search mechanism to find the appropriate
application servers. Set this in a role that includes the
haproxy::app_lb recipe. For example,

name "load_balancer"
description "haproxy load balancer"
Expand All @@ -45,7 +113,8 @@ The `app_lb` recipe is designed to be used with the application cookbook, and pr
}
)

The search uses the node's `chef_environment`. For example, create `environments/production.rb`, then upload it to the server with knife
The search uses the node's `chef_environment`. For example, create
`environments/production.rb`, then upload it to the server with knife

% cat environments/production.rb
name "production"
Expand All @@ -55,9 +124,8 @@ The search uses the node's `chef_environment`. For example, create `environments
License and Author
==================

Author:: Joshua Timberman (<[email protected]>)

Copyright:: 2009-2011, Opscode, Inc
- Author:: Joshua Timberman (<[email protected]>)
- Copyright:: 2009-2012, Opscode, Inc

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
license "Apache 2.0"
description "Installs and configures haproxy"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "1.1.4"
version "1.2.0"

recipe "haproxy", "Installs and configures haproxy"
recipe "haproxy::app_lb", "Installs and configures haproxy by searching for nodes of a particular role"
Expand Down

0 comments on commit 6b7a212

Please sign in to comment.