Skip to content

feat: adds docker swarm support to docker-containers widget #517

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

Open
wants to merge 10 commits into
base: dev
Choose a base branch
from

Conversation

kuhree
Copy link

@kuhree kuhree commented Mar 25, 2025

I wanted to see docker swarm support (#403) so this is my attempt at that. I ended up just reusing the docker-containers widget with a mode property to switch between the two.

The config looks like this:

  - type: docker-containers
    mode: "swarm"

The result looks like this:
(left = mode: "standalone", right = mode: "swarm")
Screenshot 2025-03-25 at 5 22 20 PM

Docker Container for testing: ghcr.io/kuhree/glance:pr-517

Happy to make changes or adjustments.

@mortonpd
Copy link

Hello, thanks for working on this.

I am seeing an issue with service status showing shutdown when the service is running and using child/parent services.

View in glance:
image

View in portainer:
image

  - fix: error messages
  - refactor: uses map for latest tasks
  - fix: task sorting
@kuhree
Copy link
Author

kuhree commented Mar 27, 2025

I tried updating the task sorting to fix this. Not 100% sure it'll work but you can try the updated image ghcr.io/kuhree/glance:pr-517.

If it still doesn't work, could you run this script on a manager node and paste it into a pastebin or something? Feel free to redact any PII.

From your screenshot, you should be able to run something like /path/to/query.sh arris-stats_influxdb to get the info.

Then, I can mock it up locally and figure out what went wrong.

@mortonpd
Copy link

mortonpd commented Mar 28, 2025

Issue remains after task sorting update.

information from query.sh:

https://pastebin.com/GqntZ7wH

In a swarm I don't think the Created and Updated timestamps are a reliable way of determining whether a service is healthy or degraded. It would depend more on the scheduling mode of the service:

  • Replicated: The replicas number should match the number of 'running' tasks.
  • Global: The number should equal the number of 'active' nodes in a swarm.

@kuhree
Copy link
Author

kuhree commented Mar 28, 2025

Ahh that makes sense. I'll give that a shot.

@kuhree
Copy link
Author

kuhree commented Apr 2, 2025

New image available. I definitely agree that the scheduling is the way to go.

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

Successfully merging this pull request may close these issues.

2 participants