Skip to content

Kubernetes backend : too many agents registered #2027

@ymettier

Description

@ymettier

Component

server, agent

Describe the bug

I noticed that I have a lot of agents declared in http://my-ci/admin/settings#agents.

After few tests, I noticed that every time I restart a pod with an agent, it registers itself, adding a new agent declared in http://my-ci/admin/settings#agents.

Note : in the Kubernetes world, pods can be deleted at any time, for load balancing, draining a node, upgrading, or any other good or bad reason. With the Helm chart provided at woodpecker-ci/helm the pods are under control of a Deployment, which means that they are stateless. Any new pod has no idea of the registration of the older one.

Bug : some cleanup should be done automatically when a pod is removed.

Suggestion : when an pod terminates, the agent should unregister before leaving.

System Info

{"source":"https://github.com/woodpecker-ci/woodpecker","version":"next-2e851ba4"}

Backend: Kubernetes

Additional context

No response

Validations

  • Read the Contributing Guidelines.
  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Checked that the bug isn't fixed in the next version already [https://woodpecker-ci.org/faq#which-version-of-woodpecker-should-i-use]
  • Check that this is a concrete bug. For Q&A join our Discord Chat Server or the Matrix room.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions