Skip to content

robbrockbank/libnetwork-plugin

 
 

Repository files navigation

Build Status Circle CI Coverage Status

#Libnetwork plugin for Calico

This plugin for Docker networking (libnetwork) is intended for use with Project Calico. Calico can be deployed on Docker using guides from the calico-docker repository.

##How to Run It When deployed using calicoctl (see calico-docker) simply pass in the --libnetwork flag.

  • To run a specific version of the plugin use the --libnetwork-image flag.

With Docker

Prebuilt docker images are available on DockerHub with tags available for each libnetwork-plugin release.

The container needs to be run using docker run -d --privileged --net=host -v /run/docker/plugins:/run/docker/plugins calico/node-libnetwork

  • Privileged is required since the container creates network devices.
  • Host network is used since the network changes need to occur in the host namespace
  • The /run/docker/plugins volume is used to allow the plugin to communicate with Docker.

If you don't have etcd available at localhost:4001 then you need to pass in the location as an environment variable e.g. -e ETCD_AUTHORITY=1.2.3.4:2379

From source

To run the plugin from source use gunicorn e.g. sudo gunicorn -b unix:///run/docker/plugins/calico.sock libnetwork.driver_plugin:app

For the full list of recommended options for use in production, see start.sh

For testing out changes, add the --reload flag or use make run-plugin-local

Install the dependencies from requirements.txt using pip install -r requirements.txt

Troubleshooting

Logging

Logs are sent to STDOUT. If using Docker these can be viewed with the docker logs command.

Changing the log level

This currently requires a rebuild. Change the line towards the top of the plugin code

Performance

Datastore Interactions

These don't include interactions from the Docker daemon or felix. These are interactions from the libnetwork-plugin only

Operation Reads Writes Deletes Notes
CreateNetwork 0 4 (5 if IPv4 and IPv6) 0 2 for creating profile (tags and rules), 1 per IP Pool, and 1 to store the request JSON
CreateEndpoint 1 1 0 Read CreateNetwork JSON and write Endpoint
Join None 0 0 0 None
DeleteNetwork 1 0 3 (4 if IPv4 and IPv6) Delete profile, pool and stored CreateNetwork JSON
DeleteEndpoint 0 0 1 Delete endpoint
Leave 0 0 0 None

Contributing and getting help

See the main Calico documentation

Further sources of getting help are listed in the calico-docker repository.

About

Docker libnetwork plugin for Project Calico

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 93.7%
  • Makefile 5.8%
  • Shell 0.5%