Drone

How many drone-runners are working together with drone-server?

Hi everybody.

I’m trying to implement a scalable drone infrastructure in a docker swarm platform , right now I wish add a new worker in the swarm ( add a custom label ) and it can deploy a runner automatically.

This is my service definition

 drone-server:
    image: "${DRONE_SERVER_IMAGE:-drone/drone:latest}"
    networks:
      - net-public
    environment:
      DRONE_SERVER_HOST: drone.${WEB_DOMAIN}
      DRONE_SERVER_PROTO: "https"
      DRONE_LOGS_DEBUG: "true"
      DRONE_LOGS_TRACE: "true"
      DRONE_LOGS_PRETTY: "true"
      DRONE_RPC_SECRET: ${WEB_ADMIN_PASSWORD}
      DRONE_DATABASE_DRIVER: sqlite3
      DRONE_DATABASE_DATASOURCE: /var/lib/drone/drone.sqlite
      DRONE_TLS_AUTOCERT: "false"
      DRONE_USER_CREATE: username:${WEB_ADMIN_USERNAME},admin:true
      DRONE_GITEA_SERVER: "https://git.${WEB_DOMAIN}"
      DRONE_GITEA_CLIENT_ID:  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
      DRONE_GITEA_CLIENT_SECRET: ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
      DRONE_GITEA_SKIP_VERIFY: "true"
      DRONE_CRON_INTERVAL: 1m
      DRONE_CRON_DISABLED: "false"
     
    volumes:
      - drone-server-data:/var/lib/drone/
    deploy:
      placement:
        constraints:
          - node.labels.net-role.drone-server == true
      replicas: 1
      labels:
        - traefik.enable=true
        - traefik.frontend.rule=Host:drone.${WEB_DOMAIN}
        - traefik.docker.network=net-public
        - traefik.port=80
        - traefik.tags=net-public
        - traefik.redirectorservice.frontend.entryPoints=http
        - traefik.redirectorservice.frontend.redirect.entryPoint=https
        - traefik.webservice.frontend.entryPoints=https


  drone-runner:
    image: drone/drone-runner-docker:latest
    networks:
      - net-public
    environment:
      DRONE_RPC_HOST: drone-server
      DRONE_RPC_PROTO: http
      DRONE_RPC_SECRET: ${WEB_ADMIN_PASSWORD}
      DRONE_RUNNER_CAPACTIY: 8
      DRONE_DEBUG: "true"
      DRONE_TRACE: "true"
      DRONE_LOGS_TRACE: "true"
      DRONE_RUNNER_ENVIRON:  GIT_SSL_NO_VERIFY:"true"
      DRONE_RUNNER_NETWORKS: net-public
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    deploy:
      mode: global
      placement:
        constraints:
            - node.labels.net-role.drone-runner == true

The important thing is

    deploy:
      mode: global
      placement:
        constraints:
            - node.labels.net-role.drone-runner == true

When done , this work fine, but I can not review that drone-server knows all the runners available to distribute the workload. How can I review the runners availability from the server side?

There is any way also for activate/deactivate some of then when needed? any way to review communication status between server and runners?