19
© 2017 Infoblox Inc. All rights reserved. Infoblox Docker Plugin Deployment Guide - March 2017 Page 1 of 19 DEPLOYMENT GUIDE Infoblox Docker Plugin Deployment Guide For NIOS 7.3 and above

DEPLOYMENT GUIDE Infoblox Docker Plugin Deployment Guide · Infoblox Docker Plugin Deployment Guide - March 2017 Page 9 of 19 Check the new views corresponding to the parameters passed

Embed Size (px)

Citation preview

Page 1: DEPLOYMENT GUIDE Infoblox Docker Plugin Deployment Guide · Infoblox Docker Plugin Deployment Guide - March 2017 Page 9 of 19 Check the new views corresponding to the parameters passed

© 2017 Infoblox Inc. All rights reserved. Infoblox Docker Plugin Deployment Guide - March 2017 Page 1 of 19

DEPLOYMENT GUIDE

Infoblox Docker Plugin Deployment Guide For NIOS 7.3 and above

Page 2: DEPLOYMENT GUIDE Infoblox Docker Plugin Deployment Guide · Infoblox Docker Plugin Deployment Guide - March 2017 Page 9 of 19 Check the new views corresponding to the parameters passed

© 2017 Infoblox Inc. All rights reserved. Infoblox Docker Plugin Deployment Guide - March 2017 Page 2 of 19

Table of Contents

1 Introduction ............................................................................................................................... 3

2 Docker Installation ...................................................................................................................... 3

3 Deploy NIOS ............................................................................................................................... 4

4 Run Container in a Host .............................................................................................................. 4 4.1 Building the Plugin ............................................................................................................................4

4.1.1 Prerequisite...........................................................................................................................................4 4.1.2 Install Go 1.7 .........................................................................................................................................4 4.1.3 Set Environment ...................................................................................................................................4 4.1.4 Build Plugin ...........................................................................................................................................5 4.1.5 Create the Plugin Configuration File .....................................................................................................5 4.1.6 Run Plugin .............................................................................................................................................6

4.2 Run Infoblox Docker Container in Host ..............................................................................................6 4.3 Create Network ................................................................................................................................7 4.4 Create a container on the IPAM network ......................................................................................... 13

5 Tagged Networks ...................................................................................................................... 15 5.1 Create Tagged Network .................................................................................................................. 15 5.2 Create a Container on the Tagged Network ..................................................................................... 16 5.3 Create Tagged Network on Second Host .......................................................................................... 17

Page 3: DEPLOYMENT GUIDE Infoblox Docker Plugin Deployment Guide · Infoblox Docker Plugin Deployment Guide - March 2017 Page 9 of 19 Check the new views corresponding to the parameters passed

© 2017 Infoblox Inc. All rights reserved. Infoblox Docker Plugin Deployment Guide - March 2017 Page 3 of 19

1 Introduction

This document is the deployment guide for Infoblox Libnetwork Docker Plugin.

2 Docker Installation Create a Docker Host

Page 4: DEPLOYMENT GUIDE Infoblox Docker Plugin Deployment Guide · Infoblox Docker Plugin Deployment Guide - March 2017 Page 9 of 19 Check the new views corresponding to the parameters passed

© 2017 Infoblox Inc. All rights reserved. Infoblox Docker Plugin Deployment Guide - March 2017 Page 4 of 19

3 Deploy NIOS

Deploy NIOS and create an account that uses cloud API. Give permissions to the cloud

admin account.

4 Run Container in a Host

4.1 Building the Plugin

4.1.1 Prerequisite

Make sure gcc is installed on the system.

To build the Plugin, download the go 1.7

4.1.2 Install Go 1.7

Install Go 1.7

$ wget https://storage.googleapis.com/golang/go1.7.5.linux-amd64.tar.gz

Extract the file

$ tar zxvf go1.7.5.linux-amd64.tar.gz

$ mv go ~/

4.1.3 Set Environment

Add to .bashrc or .profile

export GOROOT=~/go

export GOPATH=~/workspace

PATH="$GOPATH/bin:~/go/bin:$PATH"

Page 5: DEPLOYMENT GUIDE Infoblox Docker Plugin Deployment Guide · Infoblox Docker Plugin Deployment Guide - March 2017 Page 9 of 19 Check the new views corresponding to the parameters passed

© 2017 Infoblox Inc. All rights reserved. Infoblox Docker Plugin Deployment Guide - March 2017 Page 5 of 19

Re open terminal or source the file

$ source ~/.profile

4.1.4 Build Plugin

Build plugin by following the steps

$go get github.com/docker/libnetwork

$go get github.com/docker/engine-api

$go get github.com/infobloxopen/infoblox-go-client

$github.com/infobloxopen/docker-infoblox

$cd $GOPATH/src/github.com/infobloxopen/docker-infoblox

$make

This will crete the file “ipam-driver”

4.1.5 Create the Plugin Configuration File

Create Infoblox Docker Plugin configuration file. It is a text file and name anything as per the setup, change

attributes in Red as per the values on the setup.

[plugin_config]

