feat: adding rke2 (#394)
- manage rke2 repos - add rke2 module (init, params, install, config, service) - split roles::infra::k8s::node -> control/compute roles - moved common k8s config into k8s.yaml - add bootstrap_node, manage server and token fields in rke2 config - manage install of helm - manage node attributes (from puppet facts) - manage frr exclusions for service/cluster network Reviewed-on: #394
This commit was merged in pull request #394.
This commit is contained in:
@@ -16,8 +16,16 @@ class frrouting (
|
||||
Array[String] $mpls_ldp_interfaces = [],
|
||||
Boolean $ospf_preferred_source_enable = false,
|
||||
Optional[Stdlib::IP::Address] $ospf_preferred_source = undef,
|
||||
Boolean $ospf_exclude_k8s_enable = false,
|
||||
Optional[Stdlib::IP::Address::V4::CIDR] $k8s_cluster_cidr = undef, # pod/cluster CIDR (e.g. 10.42.0.0/16)
|
||||
Optional[Stdlib::IP::Address::V4::CIDR] $k8s_service_cidr = undef, # service CIDR (e.g. 10.43.0.0/16)
|
||||
) {
|
||||
|
||||
# sanity check
|
||||
if $ospf_exclude_k8s_enable and $k8s_cluster_cidr == undef and $k8s_service_cidr == undef {
|
||||
warning('frrouting: ospf_exclude_k8s_enable is true but no k8s_*_cidr provided; nothing will be filtered.')
|
||||
}
|
||||
|
||||
$daemons_defaults = {
|
||||
'bgpd' => false,
|
||||
'ospfd' => true,
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
frr defaults traditional
|
||||
hostname <%= @hostname %>
|
||||
no ipv6 forwarding
|
||||
|
||||
<% @ospfd_interfaces.each do |iface, params| -%>
|
||||
interface <%= iface %>
|
||||
<% if params['area'] -%>
|
||||
@@ -12,12 +13,31 @@ interface <%= iface %>
|
||||
<% end -%>
|
||||
exit
|
||||
<% end -%>
|
||||
|
||||
<%# ---- K8s exclude (prefix-list + route-map) ---- -%>
|
||||
<% if @ospf_exclude_k8s_enable && (@k8s_cluster_cidr || @k8s_service_cidr) -%>
|
||||
! Do not redistribute Kubernetes Pod/Service CIDRs
|
||||
ip prefix-list K8S-BLOCK seq 5 permit <%= @k8s_cluster_cidr %> le 32<% if !@k8s_cluster_cidr %> ! (unset)<% end %>
|
||||
<% if @k8s_service_cidr -%>
|
||||
ip prefix-list K8S-BLOCK seq 10 permit <%= @k8s_service_cidr %> le 32
|
||||
<% end -%>
|
||||
route-map CONNECTED-NON-K8S deny 5
|
||||
match ip address prefix-list K8S-BLOCK
|
||||
exit
|
||||
route-map CONNECTED-NON-K8S permit 100
|
||||
exit
|
||||
<% end -%>
|
||||
|
||||
router ospf
|
||||
ospf router-id <%= @ospfd_router_id %>
|
||||
log-adjacency-changes detail
|
||||
<% @ospfd_redistribute.each do |type| -%>
|
||||
<% if @ospf_exclude_k8s_enable && type == 'connected' && (@k8s_cluster_cidr || @k8s_service_cidr) -%>
|
||||
redistribute connected route-map CONNECTED-NON-K8S
|
||||
<% else -%>
|
||||
redistribute <%= type %>
|
||||
<% end -%>
|
||||
<% end -%>
|
||||
<% @ospfd_networks.each do |network| -%>
|
||||
network <%= network %>
|
||||
<% end -%>
|
||||
@@ -31,6 +51,8 @@ router ospf
|
||||
mpls-te inter-as area 0.0.0.0
|
||||
<% end -%>
|
||||
exit
|
||||
|
||||
<%# ---- MPLS/LDP config ---- -%>
|
||||
<% if @mpls_ldp_router_id and @mpls_ldp_transport_addr and @mpls_ldp_interfaces.any? -%>
|
||||
mpls ldp
|
||||
router-id <%= @mpls_ldp_router_id %>
|
||||
@@ -43,6 +65,8 @@ mpls ldp
|
||||
exit-address-family
|
||||
exit
|
||||
<% end -%>
|
||||
|
||||
<%# ---- Preferred OSPF source ---- -%>
|
||||
<% if @ospf_preferred_source_enable && @ospf_preferred_source -%>
|
||||
ip prefix-list ANY seq 5 permit 0.0.0.0/0 le 32
|
||||
route-map OSPF-SRC permit 10
|
||||
|
||||
Reference in New Issue
Block a user