workflow icon indicating copy to clipboard operation
workflow copied to clipboard

Annotating Pods through Deployments

Open melv-n opened this issue 8 years ago • 5 comments

For a variety of implementations it's necessary to attach annotations to Pods (kube2iam, k8s alpha features e.g. Node Affinity/Anti-Affinity, etc.). Normally one would add the annotation to the Deployment's .spec.template.metadata.annotations, resulting in each Pod carrying the proper annotation.

However, with Deis Workflow this is currently impossible to achieve, or at least persist. One can run kubectl edit deployment myapp-dev-cmd -n myapp-dev and add the desired annotation to .spec.template.metadata.annotations but this would be lost once a new version of the app is released.

Can we allow for a way to annotate Pods? Either through a deis command or by at least persisting the Deployment's set .spec.template.metadata.annotations when a new version is rolled out. This would allow for the combined use of existing k8s implementations with Deis Workflow.

melv-n avatar Mar 01 '17 09:03 melv-n

Similar but not quite the same: #545

melv-n avatar Mar 01 '17 09:03 melv-n

It seems to be becoming the standard to add features via annotations. There's a long list of things that require them already to function. Please support this!

blakebarnett avatar Mar 01 '17 17:03 blakebarnett

Agreed. Before annotations were kind of a "useless" feature in Kubernetes from the application's perspective. Now with apps supporting annotations out the wazoo (like kube2iam) I think it makes sense to bring it back to the table for discussion.

If someone feels motivated to work on a deis annotations:list/add/delete feature, that would be cool to see :)

bacongobbler avatar Mar 01 '17 17:03 bacongobbler

+1 on this, with a concrete use case: Prometheus metrics! The annotations look like:

  • prometheus.io/scrape: "true" or "false"
  • prometheus.io/port: port number

Then a Prometheus installation will pick up the pods automatically as they're scaled, and I'll get my metrics for APM. :) This particular use case could also really use multiple ports… one for public traffic, one to expose /metrics.

BrianHicks avatar Apr 07 '17 15:04 BrianHicks

This issue was moved to teamhephy/workflow#32

Cryptophobia avatar Mar 20 '18 20:03 Cryptophobia