driver_name="infoblox"

plugin_dir="/run/docker/plugins"

[grid_config]

grid_host="nios.poc.infobloxdemo.com"

wapi_port="443"

wapi_username="cloudadmin"

wapi_password="cloudadmin"

wapi_version="2.0"

ssl_verify="false"

http_request_timeout=60

http_pool_connections=10

[ipam_config]

global_view="default"

global_container="10.10.0.0/16"

global_prefix=16

Page 6: DEPLOYMENT GUIDE Infoblox Docker Plugin Deployment Guide · Infoblox Docker Plugin Deployment Guide - March 2017 Page 9 of 19 Check the new views corresponding to the parameters passed

© 2017 Infoblox Inc. All rights reserved. Infoblox Docker Plugin Deployment Guide - March 2017 Page 6 of 19

local_view="default"

local_container="192.168.0.0/16"

local_prefix=24

4.1.6 Run Plugin

iuser@host-2:~$ sudo ./ipam-driver -conf-file plugin.conf

2017/03/24 12:04:22 Created Plugin Directory: '/run/docker/plugins'

2017/03/24 12:04:22 Driver Name: 'infoblox'

2017/03/24 12:04:22 Socket File: '/run/docker/plugins/infoblox.sock'

2017/03/24 12:04:22 Docker id is

'SARG:JNUO:ZLRM:PO4O:YUM3:BRFY:GDZB:DUAG:TZVB:5K6P:WMTR:HN55'

2017/03/24 12:04:45 'Activate' request: '%!s(<nil>)'

2017/03/24 12:04:45 'Activate' result: 'map[Implements:[IpamDriver]]'

2017/03/24 12:04:45 'GetCapabilities' request: '%!s(<nil>)'

2017/03/24 12:04:45 'GetCapabilities' result: 'map[RequiresMACAddress:%!s(bool=true)]'

2017/03/24 12:04:45 'GetDefaultAddressSpaces' request: '%!s(<nil>)'

2017/03/24 12:04:45 'GetDefaultAddressSpaces' result:

'map[LocalDefaultAddressSpace:networkview/ZG5zLm5ldHdvcmtfdmlldyQw:default/true

GlobalDefaultAddressSpace:networkview/ZG5zLm5ldHdvcmtfdmlldyQw:default/true]'

2017/03/24 12:04:45 'RequestPool' request: '&{networkview/ZG5zLm5ldHdvcmtfdmlldyQw:default/true map[]

%!s(bool=false)}'

2017/03/24 12:04:45 RequestPoolRequest is '&{networkview/ZG5zLm5ldHdvcmtfdmlldyQw:default/true map[]

false}'

2017/03/24 12:04:45 Allocating network from Container:'192.168.0.0/16'

2017/03/24 12:04:45 'RequestPool' result:

'map[PoolID:network/ZG5zLm5ldHdvcmskMTkyLjE2OC4wLjAvMjQvMA:192.168.0.0/24/default

Pool:192.168.0.0/24]'

2017/03/24 12:04:45 'RequestAddress' request:

'&{network/ZG5zLm5ldHdvcmskMTkyLjE2OC4wLjAvMjQvMA:192.168.0.0/24/default

map[RequestAddressType:com.docker.network.gateway]}'

2017/03/24 12:04:45 RequestAddressRequest contains empty MAC Address. '00:00:00:00:00:00' will be used.

2017/03/24 12:04:46 'RequestAddress' result: 'map[Address:192.168.0.1/24]'

4.2 Run Infoblox Docker Container in Host

docker run -e DOCKER_API_VERSION=1.22 -v /var/run:/var/run -v /run/docker:/run/docker infoblox/ipam-driver --grid-

host=172.26.1.2 --wapi-username=cloudadmin --wapi-password=cloudadmin --local-view=local_view --local-network-

container=“20.20.0.0/16" --local-prefix-length=24 --global-view=global_view --global-network-container=“10.10.0.0/16" --

global-prefix-length=24

Page 7: DEPLOYMENT GUIDE Infoblox Docker Plugin Deployment Guide · Infoblox Docker Plugin Deployment Guide - March 2017 Page 9 of 19 Check the new views corresponding to the parameters passed

© 2017 Infoblox Inc. All rights reserved. Infoblox Docker Plugin Deployment Guide - March 2017 Page 7 of 19

4.3 Create Network

Run docker command to create the network

$docker network create --ipam-driver=infoblox nios-priv-net-1

Page 8: DEPLOYMENT GUIDE Infoblox Docker Plugin Deployment Guide · Infoblox Docker Plugin Deployment Guide - March 2017 Page 9 of 19 Check the new views corresponding to the parameters passed

© 2017 Infoblox Inc. All rights reserved. Infoblox Docker Plugin Deployment Guide - March 2017 Page 8 of 19

This will create the network view and network under the view in NIOS

Restart the Grid Services

Page 9: DEPLOYMENT GUIDE Infoblox Docker Plugin Deployment Guide · Infoblox Docker Plugin Deployment Guide - March 2017 Page 9 of 19 Check the new views corresponding to the parameters passed

