vcluster
vcluster copied to clipboard
Add pod name and namespace also as pod labels
Is your feature request related to a problem?
Currently vcluster adds pod name and namespace as annotations to pods which it creates to host cluster.
When using filebeat with add_kubernetes_metadata in host cluster it includes pod labels as fields to log events but not annotations and currently that cannot be even configured on filebeat side (settings exist only for namespace and node annotations, not for pods).
Which solution do you suggest?
That why it would very useful if vcluster would include that same information also as labels to pods.
EDIT: after reading their documentation a bit more clearly also it would be very nice if vcluster would be able to copy deployment name to label in pod. Normally filebeat does add field deployment.name
but it can only do that when pod has ownerReferences
information which cannot exist in case of vcluster.
Which alternative solutions exist?
We are currently using Kyverno to copy those annotations to labels but that feels a bit dirty solution.
Additional context
No response
@olljanat thanks for creating this issue! I'm not sure if we should solve this in the scope of vcluster itself or if this might be better implemented in the context of a vcluster plugin. Especially since labels are rather restricted in terms of expressability (you have to obey RFC subdomain formats and char limits). We are also working currently on an easier way to define plugins through YAML format, which would also allow this in an easier fashion than writing your own plugin in golang.
[removed old comment] Sorry, meant to comment on and re-open another issue, but switched to the wrong tab.
Oops, commented on wrong issue, sorry.