How to dynamically update pod label from the pod itself
In this post, I explain how I assigned unique labels to pods in a StatefulSet based on values known only to the init-container. I used the Downward API to expose pod metadata, but instead of using it directly with kubectl, I leveraged curl and the Kubernetes API to add labels. This required setting up RBAC, a new ServiceAccount, and a RoleBinding to grant the necessary permissions.