News for hackers. Stuff that matters.
Re:The Guide to Kubernetes Labels by alexjplant on Wednesday September 01, 2021 @03:46PM (#28384722)
Uhhh...

> Instead, Kubernetes annotations are meant for sharing information with other colleagues. For example, you may use an annotation to record the phone number of the person responsible for a pod

...wat? The k8s docs say

> You can use Kubernetes annotations to attach arbitrary non-identifying metadata to objects. Clients such as tools and libraries can retrieve this metadata.

I've only ever seen them used in this fashion, i.e. declarative configuration facilitated by the control plane. Furthermore why would you have a _phone number_ as an annotation on a _pod_? If you're managing pods individually without a controller of some sort then you'd better have a really good reason.

Re:The Guide to Kubernetes Labels by webb on Wednesday September 01, 2021 @04:08PM (#28384954)
Yeah, I agree. I actually think that labels are a much better fit for this reference.

> Instead, Kubernetes annotations are meant for sharing information with other colleagues. For example, you may use an annotation to record the phone number of the person responsible for a pod

But it can be super helpful to put owner/contact info for alerting purposes as teams scale.

I also agree that having this metadata on the controller is helpful.

Re:The Guide to Kubernetes Labels by stumarkin on Wednesday September 01, 2021 @06:12PM (#28386164)
We discussed and agree, PR just merged to update this reference: https://github.com/kubecost/blog/pull/26
Re:The Guide to Kubernetes Labels by dan_quixote on Wednesday September 01, 2021 @04:25PM (#28385132)
Yup, used quite a lot for things like loadbalancer configuration (for instance): https://kubernetes-sigs.github.io/aws-load-balancer-controll...
Re:The Guide to Kubernetes Labels by GauntletWizard on Wednesday September 01, 2021 @03:49PM (#28384759)
I wouldn't use it on a pod directly, but I recommend that annotations on deployments include the oncall rotation that is responsible for them - And there's no real reason not to cascade that down onto pods as well.
Re:The Guide to Kubernetes Labels by wdb on Wednesday September 01, 2021 @04:21PM (#28385095)
Interesting, do you have an example how this would look like?
Re:The Guide to Kubernetes Labels by GauntletWizard on Wednesday September 01, 2021 @05:00PM (#28385460)
Just "company.com/pagerduty-service" as a "required" annotation (i.e. if you forget your namespace's team gets a reminder at their E-mail, which is another required annotation)

Namespace onboarding is self-service by pull request: a template namespace is in the readme, and contains a number of standard annotations like ldap group and etc. The kubernetes admin team accepts and merges those requests and the bot deploys the namespace folder to the clusters.

This is basically zero overhead at small groups and scales well to giant companies, you just add annotations and sometimes labels as business requirements and structure dictate.