1

I'm attempting to add some recommended labels to several k8s resources, and I can't see a good way to add labels for things that would change frequently, in this case "app.kubernetes.io/instance" and "app.kubernetes.io/version". Instance seems like a label that should change every time a resource is deployed, and version seems like it should change when a new version is released, by git release or similar. I know that I could write a script to generate these values and interpolate them, but that's a lot of overhead for what seems like a common task. I'm stuck using Kustomize, so I can't just use Helm and have whatever variables I want. Is there a more straightforward way to apply labels like these?

EMC
  • 1,560
  • 2
  • 17
  • 31

1 Answers1

1

Kustomize's commonLabels transformer is a common way to handle this, sometimes via a component. It really depends on your overall layout.

coderanger
  • 52,400
  • 4
  • 52
  • 75