Build & Config

Service Tags and Annotations

Service tags

Service Tags are arbitrary strings of text which you can add to your services. When a service is deployed, these tags are transformed into Kubernetes labels.

Service Tags are added via the tags key in your service definition (service.yml). They are formatted as an array of strings that can have an optional key/value delimiter of = or :. Because they are propagated into Kubernetes, tags must follow the Kubernetes requirements for label string formats. Cloud 66 will warn you if your tags do not conform to these requirements.

Example:

service:
  service-name:
    ...
    tags:
    - "environment=production"
    - "customer:fred"
    - "highvisibility"

(Read our guide to using service.yml for more help on customizing your service configuration.)

When you deploy the service defined above, the following labels will be added to your Kubernetes Workload Resources for this service (ie. Deployments, Daemonsets, Jobs and Pods):

metadata:
  ...
  labels:
    ...
    environment: "production"
    customer: "fred"
    highvisibility: ""

Kubernetes expects a key/value pair for every label, so if one of your tags does not have a = or : delimiter we will create a label with an empty key value. You can see an example of this above with the highvisibility tag.

Cloud 66 labels

Cloud 66 will add some additional labels automatically to ensure your selectors are configured correctly.

Service Annotations

Service Annotations are a collections of arbitrary key/value pairs. When a service is deployed, these collections are transformed into Kubernetes annotations.

Service Annotations are added via the annotations key in your service definition (service.yml). They are a hash of the key/value pairs. Because they are propagated into Kubernetes, annotations must follow the Kubernetes requirements for annotation formats. Cloud 66 will warn you if your annotations do not conform.

Example:

service:
  service-name:
    ...
    annotations:
      me.com/environment: "production"
      me.com/customer: "fred"
      visibility: "high"

When you deploy the service defined above, the following annotations will be added to your Kubernetes Workload Resources for this service (ie. Deployments, Daemonsets, Jobs and Pods):

metadata:
  ...
  annotations:
    ...
    me.com/environment: "production"
    me.com/customer: "fred"
    visibility: "high"

Cloud 66 annotations

Cloud 66 will add some additional annotations automatically for internal use.

Previous
Configuring Service storage