Hi! I'm using Prefect on K8s clusters and I would ...
# ask-community
o
Hi! I'm using Prefect on K8s clusters and I would need to track costs per projects and namespace. To achieve this, my plan was to add labels to the jobs. Before initializing
KubernetesRun
objects, I tried to modify the `metadata.labels`field, but apparently it gets overwritten by Prefect Cloud. I've also tried to modify
annotations
but that also didn't appear when checking
kubectl describe pod
. Is there a workaround or a different approach that comes to your mind?
1
b
Hi Oliver, how are you modifying the
metadata.labels
and
annotations
in the kubernetes job template? Are you utilizing customizations?
We have another helpful tutorial for customizing job templates here as well.
o
Ah, sorry, forgot to mention that I'm using Prefect 1.0. @Bianca Hoch Yes, I'm modifying the job template that I pass down to the
KubernetesRun
as dict
Thanks for the help, I found the issue: I've added the labels to metadata.labels and not to spec.template.metadata.labels.
1
🚀 1