kots
kots copied to clipboard
Feature: common labels for applications
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 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.?
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.
Thanks, that helps.
Tracking internally here: https://app.clubhouse.io/replicated/story/27657
I'm in favor of adding the base kustomization.yaml.
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.