-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[processor/k8sattributes] Allow adding custom attributes from the ownerReferences chain #25837
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
This issue has been closed as inactive because it has been stale for 120 days with no activity. |
Component(s)
processor/k8sattributes
Is your feature request related to a problem? Please describe.
We use Argo Rollouts to allow us to do canary deployments. There are effectively a replacement for the Deployment resource, but with some additional control over the rollout process. Under the hood it works similarly to the Deployment controller: it creates ReplicaSets and adjusts their relative sizes; it just uses different criteria for making those adjustments.
Until #14003, the k8sattributeprocessor happily put the rollout's name in the
k8s.deployment.name
attribute, because the deployment name was based on a regex of the replicaset name. This wasn't exactly accurate, but it was definitely handy to have a common attribute across pods belonging to a Rollout.We haven't upgraded yet, but when we do this change will mean we lose this common attribute for pods in our lower-case-deployments, which are Rollouts instead of Deployments.
Describe the solution you'd like
I'd like to be able to configure the processor to add the name of a specific resource kind in the ownerRef chain. For my example of a Rollout, I'm imagining adding an
PodOwners
along sideMetadata
,Labels
, andAnnotations
in theExtractConfig
.The semantics would be to follow
ownerReferences
from the pod, and if one matches the configured api version and kind, add its name and/or uid as an attribute.This would mean my Rollout example could look like
or some similar alternative, eg require the
.uid
and.name
fields to be listed individually:I'm not sure if it's necessary to allow arbitrarily long ownerReferences chains. For Rollouts, it happens to have the same number of levels as Deployments (pod -> replicaset -> "real owner"). But if someone were using Flagger, then it manages a pair of deployments rather than managing replicasets directly, so the chain to the
Canary
object is pod -> replicaset -> deployment -> Canary.Describe alternatives you've considered
The main alternatives I see are:
k8sattributes
processor after 0.78.0 upgrade #23067 (comment)Additional context
There's some conversation in #23067 which is slightly relevant but doesn't get in the way of implementing this. The suggestion there is to stop tracking replicasets, and instead walk the ownerReferences chain from the pod directly, storing the replicasets' deployment metadata in an LRU cache.
The text was updated successfully, but these errors were encountered: