blob: 73234f7b8cc033794d4377c23a1e76d4f7efcad6 [file] [log] [blame]
---
apiVersion: "ipam.mirantis.com/v1alpha1"
kind: Subnet
metadata:
name: mgmt-pxe
namespace: default
labels:
kaas.mirantis.com/provider: baremetal
ipam/SVC-dhcp-range: "presents"
spec:
cidr: 172.16.180.0/23
includeRanges:
- 172.16.181.14-172.16.181.30
---
# The 'mgmt-pxe-nics' Subnet object defines the range of IP addresses
# for NIC IPs, from the PXE range that will be allocated on the nodes NICs
# in the PXE network after nodes provisioning.
# Required to elliminate prossible dhcp routing issues.
apiVersion: "ipam.mirantis.com/v1alpha1"
kind: Subnet
metadata:
name: mgmt-pxe-nics
namespace: default
labels:
kaas.mirantis.com/provider: baremetal
cluster.sigs.k8s.io/cluster-name: kaas-mgmt
# Label 'ipam/SVC-pxe-nics' is mandatory for this type of network.
ipam/SVC-pxe-nics: "presents"
spec:
cidr: 172.16.180.0/23
gateway: 172.16.180.1
includeRanges:
- 172.16.181.31-172.16.181.50
---
apiVersion: "ipam.mirantis.com/v1alpha1"
kind: Subnet
metadata:
name: mgmt-k8s-api-lb
namespace: default
labels:
kaas.mirantis.com/provider: baremetal
cluster.sigs.k8s.io/cluster-name: kaas-mgmt
ipam/SVC-LBhost: "presents"
spec:
cidr: 172.16.181.3/32
useWholeCidr: true
---
# The 'mgmt-nics' Subnet defines the range of IP addresses to be allocated
# to the nodes in the management/LCM network. The IP address of Kubernetes
# API endpoint for the cluster is excluded from that range. The
# MetalLB address pools are also excluded from that range.
apiVersion: "ipam.mirantis.com/v1alpha1"
kind: Subnet
metadata:
name: mgmt-nics
namespace: default
labels:
kaas.mirantis.com/provider: baremetal
cluster.sigs.k8s.io/cluster-name: kaas-mgmt
ipam/SVC-k8s-lcm: "presents"
spec:
cidr: 172.16.180.0/23
gateway: 172.16.180.1
nameservers:
- 172.18.176.6
- 8.8.8.8
includeRanges:
- 172.16.181.51-172.16.181.100
---
# L2Template allows you to create advanced host networking
# configurations for your management cluster. For example,
# you can create bond interfaces on top of physical interfaces
# on the host, or use multiple subnets to separate different
# types of network traffic.
# More elaborate network configurations for the management cluster
# require changes in this resource template and potential
# adding of more Subnet resources for other networks.
# For more details, see
# https://docs.mirantis.com/container-cloud/latest/deployment-guide/deploy-bm-mgmt.rst
apiVersion: ipam.mirantis.com/v1alpha1
kind: L2Template
metadata:
name: default
namespace: default
labels:
kaas.mirantis.com/provider: baremetal
cluster.sigs.k8s.io/cluster-name: kaas-mgmt
ipam/DefaultForCluster: "1"
spec:
autoIfMappingPrio:
- provision
- enp
- eno
- ens
# The 'l3Layout' section defines the list of subnets to be used in the
# 'npTemplate' field.
l3Layout:
- scope: namespace
# 'subnetName' defines the name of the subnet that is used
# to refer to it throughout the 'npTemplate' below.
subnetName: kaas-mgmt
# 'labelSelector' is the combination of labels that allows
# detecting a unique subnet. These labels refer to the Subnet object.
labelSelector:
kaas.mirantis.com/provider: baremetal
ipam/SVC-k8s-lcm: "presents"
- scope: namespace
subnetName: mgmt-pxe
labelSelector:
kaas.mirantis.com/provider: baremetal
ipam/SVC-pxe-nics: "presents"
# The following is the template used to generate a netplan configuration
# file for Ubuntu. It contains an example of the definition of ethernet
# interfaces, with assigned addresses from the subnets defined in the 'l3Layout'
# field above. The gateway and nameservers are also
# taken from the subnet using the L2Temlpate-specific macros.
npTemplate: |
version: 2
renderer: networkd
ethernets:
{{nic 0}}:
dhcp4: false
dhcp6: false
addresses:
- {{ip "0:kaas-mgmt"}}
gateway4: {{gateway_from_subnet "kaas-mgmt"}}
nameservers:
addresses: {{nameservers_from_subnet "kaas-mgmt"}}
match:
macaddress: {{mac 0}}
set-name: {{nic 0}}