Names and labels
Shipmight employs a consistent naming and labeling strategy to all created Kubernetes resources.
Resources created by Shipmight have a unique ID, which consists of the resource name in a “slugified” form (can be turned off) and a number of random characters (can be configured, defaults to 5).
Resource names can't be used for querying resources of a specific type. Labels can.
Labels are used for storing resource-specific values which should also be queryable. Usually this includes things like related IDs and simple categories for grouping.
Label keys follow the pattern:
resourceTypeis one of the values listed below
fieldis some field related to the resource type (snake-case)
Possible values for
ext(special type for labels embedded into app charts)
Shipmight utilizes Kubernetes labels for querying related resources. For example, a domain can have the label
domains.shipmight.com/app-id: <id> which can be used to list domains linked to a specific app. For most resource types this is sufficient enough.
In case of apps, though, a link to a resource may be contained within the
values payload. For example, a
values.fileMounts contains references to files via their IDs. A registry selection for an app also references to a registry via its ID.
In these cases the resource IDs are extracted from
values and added as additional labels to the Secret:
This is simply to allow for querying related resources without having to read the payload of every Secret to check if it contains such a reference.
Annotations are used for storing resource-specific values which do not need to be queryable and/or contain data which is not possible to store in a label value.
Annotation names follow the same pattern as labels:
Refer to Labels for more information.