agent
agent copied to clipboard
Support deployment in Swarm cluster with macvlan network
Following up disscussions in #95 and https://github.com/portainer/portainer/issues/3279 re-openning this issue. @deviantony
Since 1.5 realease portainer-agent won't run.
Here is my configurations: Portainer:
Portainer:
image: portainer/portainer
container_name: Portainer
hostname: Portainer
domainname: mydomain
restart: always
mac_address: xx:xx:xx:xx:xx:xx
networks:
mynet:
ipv4_address: 192.168.1.104
deploy:
mode: global
placement:
constraints:
- node.role == manager
- node.hostname == server
command: --no-auth --admin-password=''
volumes:
- /Dockers/Portainer:/data
- /etc/localtime:/etc/localtime:ro
environment:
- CAP_HOST_MANAGEMENT=true
Portainer-Agent:
Portainer-Agent-FRW:
image: "portainer/agent:dev"
container_name: Portainer-Agent-FRW
hostname: Portainer-Agent-FRW
domainname: mydomain
restart: always
mac_address: xx:xx:xx:xx:xx:xx
networks:
mynet:
ipv4_address: 192.168.1.134
deploy:
mode: global
placement:
constraints:
- node.hostname == server
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /var/lib/docker/volumes:/var/lib/docker/volumes
environment:
- AGENT_CLUSTER_ADDR=192.168.1.134
- CAP_HOST_MANAGEMENT=true
- LOG_LEVEL=debug
Network:
networks:
mynet:
name: mynet
driver: macvlan
driver_opts:
parent: ens18
ipam:
config:
- subnet: 192.168.1.0/24
Error:
│ 2019/10/23 07:31:58 [DEBUG] [docker] [network_name: mynet] [scope: local] [ingress: false] [message: Skipping invalid container network] │
│ 2019/10/23 07:31:58 [ERROR] [main,docker] [message: Unable to retrieve local agent IP address] [error: unable to retrieve the address on which │
│ the agent can advertise. Check your network settings] │
│ 2019/10/23 07:32:00 [DEBUG] [main,configuration] [Member tags: map[AgentPort:9001 EngineStatus:swarm NodeName:ubuntu NodeRole:manager]] │
│ 2019/10/23 07:32:00 [INFO] [main] [message: Agent running on a Swarm cluster node. Running in cluster mode]