spiderpool
by apecloud
underlay CNI solution for kubernetes
About this chart
spiderpool
Introduction
The Spiderpool is an IP Address Management (IPAM) CNI plugin that assigns IP addresses for kubernetes clusters.
Any Container Network Interface (CNI) plugin supporting third-party IPAM plugins can use the Spiderpool.
Why Spiderpool
Most overlay CNIs, like Cilium and Calico, have a good implementation of IPAM, so the Spiderpool is not intentionally designed for these cases, but maybe integrated with them.
The Spiderpool is intentionally designed to use with underlay network, where administrators can accurately manage each IP.
Currently, in the community, the IPAM plugins such as whereabout, kube-ipam, static, dhcp, and host-local, few of them could help solve complex underlay-network issues, so we decide to develop the Spiderpool.
BTW, there are also some CNI plugins that could work on the underlay mode, such as kube-ovn and coil. But the Spiderpool provides lots of different features, you could see Features for details.
Features
The Spiderpool provides a large number of different features as follows.
-
Based on CRD storage, all operation could be done with kubernetes API-server.
-
Support for assigning IP addresses with three options: IPv4-only, IPv6-only, and dual-stack.
-
Support for working on the clusters with three options: IPv4-only, IPv6-only, and dual-stack.
-
Support for creating multiple ippools. Different namespaces and applications could monopolize or share an ippool.
-
An application could specify multiple backup ippool resources, in case that IP addresses in an ippool are out of use. Therefore, you neither need to scale up the IP resources in a fixed ippool, nor need to modify the application yaml to change a ippool.
-
Support to bind range of IP address only to an applications. No need to hard code an IP list in deployment yaml, which is not easy to modify. With Spiderpool, you only need to set the selector field of ippool and scale up or down the IP resource of an ippool dynamically.
-
Support Statefulset pod who will be always assigned same IP addresses.
-
Different pods in a single controller could get IP addresses from different subnets for an application deployed in different subnets or zones.
-
Administrator could safely edit ippool resources, the Spiderpool will help validate the modification and prevent from data race.
-
Collect resources in real time, especially for solving IP leakage or slow collection, which may make new pod fail to assign IP addresses.
-
Support ranges of CNI plugin who supports third-party IPAM plugins. Especially, the Spiderpool could help much for CNI like spiderflat, macvlan CNI, vlan CNI, ipvlan CNI, sriov CNI, ovs CNI.
-
Especially support for Multus CNI case to assign IP for multiple interfaces.
-
Have a good performance for assigning and collecting IP.
-
Support to reserve IP who will not be assigned to any pod.
-
Included metrics for looking into IP usage and issues.
-
By CidrManager, it could automatically create new ippool for application who needs fixed IP address, and retrieve the ippool when application is deleted. That could reduce the administrator workload.
-
Support for both AMD64 and ARM64.
Install
Quick Start
helm install spiderpool spiderpool/spiderpool --wait --namespace kube-system
NOTICE:
(1). By default, SpiderPool automatically installs Multus, and if your cluster already has Multus installed, you can use "--set multus.multusCNI.install=false" disable installing Multus.
(2). By default, spiderpool creates a corresponding Spidermultusconfig instance for the cluster default CNI (the first CNI configuration file under the /etc/cni/net.d path). If no CNI files are found, SpiderPool creates a Spidermultusconfig instance named default, and you need to manually update the CNI configuration of this instance after installation.
(3). You can manually specify the default CNI of the cluster through "--set multus.multusCNI.defaultCniCRName=". you need to manually create this instance after installation.
Init default IPPool
helm repo add spiderpool https://spidernet-io.github.io/spiderpool
IPV4_SUBNET_YOU_EXPECT="172.18.40.0/24"
IPV4_IPRANGES_YOU_EXPECT="172.18.40.40-172.20.40.200"
helm install spiderpool spiderpool/spiderpool --wait --namespace kube-system \
--set clusterDefaultPool.installIPv4IPPool=true \
--set clusterDefaultPool.ipv4Subnet=${IPV4_SUBNET_YOU_EXPECT} \
--set clusterDefaultPool.ipv4IPRanges={${IPV4_IPRANGES_YOU_EXPECT}}
NOTICE:
(1) if default ippool is installed by helm, please add '--wait' parament in the helm command. Because, the spiderpool will install webhook for checking spiderippool CRs, if the spiderpool controller pod is not running, the default ippool will fail to apply and the helm install command fails Or else, you could create default ippool after helm installation.
(2) spiderpool-controller pod is running as hostnetwork mode, and it needs take host port, it is set with podAntiAffinity to make sure that a node will only run a spiderpool-controller pod. so, if you set the replicas number of spiderpool-controller to be bigger than 2, make sure there is enough nodes
Parameters
Global parameters
| Name | Description | Value |
|---|---|---|
global.imageRegistryOverride | Global image registry for all images, which is used for offline environment | "" |
global.nameOverride | instance name | "" |
global.clusterDnsDomain | cluster dns domain | cluster.local |
global.commonAnnotations | Annotations to add to all deployed objects | {} |
global.commonLabels | Labels to add to all deployed objects | {} |
global.cniBinHostPath | the host path of the IPAM plugin directory. | /opt/cni/bin |
global.cniConfHostPath | the host path of the cni config directory | /etc/cni/net.d |
global.ipamUNIXSocketHostPath | the host path of unix domain socket for ipam plugin | /var/run/spidernet/spiderpool.sock |
global.configName | the configmap name | spiderpool-conf |
global.ciliumConfigMap | the cilium's configMap, default is kube-system/cilium-config | kube-system/cilium-config |
ipam parameters
| Name | Description | Value |
|---|---|---|
ipam.enableIPv4 | enable ipv4 | true |
ipam.enableIPv6 | enable ipv6 | true |
ipam.enableStatefulSet | the network mode | true |
ipam.enableKubevirtStaticIP | the feature to keep kubevirt vm pod static IP | true |
ipam.enableIPConflictDetection | enable IP conflict detection | false |
ipam.enableGatewayDetection | enable gateway detection | false |
ipam.enableCleanOutdatedEndpoint | enable clean outdated endpoint | false |
ipam.spiderSubnet.enable | SpiderSubnet feature. | true |
ipam.spiderSubnet.autoPool.enable | SpiderSubnet Auto IPPool feature. | true |
ipam.spiderSubnet.autoPool.defaultRedundantIPNumber | the default redundant IP number of SpiderSubnet feature auto-created IPPools | 1 |
ipam.gc.enabled | enable retrieve IP in spiderippool CR | true |
ipam.gc.gcAll.intervalInSecond | the gc all interval duration | 600 |
ipam.gc.statelessPod.zombieOnReadyNode | enable reclaim IP for the stateless pod who is over deleting graceful period on a ready node | true |
ipam.gc.statelessPod.zombieOnNotReadyNode | enable reclaim IP for the stateless pod who is over deleting graceful period on a not-ready node | true |
ipam.gc.statelessPod.enableGcRunningPodOnEmptyPodStatusIPs | enable reclaim IP for the stateless pod who is running and empty pod status IPs | false |
ipam.gc.gcDeletingTimeOutPodDelay | the gc delay seconds after the pod times out of deleting graceful period | 0 |
grafanaDashboard parameters
| Name | Description | Value |
|---|---|---|
grafanaDashboard.install | install grafanaDashboard for spiderpool. This requires the grafana operator CRDs to be available | false |
grafanaDashboard.namespace | the grafanaDashboard namespace. Default to the namespace of helm instance | "" |
grafanaDashboard.annotations | the additional annotations of spiderpool grafanaDashboard | {} |
grafanaDashboard.labels | the additional label of spiderpool grafanaDashboard | {} |
grafanaDashboard.allowCrossNamespaceImport | allow cross namespace import for Grafana dashboards | true |
grafanaDashboard.instanceSelector.matchLabels | Match labels for Grafana dashboards. If set to null, it defaults to matching operator.insight.io/managed-by: insight. | nil |
coordinator parameters
| Name | Description | Value |
|---|---|---|
coordinator.enabled | enable SpiderCoordinator | true |
coordinator.name | the name of the default SpiderCoordinator CR | default |
coordinator.mode | optional network mode, ["auto","underlay", "overlay", "disabled"] | auto |
coordinator.podCIDRType | Pod CIDR type that should be collected, [ "auto", "cluster", "calico", "cilium", "none" ] | auto |
coordinator.detectGateway | detect the reachability of th |
Deploy spiderpool with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has spiderpool on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartspiderpool is pinned at v1.2.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply