kots icon indicating copy to clipboard operation
kots copied to clipboard

Feature: common labels for applications

Open MikaelSmith opened this issue 5 years ago • 5 comments

KOTS applications use Kustomize under the hood. One feature that would be very useful to have from Kustomize when creating applications for KOTS is commonLabels. It allows me to remove a lot of redundant labeling and selectors.

I can think of two ways to implement this:

  • add a commonLabels property to the kots Application resource that gets passed through to the base kustomization
  • allow creating a kustomization.yaml in your application manifests that initializes the base kustomization. This allows using most of kustomize's features, although I don't have specific uses for others yet.

MikaelSmith avatar Oct 23 '20 18:10 MikaelSmith

@MikaelSmith Interesting idea. Can you elaborate on the problem and use case? What kinds of labels would you want to apply, where would you want them applied, what are you ultimately trying to achieve, etc.?

markpundsack avatar Oct 26 '20 16:10 markpundsack

We're primarily adding them to everything to identify all things common to our application. A app.kubernetes.io/part-of label (https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/). We might also add other labels or annotations, such as identifying the release version.

MikaelSmith avatar Oct 26 '20 17:10 MikaelSmith

Thanks, that helps.

markpundsack avatar Oct 27 '20 01:10 markpundsack

Tracking internally here: https://app.clubhouse.io/replicated/story/27657

I'm in favor of adding the base kustomization.yaml.

markpundsack avatar Oct 28 '20 19:10 markpundsack

We'd also like this to use with NetworkPolicy so we don't affect everything in a namespace. But maybe that's a bit of a fools errand.

MikaelSmith avatar Jan 19 '22 18:01 MikaelSmith