From a75401a13bca7316c2162b95c6551eb2917d2614 Mon Sep 17 00:00:00 2001 From: Stefan Junker Date: Sun, 16 Aug 2015 02:30:04 +0200 Subject: [PATCH] host-local: allow ip request via CNI_ARGS A specific IP can now be requested via the environment variable CNI_ARGS, e.g. `CNI_ARGS=ip=1.2.3.4`. The plugin will try to reserve the specified IP. If this is not successful the execution will fail. --- host-local.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/host-local.md b/host-local.md index ff6ee775..35aba355 100644 --- a/host-local.md +++ b/host-local.md @@ -31,6 +31,11 @@ It stores the state locally on the host filesystem, therefore ensuring uniquenes * `gateway` (string, optional): IP inside of "subnet" to designate as the gateway. Defaults to ".1" IP inside of the "subnet" block. * `routes` (string, optional): list of routes to add to the container namespace. Each route is a dictionary with "dst" and optional "gw" fields. If "gw" is omitted, value of "gateway" will be used. +## Supported arguments +The following [CNI_ARGS](https://github.com/appc/cni/blob/master/SPEC.md#parameters) are supported: + +* `ip`: request a specific IP address from the subnet. If it's not available, the plugin will exit with an error + ## Files Allocated IP addresses are stored as files in /var/lib/cni/networks/$NETWORK_NAME.