feat: 声明 sandbox 双节点 K3s 集群
This commit is contained in:
@@ -29,6 +29,29 @@ set protocols ospf area {{ vyos_ospf_area }} network {{ i.network }}
|
||||
set protocols ospf interface {{ i.iface }} passive
|
||||
{% endfor %}
|
||||
|
||||
{# --- K3s PostgreSQL datastore: fixed endpoint, explicitly selected primary --- #}
|
||||
set load-balancing haproxy service sandbox-postgresql listen-address {{ vyos_postgresql_listen_address }}
|
||||
set load-balancing haproxy service sandbox-postgresql port {{ vyos_postgresql_port }}
|
||||
set load-balancing haproxy service sandbox-postgresql mode 'tcp'
|
||||
set load-balancing haproxy service sandbox-postgresql backend 'sandbox-postgresql-primary'
|
||||
set load-balancing haproxy backend sandbox-postgresql-primary mode 'tcp'
|
||||
set load-balancing haproxy backend sandbox-postgresql-primary server primary address {{ vyos_postgresql_primary_address }}
|
||||
set load-balancing haproxy backend sandbox-postgresql-primary server primary port {{ vyos_postgresql_port }}
|
||||
set load-balancing haproxy backend sandbox-postgresql-primary server primary check
|
||||
|
||||
{# --- Sandbox K3s API: stable address with both control-plane nodes --- #}
|
||||
set interfaces ethernet {{ vyos_sandbox_k3s_api_interface }} address '{{ vyos_sandbox_k3s_api_address }}/32'
|
||||
set load-balancing haproxy service sandbox-k3s-api listen-address {{ vyos_sandbox_k3s_api_address }}
|
||||
set load-balancing haproxy service sandbox-k3s-api port {{ vyos_sandbox_k3s_api_port }}
|
||||
set load-balancing haproxy service sandbox-k3s-api mode 'tcp'
|
||||
set load-balancing haproxy service sandbox-k3s-api backend 'sandbox-k3s-api'
|
||||
set load-balancing haproxy backend sandbox-k3s-api mode 'tcp'
|
||||
{% for server in vyos_sandbox_k3s_servers %}
|
||||
set load-balancing haproxy backend sandbox-k3s-api server {{ server.name }} address {{ server.address }}
|
||||
set load-balancing haproxy backend sandbox-k3s-api server {{ server.name }} port {{ vyos_sandbox_k3s_api_port }}
|
||||
set load-balancing haproxy backend sandbox-k3s-api server {{ server.name }} check
|
||||
{% endfor %}
|
||||
|
||||
{# --- management --- #}
|
||||
set service ssh port 22
|
||||
|
||||
|
||||
Reference in New Issue
Block a user