m-lab / index2ip

A CNI IPAM plugin for k8s on the M-Lab platform

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

index2ip

GoDoc Build Status Coverage Status Go Report Card

A CNI plugin to choose the right external IP for a pod running on a machine in the M-Lab fleet. Meant to be called as an IPAM plugin for ipvlan, which itself will be called as a delegate from multus. Networking and Kubernetes is plugins all the way down.

Usage

The ip chosen for the pod will be an increment over the IP of the host. The exact amount to increment will either be extracted from the network configuration in k8s, or, if no k8s configuration is specified, from the name of the pod itself (usually derived from the name of the deployment).

In the network config

In the network config, the increment should be specified as the index argument passed to the index2ip plugin. In your network config, at some level of depth that depends on your particular config, you should make a JSON snippet like:

{
   "index": 12,
}

In the name of the pod

If the pod name contains a string of the form index[0-9]+ (for example ndt-index12-111234-aa3b1) then the increment will be set equal to the integer following the index substring (12 in this example).

About

A CNI IPAM plugin for k8s on the M-Lab platform

License:Apache License 2.0


Languages

Language:Go 100.0%