BigBoot / AutoKuma

AutoKuma is a utility that automates the creation of Uptime Kuma monitors based on Docker container labels. With AutoKuma, you can eliminate the need for manual monitor creation in the Uptime Kuma UI.
MIT License
281 stars 15 forks source link

Using AutoKuma on Docker Standalone throws error #87

Open pxlfrk opened 1 week ago

pxlfrk commented 1 week ago

Hi all,

i am experimenting with AutoKuma on my current homelab setup:

For my test i setup a compose-file with autokuma and a a hello-world-container. my uptimekuma-Container is running in a seaprate compose-stack. Both stacks are connected via the backend-network.

services:

  hello_world:
    image: hello-world
    labels:
      - uptimeautokuma.helloworld.http.name = HelloWorldTest
      - uptimeautokuma.helloworld.http.url = https://achimkraemer.com

  autokuma:
    image: ghcr.io/bigboot/autokuma:master
    restart: unless-stopped
    container_name: ${COMPOSE_PROJECT_NAME}_autokuma
    env_file: stack.env
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    networks:
      - npm
      - backend
    environment:
      AUTOKUMA__KUMA__URL: http://uptimekuma:3001
      AUTOKUMA__KUMA__USERNAME: ${AUTOKUMA__KUMA__USERNAME}
      AUTOKUMA__KUMA__PASSWORD: ${AUTOKUMA__KUMA__PASSWORD}
      AUTOKUMA__KUMA__CALL_TIMEOUT: 5
      AUTOKUMA__KUMA__CONNECT_TIMEOUT: 5
      AUTOKUMA__ON_DELETE: delete
      AUTOKUMA__TAG_NAME: AutoKuma
      AUTOKUMA__TAG_COLOR: "#6FE199"

      AUTOKUMA__DOCKER__LABEL_PREFIX: uptimeautokuma
      AUTOKUMA__DOCKER__SOURCE: Both
      AUTOKUMA__DEFAULT_SETTINGS: |-
        http.max_redirects: 10
        *.max_retries: 5
        *.interval: 120
        *.retry_interval: 120

networks:
  npm:
    external: true
    name: npm
  backend:
    external: true
    name: uptimekuma_backend

Regardless of how i create these stacks (plain compose run via shell, logged in as root), via Portainer WebEditor or as Portainer Git-Stack i always encounter this message in the logs:

WARN [autokuma::sync] Encountered error during sync: Docker responded with status code 503: This node is not a swarm manager. Use "docker swarm init" or "docker swarm join" to connect this node to swarm and try again.

As far as i can tell from the docs, AutoKuma should be able to run on docker swarm as well as "plain" docker. Is there any misconfiguration in my setup/configuration or is this a bug in AutoKuma?

Thanks! 🥳

BigBoot commented 1 week ago

Hi, you set AutoKuma to use both containers and services, but services are a swarm only thing, just remove this line: AUTOKUMA__DOCKER__SOURCE: Both