Azure Container Networking Solutions for Linux and Windows Containers
Перейти к файлу
Onur 02b0c0417d Updated plugins to use OS-specific paths 2017-01-20 19:03:42 -08:00
build Added containerized build 2017-01-04 16:21:14 -08:00
cni Updated plugins to use OS-specific paths 2017-01-20 19:03:42 -08:00
cnm Updated plugins to use OS-specific paths 2017-01-20 19:03:42 -08:00
common Moved OS-specific logic to platform package 2017-01-20 16:21:41 -08:00
ebtables Refactored ebtables to remove redundant code 2017-01-03 15:08:16 -08:00
ipam Moved OS-specific logic to platform package 2017-01-20 16:21:41 -08:00
log Updated logger to use OS-specific logfile path 2017-01-20 16:23:24 -08:00
netlink Exposed GetIpAddressFamily and updated comments for godoc 2016-12-12 15:58:15 -08:00
network Moved OS-specific logic to platform package 2017-01-20 16:21:41 -08:00
platform Moved OS-specific logic to platform package 2017-01-20 16:21:41 -08:00
store Updated network and address managers to ignore stale persisted state from previous boots 2016-12-16 18:03:03 -08:00
.gitignore Added setup instructions to README 2016-11-11 18:04:48 -08:00
Dockerfile.build Added containerized build support 2017-01-11 18:05:54 -08:00
Dockerfile.cnm Added Docker managed plugin support 2017-01-06 17:36:02 -08:00
Makefile Moved OS-specific logic to platform package 2017-01-20 16:21:41 -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.