SubnetPool¶
This section describes the SubnetPool
resource used in
Mirantis Container Cloud API to manage a pool of addresses
from which subnets can be allocated.
For demonstration purposes, the Container Cloud SubnetPool
custom resource (CR) is split into the following major sections:
SubnetPool metadata¶
The Container Cloud SubnetPool
CR contains the following fields:
apiVersion
API version of the object that is
ipam.mirantis.com/v1alpha1
.
kind
Object type that is
SubnetPool
.
metadata
The
metadata
field contains the following subfields:name
Name of the
SubnetPool
object.
namespace
Project in which the
SubnetPool
object was created.
labels
Key-value pairs that are attached to the object:
kaas.mirantis.com/provider
Provider type that is
baremetal
.
kaas.mirantis.com/region
Region name.
Warning
Labels and annotations that are not documented in this API Reference are generated automatically by Container Cloud. Do not modify them using the Container Cloud API.
Configuration example:
apiVersion: ipam.mirantis.com/v1alpha1
kind: SubnetPool
metadata:
name: kaas-mgmt
namespace: default
labels:
kaas.mirantis.com/provider: baremetal
kaas.mirantis.com/region: region-one
SubnetPool spec¶
The spec
field of the SubnetPool
resource describes the desired state
of a subnet pool. It contains the following fields:
cidr
Valid IPv4 CIDR. For example, 10.10.0.0/16.
blockSize
IP address block size to use when assigning an IP address block to every new child
Subnet
object. For example, if you set/25
, every new childSubnet
will have 128 IPs to allocate. Possible values are from/29
to thecidr
size. Immutable.
nameservers
Optional. List of IP addresses of name servers to use for every new child
Subnet
object. Each element of the list is a single address, for example, 172.18.176.6. Default: empty.
gatewayPolicy
Optional. Method of assigning a gateway address to new child
Subnet
objects. Default:none
. Possible values are:first
- first IP of the IP address block assigned to a childSubnet
, for example, 10.11.10.1.last
- last IP of the IP address block assigned to a childSubnet
, for example, 10.11.10.254.none
- no gateway address.
Configuration example:
spec:
cidr: 10.10.0.0/16
blockSize: /25
nameservers:
- 172.18.176.6
gatewayPolicy: first
SubnetPool status¶
The status
field of the SubnetPool
resource describes the actual state
of a subnet pool. It contains the following fields:
statusMessage
Message that reflects the current status of the
SubnetPool
resource. Possible values are:OK
- a subnet pool is active.ERR: <error message>
- a subnet pool is in theFailure
state.TERM
- a subnet pool is terminating.
allocatedSubnets
List of allocated subnets. Each subnet has the
<CIDR>:<SUBNET_UID>
format.
blockSize
Block size to use for IP address assignments from the defined pool.
capacity
Total number of IP addresses to be allocated. Includes the number of allocatable and already allocated IP addresses.
allocatable
Number of subnets with the
blockSize
size that are available for allocation.
objCreated
Date, time, and IPAM version of the
SubnetPool
CR creation.
objStatusUpdated
Date, time, and IPAM version of the last update of the
status
field in theSubnetPool
CR.
objUpdated
Date, time, and IPAM version of the last
SubnetPool
CR update bykaas-ipam
.
Example:
status:
allocatedSubnets:
- 10.10.0.0/24:0272bfa9-19de-11eb-b591-0242ac110002
blockSize: /24
capacity: 54
allocatable: 51
objCreated: 2021-10-21T19:09:32Z by v5.1.0-20210930-121522-f5b2af8
objStatusUpdated: 2021-10-21T19:14:18.748114886Z by v5.1.0-20210930-121522-f5b2af8
objUpdated: 2021-10-21T19:09:32.606968024Z by v5.1.0-20210930-121522-f5b2af8
statusMessage: OK