Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow the agent probe timeout and interval to be set #293

Closed
huib-portainer opened this issue Apr 13, 2022 · 0 comments
Closed

Allow the agent probe timeout and interval to be set #293

huib-portainer opened this issue Apr 13, 2022 · 0 comments

Comments

@huib-portainer
Copy link

Allow the agent probe timeout and interval to be set to improve instability issues of the agent within a Swarm cluster.

Optionally provide the environment variables to the agent:
AGENT_CLUSTER_PROBE_TIMEOUT which has a default value of 500ms
AGENT_CLUSTER_PROBE_INTERVAL which has a default value of 1s

These parameters should only be overriden when experiencing agent cluster instability
Default values should work in most clustering use cases but some cluster/network topologies might cause the agent cluster to be unstable and seeing a lot of agent join/leave cluster events.
There is no recommended value/range to be set here and instead it is recommended to experiment with different values if facing instability issues.

Example agent-develop-stack.yml

version: '3.2'
services:
  agent-develop:
    image: portainerci/agent:develop
    environment:
      AGENT_CLUSTER_PROBE_TIMEOUT: 500ms
      AGENT_CLUSTER_PROBE_INTERVAL: 1s
      LOG_LEVEL: DEBUG
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /var/lib/docker/volumes:/var/lib/docker/volumes
      - /:/host
    ports:
      - target: 9001
        published: 9001
        protocol: tcp
        mode: host
    networks:
      - portainer_agent
    deploy:
      mode: global
      placement:
        constraints: [node.platform.os == linux]
networks:
  portainer_agent:
    driver: overlay
    attachable: true

Which can be used as follows

docker stack deploy --compose-file=agent-develop-stack.yml portainer-agent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant