-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into dt_session-timer-customization
- Loading branch information
Showing
25 changed files
with
1,029 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
components/automate-backend-haproxy/habitat/config/haproxy.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
global | ||
stats socket {{pkg.svc_var_path}}/run/haproxy.sock mode 600 level admin | ||
stats timeout 2m | ||
maxconn {{cfg.maxconn}} | ||
|
||
defaults | ||
log global | ||
retries 2 | ||
mode {{cfg.front-end.mode}} | ||
timeout connect 5000ms | ||
timeout client 50000ms | ||
timeout server 50000ms | ||
timeout check 5000ms | ||
|
||
listen postgresql | ||
bind {{cfg.front-end.listen}}:{{cfg.front-end.port}} | ||
{{#if cfg.httpchk}} | ||
option httpchk {{cfg.httpchk}} | ||
{{~/if}} | ||
default-server inter 3s fall 3 rise 2 on-marked-down shutdown-sessions | ||
{{~#if bind.database}} | ||
{{~#eachAlive bind.database.members as |dbmember|}} | ||
server {{dbmember.sys.ip}} {{dbmember.sys.ip}}:{{dbmember.cfg.port}} maxconn {{cfg.server.maxconn}} check port "${PGLEADERCHK_PORT}" | ||
{{~/eachAlive}} | ||
{{~else}} | ||
server {{sys.ip}} {{sys.ip}}:{{cfg.pg.port}} maxconn {{cfg.server.maxconn}} check port "${PGLEADERCHK_PORT}" | ||
{{~/if}} | ||
|
||
{{#if cfg.status.enabled}} | ||
listen stats | ||
bind {{cfg.status.listen}}:{{cfg.status.port}} | ||
mode http | ||
log global | ||
maxconn 10 | ||
stats enable | ||
stats hide-version | ||
stats refresh 30s | ||
stats show-node | ||
stats auth {{cfg.status.user}}:{{cfg.status.password}} | ||
stats uri {{cfg.status.uri}} | ||
{{~/if}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
maxconn = 500 | ||
httpchk = "GET /" | ||
|
||
[server] | ||
maxconn = 350 | ||
|
||
[front-end] | ||
listen = "*" | ||
port = 7432 | ||
mode = "tcp" | ||
|
||
[status] | ||
enabled = false | ||
listen = "*" | ||
port = 9000 | ||
user = "admin" | ||
password = "password" | ||
uri = "/haproxy-stats" | ||
|
||
[pg] | ||
port = 5432 | ||
|
||
[pgleaderchk] | ||
port = 6432 |
14 changes: 14 additions & 0 deletions
14
components/automate-backend-haproxy/habitat/hooks/health-check
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!{{pkgPathFor "core/bash"}}/bin/bash | ||
|
||
rc=0 | ||
|
||
echo "show info" | {{pkgPathFor "core/netcat-openbsd"}}/bin/nc -U {{pkg.svc_var_path}}/run/haproxy.sock | grep -q Pid | ||
|
||
case $? in | ||
0) | ||
rc=0 ;; # Golden | ||
*) | ||
rc=2 ;; # Critical | ||
esac | ||
|
||
exit $rc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!{{pkgPathFor "core/bash"}}/bin/bash | ||
|
||
exec 2>&1 | ||
|
||
mkdir -p {{pkg.svc_var_path}}/run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!{{pkgPathFor "core/bash"}}/bin/bash | ||
|
||
exec 2>&1 | ||
|
||
export PGLEADERCHK_PORT | ||
|
||
{{~#if bind.pgleaderchk}} | ||
{{~#eachAlive bind.pgleaderchk.members as |pgchkmember|}} | ||
{{~#if @last}} | ||
# this variable is defined here then used in haproxy.conf where | ||
# haproxy interpolates it at load time. | ||
PGLEADERCHK_PORT={{pgchkmember.cfg.port}} | ||
{{~/if}} | ||
{{~/eachAlive}} | ||
{{~else}} | ||
PGLEADERCHK_PORT={{cfg.pgleaderchk.port}} | ||
{{~/if}} | ||
|
||
exec {{pkgPathFor "core/haproxy"}}/bin/haproxy -f {{pkg.svc_config_path}}/haproxy.conf -db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# shellcheck disable=SC2148 | ||
UPSTREAM_PKG_IDENT="core/haproxy" | ||
pkg_name="automate-backend-haproxy" | ||
pkg_description="Wrapper package for core/haproxy" | ||
vendor_origin="chef" | ||
pkg_maintainer="Chef Software Inc. <[email protected]>" | ||
pkg_license=("Chef-MLSA") | ||
pkg_upstream_url="https://www.chef.io/automate" | ||
pkg_version="1.0.28" | ||
pkg_build_deps=("${UPSTREAM_PKG_IDENT}") | ||
pkg_deps=( | ||
chef/mlsa | ||
core/bash | ||
core/netcat-openbsd | ||
"${UPSTREAM_PKG_IDENT}" | ||
) | ||
|
||
|
||
pkg_exports=( | ||
[port]=front-end.port | ||
[status-port]=status.port | ||
) | ||
|
||
pkg_exposes=(port status-port) | ||
|
||
pkg_binds_optional=( | ||
[database]="port superuser_name" | ||
[pgleaderchk]="port" | ||
) | ||
|
||
do_before() { | ||
update_pkg_version | ||
} | ||
|
||
do_download() { | ||
return 0 | ||
} | ||
|
||
do_build() { | ||
return 0 | ||
} | ||
|
||
do_install() { | ||
return 0 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Automate-Backend-Journalbeat | ||
|
||
This is a wrapper package of core/journalbeat for Chef Automate Backend. | ||
|
||
## Maintainers | ||
|
||
The Habitat Maintainers [email protected] | ||
|
||
## Type of Package | ||
|
||
This is a service package. |
Oops, something went wrong.