Skip to content

Kubernetes Object Metadata

Gregory Nickonov edited this page Mar 4, 2019 · 2 revisions

KubernetesObjectMetadata

Kubernetes Documentation

Sunstone property Kubernetes property Type
annotations annotations String key to String value map
finalizers finalizers Array of String
labels labels String key to String value map
name name String
namespace namespace String

labels

Manipulates the labels map:

R.deployment :frontend do
  metadata do
    # Add single label with key 'color' and value 'blue'
    label color: 'blue'

    # Add two labels in one call
    labels feature: :frontend,
          component: :site
  end
end

annotations

Manipulates the annotations map:

R.deployment :frontend do
  # Add single annotation with key 'color' and value 'blue'
  metadata.annotation 'prometheus.io/scrape': 'true'

  # Add two labels in one call
  metadata.annotations 'services.example.org/red-blue': :red,
                       'services.example.org/weight': 100
end

finalizers

Manipulates the finalizers array:

R.deployment :frontend do
  metadata.finalizers 'finalizer-one', 'finalizer-two'

  metadata do
    finalizer 'another-finalizer'
  end
end

Clone this wiki locally