Inject node labels into Kubernetes pod

后端 未结 3 1224
死守一世寂寞
死守一世寂寞 2020-12-04 02:20

I am looking to deploy services to a Kubernetes cluster running over multiple zones and would like to be able to inject the region/zone labels into my pods using environment

3条回答
  •  北海茫月
    2020-12-04 03:00

    As a derivative of Tim St. Clair's answer, you may also consider writing out the pod metadata from within a PostStart container hook. Go grab the metadata you want from a well known URL. Then write it out to k8s via the API. This has the advantage that it is a one-and-done execution. No need to keep a side-car running since region and zone info won't change.

提交回复
热议问题