Skip to content
This repository has been archived by the owner on Jul 5, 2022. It is now read-only.

Quick Start

雾雨 edited this page Sep 24, 2020 · 10 revisions

Make sure you have calico node running, and minions/calico-libnetwork-plugin is disabled

  1. Download releases from Releases and unzip the archive, you will have main executable
  2. Check your calico node namespace according to Check Namespace
  3. Set Environment Variables
export ETCD_ENDPOINTS=http://127.0.0.1:2379
export BARREL_DOCKERD_PATH=/var/run/docker.sock
export BARREL_HOSTS=unix:///var/run/barrel.sock
# if namespace of step.2 is 'libnetwork' other then your hostname, then uncomment the line below
# export CALICO_LIBNETWORK_NAMESPACE=libnetwork
  1. Execute eru-barrel with command below
sudo --preserve-env=ETCD_ENDPOINTS --preserve-env=DOCKERD_SOCKET_PATH --preserve-env=BARREL_HOSTS --preserve-env=CALICO_LIBNETWORK_NAMESPACE ./eru-barrel
  1. Create docker network
# driver and ipam-driver name is fixed, don't change them
# subnet should be one cidr address of calico ip-pool
docker network create --ipam-driver calico-ipam --driver calico --subnet 10.1.0.0/16 barrelnet
  1. Create fixed ip container and start it, recording its ip
docker run --label fixed-ip --network barrelnet busybox:latest /bin/ash
  1. Stop the fixed container and restart it to check whether the ip is changed
  2. Remove the container and check whether the ip is released
calicoctl ipam show --ip 10.1.0.1