feat: add k3s like configs
This commit is contained in:
parent
1fa9c044d0
commit
9dff54a75f
4 changed files with 212 additions and 0 deletions
101
examples/k3s-example.yaml
Normal file
101
examples/k3s-example.yaml
Normal file
|
|
@ -0,0 +1,101 @@
|
|||
---
|
||||
# Example playbook for K3s HAProxy configuration
|
||||
|
||||
- name: "Deploy HAProxy for K3s Cluster"
|
||||
hosts: "haproxy_servers"
|
||||
become: true
|
||||
|
||||
vars:
|
||||
|
||||
# global settings
|
||||
haproxy_global:
|
||||
log:
|
||||
- "/dev/log local0"
|
||||
- "/dev/log local1 notice"
|
||||
chroot: "/var/lib/haproxy"
|
||||
stats_socket: "/run/haproxy-admin.sock mode 660 level admin"
|
||||
stats_timeout: "30s"
|
||||
user: "haproxy"
|
||||
group: "haproxy"
|
||||
daemon: true
|
||||
|
||||
# defaults settings
|
||||
haproxy_defaults:
|
||||
log: "global"
|
||||
mode: "tcp"
|
||||
options:
|
||||
- "tcplog"
|
||||
- "dontlognull"
|
||||
timeout_connect: "5000"
|
||||
timeout_client: "50000"
|
||||
timeout_server: "50000"
|
||||
|
||||
# frontends
|
||||
haproxy_frontends:
|
||||
- name: "fe-k3s-http"
|
||||
bind: "192.168.10.17:80"
|
||||
default_backend: "be-k3s-http"
|
||||
|
||||
- name: "fe-k3s-https"
|
||||
bind: "192.168.10.17:443"
|
||||
default_backend: "be-k3s-https"
|
||||
|
||||
- name: "fe-k3s-api"
|
||||
bind: "192.168.10.17:6443"
|
||||
default_backend: "be-k3s-nodes"
|
||||
|
||||
# backends
|
||||
haproxy_backends:
|
||||
- name: "be-k3s-http"
|
||||
balance: "roundrobin"
|
||||
stick_table: "type ip size 200k expire 30m"
|
||||
stick:
|
||||
- "on src"
|
||||
options:
|
||||
- "option tcp-check"
|
||||
servers:
|
||||
- name: "k3s-node01"
|
||||
address: "192.168.10.21:80"
|
||||
check: true
|
||||
- name: "k3s-node02"
|
||||
address: "192.168.10.22:80"
|
||||
check: true
|
||||
- name: "k3s-node03"
|
||||
address: "192.168.10.23:80"
|
||||
check: true
|
||||
|
||||
- name: "be-k3s-https"
|
||||
balance: "roundrobin"
|
||||
stick_table: "type ip size 200k expire 30m"
|
||||
stick:
|
||||
- "on src"
|
||||
options:
|
||||
- "option tcp-check"
|
||||
servers:
|
||||
- name: "k3s-node01"
|
||||
address: "192.168.10.21:443"
|
||||
check: true
|
||||
- name: "k3s-node02"
|
||||
address: "192.168.10.22:443"
|
||||
check: true
|
||||
- name: "k3s-node03"
|
||||
address: "192.168.10.23:443"
|
||||
check: true
|
||||
|
||||
- name: "be-k3s-nodes"
|
||||
balance: "roundrobin"
|
||||
options:
|
||||
- "option tcp-check"
|
||||
servers:
|
||||
- name: "k3s-node01"
|
||||
address: "192.168.10.21:6443"
|
||||
check: true
|
||||
- name: "k3s-node02"
|
||||
address: "192.168.10.22:6443"
|
||||
check: true
|
||||
- name: "k3s-node03"
|
||||
address: "192.168.10.23:6443"
|
||||
check: true
|
||||
|
||||
roles:
|
||||
- "role-haproxy"
|
||||
Loading…
Add table
Add a link
Reference in a new issue