actions-runner-controller: Issue running 0.9.2. Listener crash restart loop when running inside ArgoCD
Checks
- I’ve already read https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners-with-actions-runner-controller/troubleshooting-actions-runner-controller-errors and I’m sure my issue is not covered in the troubleshooting guide.
- I am using charts that are officially provided
Controller Version
0.9.2
Deployment Method
ArgoCD
Checks
- This isn’t a question or user support case (For Q&A and community support, go to Discussions).
- I’ve read the Changelog before submitting this issue and I’m sure it’s not due to any recently-introduced backward-incompatible changes
To Reproduce
Installed the arc controller and runner set via Helm onto ArgoCD. Once everything came up, the controller would start up a listener that would just get stuck in a crash loop attempting to call out to github and failing GETs.
Describe the bug
When attempting to use the newest 0.9.2 version of the arc controller / runner sets, the listener that was spinning up kept having issues during startup. The screenshot below shows the issue that I was encountering. When downgrading to 0.9.1, the issue went away.
Describe the expected behavior
Additional Context
N/A
Controller Logs
The controller logs had nothing of use in them. They would spin up the listener, see that it died, and tried to spin up a new one. Over and over, forever.
Runner Pod Logs
N/A
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 25
- Comments: 26 (2 by maintainers)
Why would you just randomly start copying labels around with https://github.com/actions/actions-runner-controller/pull/3157? Thanks for wasting an hour of my time to not make the defaults in the helm ignore known problems. For gha-runner-scale-set-controller add this config:
Thank you all for doing the investigation! Although we don’t currently officially support ArgoCD, we should definitely fix this for the next release.
I agree, but
ownerReferencesshould be added for this purpose. Propagating the ArgoCD tracking label is definitely a blocking issue here.It looks like someone has a PR up to at least remove the adding of the label.
https://github.com/actions/actions-runner-controller/pull/3575
I think the key element here is ArgoCD. AutoscalingListener and associated pod should not be managed by ArgoCD but by the controller directly. AutoscalingListener resources are never generated by Helm, so ArgoCD will detect these resources as OutOfSync and try to remove them, which explains the SIGINT above. The problem comes from https://github.com/actions/actions-runner-controller/pull/3157 in version 0.9.2, which arbitrarily propagates labels to all resources created … including the tracking label used by ArgoCD, which therefore sees resources created by the controller as having been created by itself, which it tries to delete consecutively as there is no associated definition.
@nikola-jokic a quick solution would be to revert https://github.com/actions/actions-runner-controller/pull/3157 or add a new setting to disable it.
I agree with @xaemiphor here. This isn’t about “supporting ArgoCD”. The values files for both the controller and runner-sets should allow adding arbitrary labels to the resources that get spun up by them. Naively taking all the labels from one resource and applying them to child / spawned resources isn’t the right answer here.
@int128 Yea unfortunately it’s the whole object, while
ignoreDifferencesis for ignoring fields of a blessed object.@nikola-jokic I would argue this isn’t an issue of unsupported use of ArgoCD, but that #3157 was a large functional change forced onto users that has strong potential to cause issues due to other operators or operators imposed by k8s vendors. For example I have some proprietary operators that grant certain internal permissions, auto-inject various side-cars, or even swap some images based on labels that should not be replicated. If ArgoCD hadn’t fallen on it’s face from this change, we would’ve likely breached some security enforcement unknowingly, and potentially not detected it for quite a while. (Yes… test and evaluate outside of prod, not the point of the example.)
Could the issue described in #3157 not also been mostly resolved by simply setting the desired labels on the
listenerTemplatepodSpec from the helm chart? It doesn’t solve theRoleandRoleBindinglabels, but that feels like a safer feature to add. Like I’m all for adding another chart value to toggle that logic on/off, but it feels pretty sledge-hammery.Edit: Realized I’m not confident about how my message above reads, other than losing a day and costing my employer a day salary, I mean no anger/disrespect in the message. I wanted to highlight the non-ArgoCD perspective that ArgoCD canary’d for, so I wouldn’t really blame ArgoCD for that.
This is affecting me too with ArgoCD (thought we don’t use autosync so it’s more just an annoyance).
As a proper solution for this could we just be able to set arbitrary labels and annotations for these created resources, then at least I can add an annotation to make ArgoCD ignore them.
I’ve done some more investigation regarding ArgoCD and found that it only happens when ArgoCD is using labels for tracking resources. It’s not an issue with ArgoCD configured to use annotations for tracking resources.
I think the operator should support ArgoCD with label-based tracking if possible, but sharing it as a viable alternative. Switching from labels to annotations is a pretty smooth experience and does not cause resources to be re-created or anything.
I’ve also seen crossplane running into some issues - crossplane/crossplane#2121 also mentions it and using annotations as a solution to the problem.
More details can be found here: https://argo-cd.readthedocs.io/en/stable/user-guide/resource_tracking/
Argo CD maintainer here: we’re switching to annotation-based tracking by default in 3.0, and I recommend folks change their settings even before then if you can. The issues with label-based tracking have been known for a while (I just got off an incident review call where label-based tracking contributed to the issue). The annotation contains the full resource GVK/name/namespace, so it’s safe to copy, since Argo CD can tell when it’s been applied to a different resource.
Hi, just wanted to weigh in to this issue. We are using ArgoCD and had to roll back due same issue exposed on this thread.
That would make sense.
Given that though… the one nice thing about 0.9.2 is that the listener is seen by Argo. For those of us running ArgoCD setups, having K8s assets being spun up that aren’t tracked in Argo can be pretty confusing as that’s where people go to see the state of the world.
While excluding certain labels would resolve this, we opted to switch to annotation tracking. It’s what the ArgoCD maintainers also plan to do in the next major version as many operators use the same label propagation strategy. https://github.com/argoproj/argo-cd/issues/13981
@wojciechka thank you for pointing us in this direction.
Another ArgoCD user who had to revert with this upgrade. ArgoCD is pretty ubiquitous these days.
breaking usage with ArgoCD’s default configuration seems quite bad, especially since switching to annotations as tracking method is not exactly solving the issue entirely as the controller remains constantly in out of sync state
Edit turns out that was unrelated to the tracking method, still it’s another thing that started with 0.9.2
managd to solve it with following if anyone is interested