spiderpool

by apecloud

Helm chartv1.2.0App 1.2.0Apache-2.0Verified publisher

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

NameDescriptionValue
global.imageRegistryOverrideGlobal image registry for all images, which is used for offline environment""
global.nameOverrideinstance name""
global.clusterDnsDomaincluster dns domaincluster.local
global.commonAnnotationsAnnotations to add to all deployed objects{}
global.commonLabelsLabels to add to all deployed objects{}
global.cniBinHostPaththe host path of the IPAM plugin directory./opt/cni/bin
global.cniConfHostPaththe host path of the cni config directory/etc/cni/net.d
global.ipamUNIXSocketHostPaththe host path of unix domain socket for ipam plugin/var/run/spidernet/spiderpool.sock
global.configNamethe configmap namespiderpool-conf
global.ciliumConfigMapthe cilium's configMap, default is kube-system/cilium-configkube-system/cilium-config

ipam parameters

NameDescriptionValue
ipam.enableIPv4enable ipv4true
ipam.enableIPv6enable ipv6true
ipam.enableStatefulSetthe network modetrue
ipam.enableKubevirtStaticIPthe feature to keep kubevirt vm pod static IPtrue
ipam.enableIPConflictDetectionenable IP conflict detectionfalse
ipam.enableGatewayDetectionenable gateway detectionfalse
ipam.enableCleanOutdatedEndpointenable clean outdated endpointfalse
ipam.spiderSubnet.enableSpiderSubnet feature.true
ipam.spiderSubnet.autoPool.enableSpiderSubnet Auto IPPool feature.true
ipam.spiderSubnet.autoPool.defaultRedundantIPNumberthe default redundant IP number of SpiderSubnet feature auto-created IPPools1
ipam.gc.enabledenable retrieve IP in spiderippool CRtrue
ipam.gc.gcAll.intervalInSecondthe gc all interval duration600
ipam.gc.statelessPod.zombieOnReadyNodeenable reclaim IP for the stateless pod who is over deleting graceful period on a ready nodetrue
ipam.gc.statelessPod.zombieOnNotReadyNodeenable reclaim IP for the stateless pod who is over deleting graceful period on a not-ready nodetrue
ipam.gc.statelessPod.enableGcRunningPodOnEmptyPodStatusIPsenable reclaim IP for the stateless pod who is running and empty pod status IPsfalse
ipam.gc.gcDeletingTimeOutPodDelaythe gc delay seconds after the pod times out of deleting graceful period0

grafanaDashboard parameters

NameDescriptionValue
grafanaDashboard.installinstall grafanaDashboard for spiderpool. This requires the grafana operator CRDs to be availablefalse
grafanaDashboard.namespacethe grafanaDashboard namespace. Default to the namespace of helm instance""
grafanaDashboard.annotationsthe additional annotations of spiderpool grafanaDashboard{}
grafanaDashboard.labelsthe additional label of spiderpool grafanaDashboard{}
grafanaDashboard.allowCrossNamespaceImportallow cross namespace import for Grafana dashboardstrue
grafanaDashboard.instanceSelector.matchLabelsMatch labels for Grafana dashboards. If set to null, it defaults to matching operator.insight.io/managed-by: insight.nil

coordinator parameters

NameDescriptionValue
coordinator.enabledenable SpiderCoordinatortrue
coordinator.namethe name of the default SpiderCoordinator CRdefault
coordinator.modeoptional network mode, ["auto","underlay", "overlay", "disabled"]auto
coordinator.podCIDRTypePod CIDR type that should be collected, [ "auto", "cluster", "calico", "cilium", "none" ]auto
coordinator.detectGatewaydetect 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.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartspiderpool is pinned at v1.2.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. 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