© 2017 Infoblox Inc. All rights reserved. Infoblox Docker Plugin Deployment Guide - March 2017 Page 9 of 19

Check the new views corresponding to the parameters passed to run the Infoblox Docker Plugin

New Container has been created and a network has been created in the container

Page 10: DEPLOYMENT GUIDE Infoblox Docker Plugin Deployment Guide · Infoblox Docker Plugin Deployment Guide - March 2017 Page 9 of 19 Check the new views corresponding to the parameters passed

© 2017 Infoblox Inc. All rights reserved. Infoblox Docker Plugin Deployment Guide - March 2017 Page 10 of 19

New network has been created

Create another network

$docker network create --ipam-driver=infoblox nios-priv-net-2

Page 11: DEPLOYMENT GUIDE Infoblox Docker Plugin Deployment Guide · Infoblox Docker Plugin Deployment Guide - March 2017 Page 9 of 19 Check the new views corresponding to the parameters passed

© 2017 Infoblox Inc. All rights reserved. Infoblox Docker Plugin Deployment Guide - March 2017 Page 11 of 19

New network has been created in NIOS and can be seen in Grid manager UI

Check the networks in Docker

Page 12: DEPLOYMENT GUIDE Infoblox Docker Plugin Deployment Guide · Infoblox Docker Plugin Deployment Guide - March 2017 Page 9 of 19 Check the new views corresponding to the parameters passed

© 2017 Infoblox Inc. All rights reserved. Infoblox Docker Plugin Deployment Guide - March 2017 Page 12 of 19

Inspect the created network

Page 13: DEPLOYMENT GUIDE Infoblox Docker Plugin Deployment Guide · Infoblox Docker Plugin Deployment Guide - March 2017 Page 9 of 19 Check the new views corresponding to the parameters passed

© 2017 Infoblox Inc. All rights reserved. Infoblox Docker Plugin Deployment Guide - March 2017 Page 13 of 19

4.4 Create a container on the IPAM network

$docker run -i -t --net=nios-priv-net-1 --name=centos-1 centos

Page 14: DEPLOYMENT GUIDE Infoblox Docker Plugin Deployment Guide · Infoblox Docker Plugin Deployment Guide - March 2017 Page 9 of 19 Check the new views corresponding to the parameters passed

© 2017 Infoblox Inc. All rights reserved. Infoblox Docker Plugin Deployment Guide - March 2017 Page 14 of 19

CentOS running in the container has been assigned IP address from NIOS. Below 20.20.20.2 has been allocated

to the machine -

This can also be seen in the Cloud tab

Page 15: DEPLOYMENT GUIDE Infoblox Docker Plugin Deployment Guide · Infoblox Docker Plugin Deployment Guide - March 2017 Page 9 of 19 Check the new views corresponding to the parameters passed

© 2017 Infoblox Inc. All rights reserved. Infoblox Docker Plugin Deployment Guide - March 2017 Page 15 of 19

5 Tagged Networks

Networks can be tagged through the Plugin. When Networks are tagged, they are not recreated again in NIOS

when the network is created on another host.

5.1 Create Tagged Network

Create a tagged network using

$docker network create --ipam-driver=infoblox --ipam-opt="network-name=blue" blue-net

New network is created in NIOS, Network name is set in the Extensible Attributes -

Page 16: DEPLOYMENT GUIDE Infoblox Docker Plugin Deployment Guide · Infoblox Docker Plugin Deployment Guide - March 2017 Page 9 of 19 Check the new views corresponding to the parameters passed

© 2017 Infoblox Inc. All rights reserved. Infoblox Docker Plugin Deployment Guide - March 2017 Page 16 of 19

5.2 Create a Container on the Tagged Network

Create a container on the tagged network -

Page 17: DEPLOYMENT GUIDE Infoblox Docker Plugin Deployment Guide · Infoblox Docker Plugin Deployment Guide - March 2017 Page 9 of 19 Check the new views corresponding to the parameters passed

© 2017 Infoblox Inc. All rights reserved. Infoblox Docker Plugin Deployment Guide - March 2017 Page 17 of 19

This has been assigned IP address 20.20.20.2

5.3 Create Tagged Network on Second Host

Page 18: DEPLOYMENT GUIDE Infoblox Docker Plugin Deployment Guide · Infoblox Docker Plugin Deployment Guide - March 2017 Page 9 of 19 Check the new views corresponding to the parameters passed

© 2017 Infoblox Inc. All rights reserved. Infoblox Docker Plugin Deployment Guide - March 2017 Page 18 of 19

Deploy NIOS container on the second host

Create tagged network on second host

Page 19: DEPLOYMENT GUIDE Infoblox Docker Plugin Deployment Guide · Infoblox Docker Plugin Deployment Guide - March 2017 Page 9 of 19 Check the new views corresponding to the parameters passed

© 2017 Infoblox Inc. All rights reserved. Infoblox Docker Plugin Deployment Guide - March 2017 Page 19 of 19

Run the busybox on second host

This container, on the second host, gets allocated the address from the tagged network.