feat: add ceph-dashboard to haproxy (#382)
- add profile to export haproxy backend - add new cert for dashboard.ceph.unkin.net - extend balancemember with ipaddress attribute Reviewed-on: #382
This commit is contained in:
parent
83bb3e1085
commit
62aade77ff
@ -10,6 +10,7 @@ profiles::haproxy::dns::vrrp_cnames:
|
|||||||
- git.unkin.net
|
- git.unkin.net
|
||||||
- fafflix.unkin.net
|
- fafflix.unkin.net
|
||||||
- grafana.unkin.net
|
- grafana.unkin.net
|
||||||
|
- dashboard.ceph.unkin.net
|
||||||
|
|
||||||
profiles::haproxy::mappings:
|
profiles::haproxy::mappings:
|
||||||
fe_http:
|
fe_http:
|
||||||
@ -27,6 +28,7 @@ profiles::haproxy::mappings:
|
|||||||
- 'fafflix.unkin.net be_jellyfin'
|
- 'fafflix.unkin.net be_jellyfin'
|
||||||
- 'git.unkin.net be_gitea'
|
- 'git.unkin.net be_gitea'
|
||||||
- 'grafana.unkin.net be_grafana'
|
- 'grafana.unkin.net be_grafana'
|
||||||
|
- 'dashboard.ceph.unkin.net be_ceph_dashboard'
|
||||||
fe_https:
|
fe_https:
|
||||||
ensure: present
|
ensure: present
|
||||||
mappings:
|
mappings:
|
||||||
@ -42,6 +44,7 @@ profiles::haproxy::mappings:
|
|||||||
- 'fafflix.unkin.net be_jellyfin'
|
- 'fafflix.unkin.net be_jellyfin'
|
||||||
- 'git.unkin.net be_gitea'
|
- 'git.unkin.net be_gitea'
|
||||||
- 'grafana.unkin.net be_grafana'
|
- 'grafana.unkin.net be_grafana'
|
||||||
|
- 'dashboard.ceph.unkin.net be_ceph_dashboard'
|
||||||
|
|
||||||
profiles::haproxy::frontends:
|
profiles::haproxy::frontends:
|
||||||
fe_http:
|
fe_http:
|
||||||
@ -62,6 +65,7 @@ profiles::haproxy::frontends:
|
|||||||
- 'acl_fafflix req.hdr(host) -i fafflix.unkin.net'
|
- 'acl_fafflix req.hdr(host) -i fafflix.unkin.net'
|
||||||
- 'acl_gitea req.hdr(host) -i git.unkin.net'
|
- 'acl_gitea req.hdr(host) -i git.unkin.net'
|
||||||
- 'acl_grafana req.hdr(host) -i grafana.unkin.net'
|
- 'acl_grafana req.hdr(host) -i grafana.unkin.net'
|
||||||
|
- 'acl_ceph_dashboard req.hdr(host) -i dashboard.ceph.unkin.net'
|
||||||
- 'acl_internalsubnets src 198.18.0.0/16 10.10.12.0/24'
|
- 'acl_internalsubnets src 198.18.0.0/16 10.10.12.0/24'
|
||||||
use_backend:
|
use_backend:
|
||||||
- "%[req.hdr(host),lower,map(/etc/haproxy/fe_https.map,be_default)]"
|
- "%[req.hdr(host),lower,map(/etc/haproxy/fe_https.map,be_default)]"
|
||||||
@ -79,6 +83,7 @@ profiles::haproxy::frontends:
|
|||||||
- 'set-header X-Frame-Options DENY if acl_fafflix'
|
- 'set-header X-Frame-Options DENY if acl_fafflix'
|
||||||
- 'set-header X-Frame-Options DENY if acl_gitea'
|
- 'set-header X-Frame-Options DENY if acl_gitea'
|
||||||
- 'set-header X-Frame-Options DENY if acl_grafana'
|
- 'set-header X-Frame-Options DENY if acl_grafana'
|
||||||
|
- 'set-header X-Frame-Options DENY if acl_ceph_dashboard'
|
||||||
- 'set-header X-Content-Type-Options nosniff'
|
- 'set-header X-Content-Type-Options nosniff'
|
||||||
- 'set-header X-XSS-Protection 1;mode=block'
|
- 'set-header X-XSS-Protection 1;mode=block'
|
||||||
|
|
||||||
@ -262,6 +267,26 @@ profiles::haproxy::backends:
|
|||||||
redirect: 'scheme https if !{ ssl_fc }'
|
redirect: 'scheme https if !{ ssl_fc }'
|
||||||
stick-table: 'type ip size 200k expire 30m'
|
stick-table: 'type ip size 200k expire 30m'
|
||||||
stick: 'on src'
|
stick: 'on src'
|
||||||
|
be_ceph_dashboard:
|
||||||
|
description: Backend for Ceph Dashboard from Mgr instances
|
||||||
|
collect_exported: false # handled in custom function
|
||||||
|
options:
|
||||||
|
balance: roundrobin
|
||||||
|
option:
|
||||||
|
- httpchk GET /
|
||||||
|
- forwardfor
|
||||||
|
- http-keep-alive
|
||||||
|
- prefer-last-server
|
||||||
|
cookie: SRVNAME insert indirect nocache
|
||||||
|
http-reuse: always
|
||||||
|
http-check:
|
||||||
|
- expect status 200
|
||||||
|
http-request:
|
||||||
|
- set-header X-Forwarded-Port %[dst_port]
|
||||||
|
- add-header X-Forwarded-Proto https if { dst_port 9443 }
|
||||||
|
redirect: 'scheme https if !{ ssl_fc }'
|
||||||
|
stick-table: 'type ip size 200k expire 30m'
|
||||||
|
stick: 'on src'
|
||||||
|
|
||||||
profiles::haproxy::certlist::enabled: true
|
profiles::haproxy::certlist::enabled: true
|
||||||
profiles::haproxy::certlist::certificates:
|
profiles::haproxy::certlist::certificates:
|
||||||
@ -276,6 +301,7 @@ profiles::haproxy::certlist::certificates:
|
|||||||
- /etc/pki/tls/letsencrypt/fafflix.unkin.net/fullchain_combined.pem
|
- /etc/pki/tls/letsencrypt/fafflix.unkin.net/fullchain_combined.pem
|
||||||
- /etc/pki/tls/letsencrypt/git.unkin.net/fullchain_combined.pem
|
- /etc/pki/tls/letsencrypt/git.unkin.net/fullchain_combined.pem
|
||||||
- /etc/pki/tls/letsencrypt/grafana.unkin.net/fullchain_combined.pem
|
- /etc/pki/tls/letsencrypt/grafana.unkin.net/fullchain_combined.pem
|
||||||
|
- /etc/pki/tls/letsencrypt/dashboard.ceph.unkin.net/fullchain_combined.pem
|
||||||
- /etc/pki/tls/vault/certificate.pem
|
- /etc/pki/tls/vault/certificate.pem
|
||||||
|
|
||||||
# additional altnames
|
# additional altnames
|
||||||
@ -303,3 +329,4 @@ certbot::client::domains:
|
|||||||
- fafflix.unkin.net
|
- fafflix.unkin.net
|
||||||
- git.unkin.net
|
- git.unkin.net
|
||||||
- grafana.unkin.net
|
- grafana.unkin.net
|
||||||
|
- dashboard.ceph.unkin.net
|
||||||
|
|||||||
@ -6,6 +6,7 @@ hiera_include:
|
|||||||
- zfs
|
- zfs
|
||||||
- profiles::ceph::node
|
- profiles::ceph::node
|
||||||
- profiles::ceph::client
|
- profiles::ceph::client
|
||||||
|
- profiles::ceph::dashboard
|
||||||
- profiles::storage::cephfsvols
|
- profiles::storage::cephfsvols
|
||||||
- exporters::frr_exporter
|
- exporters::frr_exporter
|
||||||
|
|
||||||
@ -121,6 +122,9 @@ profiles::yum::global::repos:
|
|||||||
# dns
|
# dns
|
||||||
profiles::dns::base::primary_interface: loopback0
|
profiles::dns::base::primary_interface: loopback0
|
||||||
|
|
||||||
|
# dashboard/haproxy
|
||||||
|
profiles::ceph::dashboard::ipaddress: "%{hiera('networking_loopback0_ip')}"
|
||||||
|
|
||||||
# networking
|
# networking
|
||||||
systemd::manage_networkd: true
|
systemd::manage_networkd: true
|
||||||
systemd::manage_all_network_files: true
|
systemd::manage_all_network_files: true
|
||||||
|
|||||||
@ -15,3 +15,4 @@ certbot::domains:
|
|||||||
- fafflix.unkin.net
|
- fafflix.unkin.net
|
||||||
- git.unkin.net
|
- git.unkin.net
|
||||||
- grafana.unkin.net
|
- grafana.unkin.net
|
||||||
|
- dashboard.ceph.unkin.net
|
||||||
|
|||||||
20
site/profiles/manifests/ceph/dashboard.pp
Normal file
20
site/profiles/manifests/ceph/dashboard.pp
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
class profiles::ceph::dashboard (
|
||||||
|
Stdlib::IP::Address $ipaddress = $facts['networking']['ip'],
|
||||||
|
){
|
||||||
|
|
||||||
|
# export haproxy balancemember
|
||||||
|
profiles::haproxy::balancemember { "${facts['networking']['fqdn']}_9443":
|
||||||
|
service => 'be_ceph_dashboard',
|
||||||
|
ipaddress => $ipaddress,
|
||||||
|
ports => [9443],
|
||||||
|
options => [
|
||||||
|
"cookie ${facts['networking']['hostname']}",
|
||||||
|
'ssl',
|
||||||
|
'verify none',
|
||||||
|
'check',
|
||||||
|
'inter 2s',
|
||||||
|
'rise 3',
|
||||||
|
'fall 2',
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -3,6 +3,7 @@ define profiles::haproxy::balancemember (
|
|||||||
String $service,
|
String $service,
|
||||||
Array[Stdlib::Port] $ports,
|
Array[Stdlib::Port] $ports,
|
||||||
Array $options = ['check'],
|
Array $options = ['check'],
|
||||||
|
Stdlib::IP::Address $ipaddress = $facts['networking']['ip'],
|
||||||
) {
|
) {
|
||||||
|
|
||||||
$location_environment = "${facts['country']}-${facts['region']}-${facts['environment']}"
|
$location_environment = "${facts['country']}-${facts['region']}-${facts['environment']}"
|
||||||
@ -12,7 +13,7 @@ define profiles::haproxy::balancemember (
|
|||||||
listening_service => $service,
|
listening_service => $service,
|
||||||
ports => $ports,
|
ports => $ports,
|
||||||
server_names => $facts['networking']['hostname'],
|
server_names => $facts['networking']['hostname'],
|
||||||
ipaddresses => $facts['networking']['ip'],
|
ipaddresses => $ipaddress,
|
||||||
options => $options,
|
options => $options,
|
||||||
tag => $balancemember_tag,
|
tag => $balancemember_tag,
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user