Overview
Every resource you create or read has three top-level sections:metadata, spec, and status. The spec and status sections are specific to each resource kind, but metadata is shared and looks the same everywhere:
metadata holds the resource’s identity (its name), the labels and annotations you use to organize and describe it, and a set of system-managed fields the platform maintains for you.
Fields you set
These are the metadata fields you provide when creating or changing a resource.Name
name identifies the resource within its scope. A Project-scoped resource’s name must be unique among resources of the same kind in that Project; a Platform-scoped resource’s name must be unique across the platform. Names are set once, at creation, and cannot be updated afterward — to “rename” a resource you delete it and create a new one.
Names follow the standard DNS-compatible naming rules (RFC 1123): lowercase alphanumeric characters and -, starting and ending with an alphanumeric character (for example, example-com).
Labels
Labels are key/value pairs meant to be queried and selected on. Use them to attach identifying dimensions — team ownership, environment, application, tier — that you’ll later want to filter by:Annotations
Annotations are also key/value pairs, but they are for arbitrary metadata that is not queried — longer descriptions, tool state, change-ticket references, contact info, or data that automation reads and writes. They are not used for selection or filtering, so there’s no penalty for larger or more free-form values.Labels vs. annotations: if you want to find or group resources by a value, use a label. If you just want to attach information to a resource, use an annotation.
Fields the platform manages
The platform populates and maintains the following fields automatically. They are read-only — do not set them in your manifests. They appear when you read a resource (for example withdatumctl get -o yaml), and are useful for inspection and automation.
The namespace field
You may notice ametadata.namespace field when you inspect a resource. In Datum Cloud you don’t manage namespaces directly — the user-facing scoping concept is the Project (or the Platform, for shared resources). Your active context determines where a resource lives, and the CLI sets scope with the --project flag rather than a namespace field you fill in by hand. See Contexts & scoping.
Working with metadata
- Read it:
datumctl get <resource> <name> -o yamlshows the fullmetadatablock, including the system-managed fields. See Reading resources. - Change it: set
name,labels, andannotationsin your manifest and apply withdatumctl apply -f. See Changing resources. - Explore it:
datumctl explain <resource>.metadataprints the live schema for the metadata block. See Discovering resources & schemas.
Related
- API conventions — where
metadatasits in theapiVersion/kind/spec/statusmodel. - Scopes — why a
namemust be unique within its Project or across the Platform. - Status & conditions — how
metadata.generationis compared against a condition’sobservedGeneration. - Field formats & types — the RFC 1123 rules for
nameand the map types used by labels and annotations. - Reading resources and Changing resources — read and set metadata with the CLI.
- Contexts & scoping — how the CLI resolves the
namespacefield from your active context.