<p>In kubernetes, Deployments can have labels. But in my situation, I need the actual containers in a pod to have certain labels that triggers some action to be carried out by an agent on the node.</p>

<p>Is there a way to add specific labels to containers in Kubernetes?</p>

<p>You can't add a label to individual containers, only to the pod in which they are running. I'd suggest rather than using labels (which is for identifying info) to leverage pod <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/" rel="nofollow noreferrer">annotations</a>, potentially along with the <a href="https://kubernetes.io/docs/tasks/inject-data-application/downward-api-volume-expose-pod-information/" rel="nofollow noreferrer">downward API</a> for triggering actions.</p>
