Azure Container Networking Solutions for Linux and Windows Containers
Перейти к файлу
Onur Filiz 512c840d73 Updated network config to omit empty JSON fields 2016-12-01 13:29:23 -08:00
cni Updated network config to omit empty JSON fields 2016-12-01 13:29:23 -08:00
cnm Moved CNM specific logic to CNM package 2016-11-30 17:56:49 -08:00
common Moved CNM specific logic to CNM package 2016-11-28 17:13:34 -08:00
ebtables Updated package references with new repo name 2016-10-06 14:40:29 -07:00
ipam Moved CNM specific logic to CNM package 2016-11-28 17:13:34 -08:00
log Added logfile support and made it the default log target 2016-10-18 15:12:13 -07:00
netlink Reset netlink sockets when changing network namespaces 2016-11-22 15:24:28 -08:00
network Moved CNM specific logic to CNM package 2016-11-28 17:13:34 -08:00
store Added lock timeouts to JSON store 2016-11-21 13:48:03 -08:00
.gitignore Added setup instructions to README 2016-11-11 18:04:48 -08:00
Dockerfile Added Dockerfile 2016-09-29 14:23:01 -07:00
Makefile Moved CNM specific logic to CNM package 2016-11-30 17:56:49 -08:00
README.md Added setup instructions to README 2016-11-11 18:04:48 -08:00

README.md

Overview

This repository contains plugins and tools for container networking in Azure:

  • A libnetwork (CNM) plugin for Docker containers on Microsoft Azure. The plugin connects containers to Azure's VNET, to take advantage of SDN capabilities.
  • A CNI plugin for Kubernetes and Mesos on Azure.

We welcome your feedback!

Setup

Download the latest official stable release from Docker plugin store.

$ docker plugin pull azure/azure-cnm-plugin

Build

If you want the very latest version, you can also build plugins directly from this repo.

Clone the azure-container-networking repo:

$ git clone https://github/com/Azure/azure-container-networking
$ cd azure-container-networking

Build the plugin for your environment. For Docker:

$ make azure-cnm-plugin

For Kubernetes and Mesos:

$ make azure-cni-plugin

The plugin is placed in the azure-container-networking/out directory.

Supported Environments

Microsoft Azure
Microsoft Azure Stack

Usage

Usage: azure-cnm-plugin [OPTIONS]

Options:
  -e, --environment={azure|mas}         Set the operating environment.
  -l, --log-level={info|debug}          Set the logging level.
  -t, --log-target={syslog|stderr}      Set the logging target.
  -?, --help                            Print usage and version information.

Examples

To connect your containers to other resources on your Azure virtual network, you need to first create a Docker network. A network is a group of uniquely addressable endpoints that can communicate with each other.

Create a network:

$ docker network create --driver=azurenet --ipam-driver=azureipam azure

When the command succeeds, it will return the network ID. Networks can also be listed by:

$ docker network ls
NETWORK ID          NAME                DRIVER              SCOPE
3159b0528a83        azure               azurenet            local
515779dadc8a        bridge              bridge              local
ed6e704a74ef        host                host                local
b35e3b663cc1        none                null                local

Connect containers to your network by specifying the network name when starting them:

$ docker run --net=azure -it ubuntu:latest /bin/bash

Finally, once all containers on the network exit, you can delete the network:

$ docker network rm azure

All endpoints on the network must be deleted before the network itself can be deleted.

Topology

The plugin creates a bridge for each underlying Azure virtual network. The bridge functions in L2 mode and is bridged to the host network interface. The bridge itself can also be assigned an IP address, turning it into a gateway for containers.

If the container host VM has multiple network interfaces, the primary network interface is reserved for management traffic. A secondary interface is used for container traffic whenever possible.

Changelog

See CHANGELOG

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.