You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 5, 2021. It is now read-only.
Support deployment as a variable for sourceName and sourceCategory
why
The following variables are already supported: %{namespace}, %{pod}, %{container}. There are uses for being able to refer to the deployment in the sourceName or category.
The text was updated successfully, but these errors were encountered:
Sorry for the long delay in responding. This plugin relies on fluent-plugin-kubernetes_metadata_filter to append metadata. It figures out which pod a log line belongs to based on its container name. We can readily get any info associated with a pod.
It's not impossible to go from a pod to a deployment but it might be more api intensive than other metadata requirements:
Find the pod's replicaset (e.g. kubectl get pod <pod> -o 'jsonpath={ .metadata.ownerReferences[?(.kind == "ReplicaSet")].name }')
Find the replicaset's deployment (kubectl get rs <rs> -o 'jsonpath={ .metadata.ownerReferences[?(.kind == "Deployment")].name }')
I suspect the fluent-plugin-kubernetes_metadata_filter will not be too keen on watching replicasets in addition to pods/namespaces so the PR there to make this optional but off by default might be fairly large/time-consuming.
If you're willing to standardize across your deployments, you can write a label out to your template and refer to it via %{label:<key>}:
The labels have the additional benefit of creating conventions of passing down other things you might find useful for inclusion in metadata tags, like the tag portion of the image.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
what
Support
deployment
as a variable for sourceName and sourceCategorywhy
The following variables are already supported: %{namespace}, %{pod}, %{container}. There are uses for being able to refer to the deployment in the sourceName or category.
The text was updated successfully, but these errors were encountered: