portainer: Cannot create container in ACS on Docker Swarm
Description When using Portainer to manage ACS i can see everything very nicely, but I cannot create a container due to “network X not found” error.
Steps to reproduce the issue:
- Get trial subscription for Ms Azure
- In Azure panel set up new Azure Container Service, I’ve used following settings:
- orchestrator is ofc Swarm
- West Europe region
- 1 master node
- 2 agents on A0 machines
- Let the deployment finish and go to resource group containing it
- Go to swarm-master-lb-* (Load Balancer for master node)
- Create Health Probe for port 9000 (rest default)
- Create Load balancing rule for port 9000 and use created health probe (rest default)
- Go to swarm-master-*-nic-* (Network Interface for master node)
- Write down IP from Overview/Private IP Address
- Go back to Resource Group/Deployments and pick the one at the top (successful one)
- Write down masterFQDN
- Write down sshMaster0
- Write down agentFQDN
- In step 2. You have given id-rsa.pub key from your machine. Connect to Your ACS from THAT machine using sshMaster0 (it’s whole ssh command so just copy&paste&run)
- You are connected to the master node
- Add Portainer as a service running CMD1 (below)
- In browser go to http://masterFQDN:9000 and set up admin password and log in
- You should be connected to swarm-master-* node
- Go to endpoints and add a new one with URL: IP_from_point_5_1:2375
- Now switch the active endpoint to newly created and voila! - You are in swarm right now.
- Go to containers
- Add container. I used following data:
- Name: asd123
- Image: nginx
- Click create - “network nat not found” error appears. You can go to Network and choose any network - same error will appear. When you go back to Containers, You will see that all containers were created (only in name, as they do not run on the machine).
CMD1
docker service create \
--name portainer \
--publish 9000:9000 \
--constraint 'node.role == manager' \
--mount type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock \
portainer/portainer \
-H unix:///var/run/docker.sock
In step 7. You can go through Docker configuration from CLI. After running docker ps
, a swarm & consul containers can be observed. To explore swarms insides run export DOCKER_HOST=:2375
and yet again go through Docker configuration from CLI (docker info
etc).
Please note, that only ports 80, 8080 and 443 are open in default, the rest has to be opened just like in step 4., but if You want ports for swarm agents, You have to do this in swarm-agent-lb-* instead
Technical details:
- Portainer version: using portainer/portainer:latest as of 20.03.2017, so 1.12.1
- Portainer Docker image tag (latest/arm/windows…): latest
- Docker info on master:
Containers: 3
Running: 3
Paused: 0
Stopped: 0
Images: 3
Server Version: 17.03.0-ce
Storage Driver: aufs
Root Dir: /var/lib/docker/aufs
Backing Filesystem: extfs
Dirs: 30
Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Swarm: active
NodeID: yii6byvhp35z9043p1f323qey
Is Manager: true
ClusterID: 52xpbowi6o339p54iwack8syp
Managers: 1
Nodes: 1
Orchestration:
Task History Retention Limit: 5
Raft:
Snapshot Interval: 10000
Number of Old Snapshots to Retain: 0
Heartbeat Tick: 1
Election Tick: 3
Dispatcher:
Heartbeat Period: 5 seconds
CA Configuration:
Expiry Duration: 3 months
Node Address: 172.16.0.5
Manager Addresses:
172.16.0.5:2377
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 977c511eda0925a723debdc94d09459af49d082a
runc version: a01dafd48bc1c7cc12bdb01206f9fea7dd6feb70
init version: 949e6fa
Security Options:
apparmor
Kernel Version: 3.19.0-65-generic
Operating System: Ubuntu 14.04.4 LTS
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 6.805 GiB
Name: swarm-master-6191C677-0
ID: STCA:BGR3:ZU2K:DVV5:XPF3:ALEO:PRDK:EEKG:LJEB:JAFV:JMKL:WYDS
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
WARNING: No swap limit support
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
- Docker version on master:
Client:
Version: 17.03.0-ce
API version: 1.26
Go version: go1.7.5
Git commit: 60ccb22
Built: Thu Feb 23 10:57:47 2017
OS/Arch: linux/amd64
Server:
Version: 17.03.0-ce
API version: 1.26 (minimum version 1.12)
Go version: go1.7.5
Git commit: 60ccb22
Built: Thu Feb 23 10:57:47 2017
OS/Arch: linux/amd64
Experimental: false
- Docker info on agent:
Containers: 2
Running: 2
Paused: 0
Stopped: 0
Images: 9
Role: primary
Strategy: spread
Filters: health, port, dependency, affinity, constraint
Nodes: 2
swarm-agent-6191C677000002: 10.0.0.6:2375
└ Status: Healthy
└ Containers: 1
└ Reserved CPUs: 0 / 1
└ Reserved Memory: 0 B / 702 MiB
└ Labels: executiondriver=<not supported>, kernelversion=3.19.0-65-generic, operatingsystem=Ubuntu 14.04.4 LTS, storagedriver=aufs
└ Error: (none)
└ UpdatedAt: 2017-03-19T23:59:39Z
swarm-agent-6191C677000003: 10.0.0.7:2375
└ Status: Healthy
└ Containers: 1
└ Reserved CPUs: 0 / 1
└ Reserved Memory: 0 B / 702 MiB
└ Labels: executiondriver=<not supported>, kernelversion=3.19.0-65-generic, operatingsystem=Ubuntu 14.04.4 LTS, storagedriver=aufs
└ Error: (none)
└ UpdatedAt: 2017-03-19T23:59:55Z
Plugins:
Volume:
Network:
Swarm:
NodeID:
Is Manager: false
Node Address:
Kernel Version: 3.19.0-65-generic
Operating System: linux
Architecture: amd64
CPUs: 2
Total Memory: 1.371 GiB
Name: 240ff827f0d5
Docker Root Dir:
Debug Mode (client): false
Debug Mode (server): false
WARNING: No kernel memory limit support
Experimental: false
Live Restore Enabled: false
- Docker version on agent:
Client:
Version: 17.03.0-ce
API version: 1.24 (downgraded from 1.26)
Go version: go1.7.5
Git commit: 60ccb22
Built: Thu Feb 23 10:57:47 2017
OS/Arch: linux/amd64
Server:
Version: swarm/1.1.0
API version: 1.22 (minimum version )
Go version: go1.5.3
Git commit: a0fd82b
Built: Thu Feb 4 08:55:18 UTC 2016
OS/Arch: linux/amd64
Experimental: false
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 26 (11 by maintainers)
@mkulagowski , Yes. It’s very strange.
I’ve made another test: use the network id. To me:
docker run -d --network=4efd39a8a75d yeasy/simple-web
It Works.