Vladimir Khlyunev | cc648af | 2024-04-25 19:56:40 +0400 | [diff] [blame^] | 1 | --- |
| 2 | # This template allows you to configure networking for servers |
| 3 | # of the management cluster of Mirantis Container Cloud. Network |
| 4 | # configuration requires the following resources. |
| 5 | |
| 6 | # WARNING: Since Container Cloud 2.24, the default networking |
| 7 | # definition schema has been significantly changed. |
| 8 | # Older templates will not work for 2.24+ release bootstrap deployment. |
| 9 | # For details, see |
| 10 | # https://docs.mirantis.com/container-cloud/latest/deployment-guide/deploy-bm-mgmt.html |
| 11 | |
| 12 | # The 'mgmt-lb-pxe' Subnet object defines the range of IP addresses |
| 13 | # used by MetalLB to expose services in the PXE network. This |
| 14 | # includes Ironic API (bare metal provisioning server), HTTP server |
| 15 | # that provides images for network boot and server provisioning, |
| 16 | # and the caching server for accessing the Container Cloud artifacts |
| 17 | # deployed on the hosts. |
| 18 | apiVersion: "ipam.mirantis.com/v1alpha1" |
| 19 | kind: Subnet |
| 20 | metadata: |
| 21 | name: mgmt-lb-pxe |
| 22 | namespace: default |
| 23 | labels: |
| 24 | kaas.mirantis.com/provider: baremetal |
| 25 | cluster.sigs.k8s.io/cluster-name: kaas-mgmt |
| 26 | ipam/SVC-MetalLB: "presents" |
| 27 | metallb/address-pool-auto-assign: "false" |
| 28 | metallb/address-pool-name: services-pxe |
| 29 | metallb/address-pool-protocol: layer2 |
| 30 | spec: |
| 31 | cidr: 172.16.180.0/23 |
| 32 | includeRanges: |
| 33 | - 172.16.181.10-172.16.181.13 |
| 34 | --- |
| 35 | apiVersion: "ipam.mirantis.com/v1alpha1" |
| 36 | kind: Subnet |
| 37 | metadata: |
| 38 | name: mgmt-pxe |
| 39 | namespace: default |
| 40 | labels: |
| 41 | kaas.mirantis.com/provider: baremetal |
| 42 | ipam/SVC-dhcp-range: "presents" |
| 43 | spec: |
| 44 | cidr: 172.16.180.0/23 |
| 45 | includeRanges: |
| 46 | - 172.16.181.14-172.16.181.30 |
| 47 | |
| 48 | --- |
| 49 | # The 'mgmt-pxe-nics' Subnet object defines the range of IP addresses |
| 50 | # for NIC IPs, from the PXE range that will be allocated on the nodes NICs |
| 51 | # in the PXE network after nodes provisioning. |
| 52 | # Required to elliminate prossible dhcp routing issues. |
| 53 | apiVersion: "ipam.mirantis.com/v1alpha1" |
| 54 | kind: Subnet |
| 55 | metadata: |
| 56 | name: mgmt-pxe-nics |
| 57 | namespace: default |
| 58 | labels: |
| 59 | kaas.mirantis.com/provider: baremetal |
| 60 | cluster.sigs.k8s.io/cluster-name: kaas-mgmt |
| 61 | # Label 'ipam/SVC-pxe-nics' is mandatory for this type of network. |
| 62 | ipam/SVC-pxe-nics: "presents" |
| 63 | spec: |
| 64 | cidr: 172.16.180.0/23 |
| 65 | gateway: 172.16.180.1 |
| 66 | includeRanges: |
| 67 | - 172.16.181.31-172.16.181.50 |
| 68 | |
| 69 | --- |
| 70 | apiVersion: "ipam.mirantis.com/v1alpha1" |
| 71 | kind: Subnet |
| 72 | metadata: |
| 73 | name: mgmt-k8s-api-lb |
| 74 | namespace: default |
| 75 | labels: |
| 76 | kaas.mirantis.com/provider: baremetal |
| 77 | cluster.sigs.k8s.io/cluster-name: kaas-mgmt |
| 78 | ipam/SVC-LBhost: "presents" |
| 79 | spec: |
| 80 | cidr: 172.16.181.3/32 |
| 81 | useWholeCidr: true |
| 82 | --- |
| 83 | # The 'mgmt-nics' Subnet defines the range of IP addresses to be allocated |
| 84 | # to the nodes in the management/LCM network. The IP address of Kubernetes |
| 85 | # API endpoint for the cluster is excluded from that range. The |
| 86 | # MetalLB address pools are also excluded from that range. |
| 87 | apiVersion: "ipam.mirantis.com/v1alpha1" |
| 88 | kind: Subnet |
| 89 | metadata: |
| 90 | name: mgmt-nics |
| 91 | namespace: default |
| 92 | labels: |
| 93 | kaas.mirantis.com/provider: baremetal |
| 94 | cluster.sigs.k8s.io/cluster-name: kaas-mgmt |
| 95 | ipam/SVC-k8s-lcm: "presents" |
| 96 | spec: |
| 97 | cidr: 172.16.180.0/23 |
| 98 | gateway: 172.16.180.1 |
| 99 | nameservers: |
| 100 | - 172.18.176.6 |
| 101 | - 8.8.8.8 |
| 102 | includeRanges: |
| 103 | - 172.16.181.51-172.16.181.100 |
| 104 | |
| 105 | --- |
| 106 | # The 'mgmt-k8s-lb' Subnet object defines the range of IP addresses |
| 107 | # used by MetalLB to expose services in the LCM/Management network. |
| 108 | # It defines the same MetalLB address pool that was previously defined |
| 109 | # in MetalLB chart values configInline parameter (which is deprecated). |
| 110 | # These services include Keycloak, MCC UI, Stacklight services, |
| 111 | # and the caching server for accessing the Container Cloud artifacts |
| 112 | # deployed on the hosts. |
| 113 | apiVersion: "ipam.mirantis.com/v1alpha1" |
| 114 | kind: Subnet |
| 115 | metadata: |
| 116 | name: mgmt-k8s-lb |
| 117 | namespace: default |
| 118 | labels: |
| 119 | kaas.mirantis.com/provider: baremetal |
| 120 | cluster.sigs.k8s.io/cluster-name: kaas-mgmt |
| 121 | ipam/SVC-MetalLB: "presents" |
| 122 | metallb/address-pool-auto-assign: "true" |
| 123 | metallb/address-pool-name: default |
| 124 | metallb/address-pool-protocol: layer2 |
| 125 | spec: |
| 126 | cidr: 172.16.180.0/23 |
| 127 | includeRanges: |
| 128 | - 172.16.181.101-172.16.181.140 |
| 129 | |
| 130 | --- |
| 131 | apiVersion: ipam.mirantis.com/v1alpha1 |
| 132 | kind: MetalLBConfigTemplate |
| 133 | metadata: |
| 134 | labels: |
| 135 | kaas.mirantis.com/provider: baremetal |
| 136 | cluster.sigs.k8s.io/cluster-name: kaas-mgmt |
| 137 | name: kaas-mgmt-metallb |
| 138 | namespace: default |
| 139 | spec: |
| 140 | templates: |
| 141 | l2Advertisements: | |
| 142 | - name: default |
| 143 | spec: |
| 144 | ipAddressPools: |
| 145 | - default |
| 146 | - services-pxe |
| 147 | --- |
| 148 | # L2Template allows you to create advanced host networking |
| 149 | # configurations for your management cluster. For example, |
| 150 | # you can create bond interfaces on top of physical interfaces |
| 151 | # on the host, or use multiple subnets to separate different |
| 152 | # types of network traffic. |
| 153 | # More elaborate network configurations for the management cluster |
| 154 | # require changes in this resource template and potential |
| 155 | # adding of more Subnet resources for other networks. |
| 156 | # For more details, see |
| 157 | # https://docs.mirantis.com/container-cloud/latest/deployment-guide/deploy-bm-mgmt.rst |
| 158 | apiVersion: ipam.mirantis.com/v1alpha1 |
| 159 | kind: L2Template |
| 160 | metadata: |
| 161 | name: default |
| 162 | namespace: default |
| 163 | labels: |
| 164 | kaas.mirantis.com/provider: baremetal |
| 165 | cluster.sigs.k8s.io/cluster-name: kaas-mgmt |
| 166 | ipam/DefaultForCluster: "1" |
| 167 | spec: |
| 168 | autoIfMappingPrio: |
| 169 | - provision |
| 170 | - enp |
| 171 | - eno |
| 172 | - ens |
| 173 | # The 'l3Layout' section defines the list of subnets to be used in the |
| 174 | # 'npTemplate' field. |
| 175 | l3Layout: |
| 176 | - scope: namespace |
| 177 | # 'subnetName' defines the name of the subnet that is used |
| 178 | # to refer to it throughout the 'npTemplate' below. |
| 179 | subnetName: kaas-mgmt |
| 180 | # 'labelSelector' is the combination of labels that allows |
| 181 | # detecting a unique subnet. These labels refer to the Subnet object. |
| 182 | labelSelector: |
| 183 | kaas.mirantis.com/provider: baremetal |
| 184 | ipam/SVC-k8s-lcm: "presents" |
| 185 | - scope: namespace |
| 186 | subnetName: mgmt-pxe |
| 187 | labelSelector: |
| 188 | kaas.mirantis.com/provider: baremetal |
| 189 | ipam/SVC-pxe-nics: "presents" |
| 190 | # The following is the template used to generate a netplan configuration |
| 191 | # file for Ubuntu. It contains an example of the definition of ethernet |
| 192 | # interfaces, with assigned addresses from the subnets defined in the 'l3Layout' |
| 193 | # field above. The gateway and nameservers are also |
| 194 | # taken from the subnet using the L2Temlpate-specific macros. |
| 195 | npTemplate: | |
| 196 | version: 2 |
| 197 | renderer: networkd |
| 198 | ethernets: |
| 199 | {{nic 0}}: |
| 200 | dhcp4: false |
| 201 | dhcp6: false |
| 202 | addresses: |
| 203 | - {{ip "0:kaas-mgmt"}} |
| 204 | gateway4: {{gateway_from_subnet "kaas-mgmt"}} |
| 205 | nameservers: |
| 206 | addresses: {{nameservers_from_subnet "kaas-mgmt"}} |
| 207 | match: |
| 208 | macaddress: {{mac 0}} |
| 209 | set-name: {{nic 0}} |