Skip to content

A Kubernetes Operator that assigns pod subnets to nodes from a provided set a address pools

License

Notifications You must be signed in to change notification settings

StatCan/cidr-allocator

Repository files navigation

CIDR-Allocator

The CIDR-Allocator is a Kubernetes Operator that helps to implement dynamic IPAM irrespective of the Container Network Interface (CNI) being used.

At Statistics Canada, this operator is used to address an early design consideration for the Cloud Native Platform 2.0 (CNP2.0) related to our BGP route propagation solution.

In Kubernetes, a full PodCIDR must be allocated to a Node at creation-time since any modifications afterwards ti the PodCIDR or PodCIDRs fields are strictly prohibited.

This project follows the Kubernetes Operator Pattern

Architecture

CIDR-Allocator Solution Architecture

The controller watches for a NodeCIDRAllocation custom resource (CR) that will identify blocks of IPv4 addresses that will be used during the allocation of a PodCIDR range to a Node. A NodeSelector is used to identify which Node resources should align with each NodeCIDRAllocation that is defined. This gives us the flexibility to manage Pod IP allocation with as much or as little granularity as desired.

By default, the size of the assigned PodCIDR range will be equal to the MaxPods attribute on the Node resource

Installation

Install CIDR-Allocator from the official StatCan Helm Chart

helm repo add statcan-ca https://statcan.github.io/cidr-allocator
helm repo update
helm install cidr-allocator statcan-ca/cidr-allocator

For an example configuration for the NodeCIDRAllocation CR, please take a look at config/samples

Changelog

Changes to this project are tracked in the CHANGELOG which uses the keepachangelog format.

Test It Out (locally)

  1. Install the CRDs into the cluster:
make install
  1. Run your controller (this will run in the foreground, so switch to a new terminal if you want to leave it running):
make run

NOTE: You can also run this in one step by running: make install run


CIDR-Allocator

Comment contribuer

Voir CONTRIBUTING.md

Licence

Sauf indication contraire, le code source de ce projet est protégé par le droit d'auteur de la Couronne du gouvernement du Canada et distribué sous la licence MIT.

Le mot-symbole « Canada » et les éléments graphiques connexes liés à cette distribution sont protégés en vertu des lois portant sur les marques de commerce et le droit d'auteur. Aucune autorisation n'est accordée pour leur utilisation à l'extérieur des paramètres du programme de coordination de l'image de marque du gouvernement du Canada. Pour obtenir davantage de renseignements à ce sujet, veuillez consulter les Exigences pour l'image de marque.

About

A Kubernetes Operator that assigns pod subnets to nodes from a provided set a address pools

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published