Skip to content
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

Investigate alternative notion of managed resources than app.kubernetes.io/instance label #1482

Closed
alexec opened this issue Apr 17, 2019 · 5 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@alexec
Copy link
Contributor

alexec commented Apr 17, 2019

No description provided.

@alexec alexec added this to the v1.2 milestone Apr 17, 2019
@alexec alexec modified the milestones: v1.2, v1.3 Jun 1, 2019
@jessesuen jessesuen changed the title Investigate accurate notion of managed resources Investigate alternative notion of managed resources than app.kubernetes.io/instance label Jun 6, 2019
@jessesuen
Copy link
Member

For more context. See:

Essentially this issue is for us to find an alternative way to detect what is considered a "managed" resource of an application, which wouldn't involve label injection.

The issue that we currently face with the app.kubernetes.io/instance label is that there is friction about using this label with other common tooling such as:

  • helm - which started using app.kubernetes.io/instance as part of their default template generation, including using app.kubernetes.io/instance in selectors.
  • kustomize - which has a commonLabels feature that also potentially injects app.kubernetes.io/instance into selectors (provided the user specifies app.kubernetes.io/instance in their commonLabels).

Since v0.11, Argo CD no longer requires that the resource association to be driven by a label. Previously we depended on a label so that we could perform efficient kubernetes queries to perform resource discovery. Now, however, our live state metadata cache enables us to efficiently discover all resources associated with an application, without the use of a label. We simply need to inject the application name somewhere in the resource object. This could be a:

  • label (what we have today)
  • annotation
  • ownerReference (assuming cross-cluster ownerReference is valid)

In summary, our injection of app.kubernetes.io/instance seems that it may be too opinionated, causing the problems.

My ideal solution would be to inject an ownerReference to all managed resources that Argo CD deploys. However, I do not know if this is valid thing to do when the "owner" is a resource in an entirely different cluster. I posed this question to sig-api-machinery, and still waiting a response.

@alexec
Copy link
Contributor Author

alexec commented Jun 14, 2019

Note we might wish to use argocd.argoproj.io/instance for this as that is our convention.

@alexec alexec added enhancement New feature or request usability labels Jun 14, 2019
@alexec alexec modified the milestones: v1.3, v1.1, v1.2 Jun 14, 2019
@alexec
Copy link
Contributor Author

alexec commented Jul 10, 2019

@jessesuen did you get a response to your query in sig-api-machinery

@alexec alexec self-assigned this Jul 23, 2019
@alexec
Copy link
Contributor Author

alexec commented Jul 23, 2019

Document work-around.

@yann-soubeyrand
Copy link
Contributor

yann-soubeyrand commented Feb 26, 2020

Hi,
Shouldn't Argo CD use the common app.kubernetes.io/managed-by label (https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/)?
Edit: well, charts tend to set this label to helm so it would also conflict.

bilalshaikh42 added a commit to biosimulations/deployment that referenced this issue Mar 28, 2022
argocd uses app.kubernetes.io/instance to keep track of each app's resources.
But this can conflict with the values that helm uses. In this case, argo set the instance to "nginx-ingress" which caused the ServiceMonitor labels not to match, leading to the issues with scraping metrics. See argoproj/argo-cd#1482
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants