I'm trying to figure out the best method for transferring a specific label from a Kubernetes node to the corresponding pods running on that node. Before diving into Kyverno with a MutatingPolicy, I want to know if there's a simpler approach I should consider first.
2 Answers
It really depends on your use case. Why do you need the node labels on the pods? For instance, some users need it for topology-aware services, which might be a good reason to proceed with this.
There's a new feature from Kubernetes that copies certain topology labels from nodes to pods. It works as an admission policy during the Binding phase. However, you need access to both the Binding object and the Node object to make this effective. If you're looking for guidance, check out the Kubernetes GitHub page for the admission policy implementation. Just a heads up, you might need to wait for an upgrade to version 1.35 if you're relying on AWS EKS for this!

I really need the zone label! Let's hope EKS gets the upgrade soon so we can utilize this.