Skip to content

Label terminology

Chris Selzo edited this page Oct 21, 2018 · 3 revisions

Label terminology

(This is broadly based on the k8s label document)

Labels are made up of key/value pairs.

For querying, a label_selector is used.

Label Keys

Label keys are made up of an (optional) prefix, and name. If a prefix is present, it is separated from the name by a /.

  • without a prefix: release
  • with a prefix: example.com/release

Label key prefix

  • Length restriction: 0-253 characters
  • Character restriction: DNS subdomain format (series of subdomain labels separated by .)
  • Valid examples:
    • beeblebrox
    • example.com
    • foo.bar.baz.somewhere.over.the.rainbow.capi.land
    • (literally empty)
  • Invalid examples:
    • .fun
    • dope.
    • foo..bar
    • @#$(@(
    • this.is.entirely.too.long.of.a.prefix.so.there.you.have.it.like.super.long.omg.it.repeats.this.is.entirely.too.long.of.a.prefix.so.there.you.have.it.like.super.long.omg.it.repeats.this.is.entirely.too.long.of.a.prefix.so.there.you.have.it.like.super.long

Label key name

  • Length restriction: 1-63 characters
  • Character restriction: alphanumeric with -, _, and . allowed. Must begin and end with alphanumeric.
  • Valid examples:
    • release_v1_duh
    • Production-cluster
    • billing.system.1234.foo
  • Invalid examples:
    • 1Direction
    • yoooooooooooooooooooooooooooooooooooooooooooThisIsLikeTooLongBrah
    • Datacenter-US-1
    • Something~Or

Label Values

  • Length restriction: 0-63 characters
  • Character restriction: alphanumeric with -, _, and . allowed. Must begin and end with alphanumeric.
  • Valid examples:
    • environment_v7_ultra
    • (literally empty)
    • Current-version
    • state.county.wa.king
  • Invalid examples:
    • 98Degrees
    • heyyoooooooooooooooooooooooooooooooooooooooooooWayTooLongMadame
    • Lets.count.to.10
    • Legend~~Of&&The##Forbidden@@Characters

Label Selectors

Each label_selector consists of one or more requirements, separated by a comma.

Clone this wiki locally