✦ For everyone, free.

Practical knowledge for real and everyday life

Home

Kubernetes Metadata Time Fields

Kubernetes Metadata Time Fields track creation and update timestamps, providing critical temporal context for resource lifecycle management in containerized environments.

Kubernetes Metadata Time Fields are the timestamp-bearing fields within an object's metadata — creationTimestamp and deletionTimestamp chief among them — that record specific moments in an object's lifecycle, giving controllers, operators, and tooling a precise temporal reference for when an object came into existence and, where applicable, when its removal was initiated, distinct from the resourceVersion and generation counters that track change without any direct notion of wall-clock time at all.


creationTimestamp

Set Once, Immutable Thereafter

metadata.creationTimestamp is populated by the API server at the moment an object is first persisted and never changes for the remainder of that object's existence, including through any number of subsequent updates; it records only when the object came into being, not when it was last modified.

Precision and Format

The field is expressed as an RFC 3339 timestamp truncated to second-level precision, which is coarser than the microsecond or nanosecond precision some systems expect, a deliberate choice reflecting that creationTimestamp is intended for human-scale reasoning about object age rather than for fine-grained event ordering, a role resourceVersion is better suited to.

Common Uses

Controllers and tooling commonly use creationTimestamp to compute object age for display purposes (kubectl get renders an "AGE" column derived directly from it), for garbage collection policies based on retention windows, and for sorting or filtering objects by how recently they were created relative to one another.


deletionTimestamp

Marking the Start of Termination

metadata.deletionTimestamp remains unset for the entirety of an object's active life and is populated only when a delete request is issued against an object that still has one or more finalizers present, marking the moment deletion was requested rather than the moment the object actually disappears.

The Presence of This Field as a Signal

Because deletionTimestamp's mere presence (regardless of its exact value) signals that an object is in the process of being torn down, controllers commonly check for its presence as a branch condition in their reconciliation logic, treating a non-nil deletionTimestamp as "stop normal reconciliation, begin cleanup" rather than needing to compare the value against the current time.

Combined With Grace Period Semantics

For types like Pods where a grace period governs the actual termination sequence, deletionTimestamp combined with the object's terminationGracePeriodSeconds effectively defines a deadline by which the kubelet expects termination to have completed, though deletionTimestamp itself is set once, at request time, and does not advance or reset as that grace period elapses.


Timestamps Not Present in Metadata

No Built-In "Last Modified" Field

Notably, there is no direct equivalent of a "last updated" timestamp in metadata; resourceVersion changes on every update but is an opaque string with no direct wall-clock interpretation, meaning any component needing an actual last-modified timestamp typically maintains it within the object's own spec or status (such as a condition's lastTransitionTime) rather than relying on a generic metadata field that does not exist.

Condition-Level Timestamps as a Status-Layer Complement

Types that expose status conditions typically include their own lastTransitionTime and sometimes lastHeartbeatTime fields at the condition level, which serve the "when did this specific aspect last change or get reconfirmed" need that metadata's coarser creationTimestamp and deletionTimestamp cannot address on their own.


Time Fields and Cluster Clock Considerations

Reliance on API Server Clock Accuracy

Because these timestamps are set by the API server based on its own system clock, their accuracy depends on that clock being correctly synchronized; significant clock skew on the API server (or, transitively, on whichever node it runs on) can produce creationTimestamp or deletionTimestamp values that do not align with an operator's independently observed wall-clock time, a rare but real operational consideration for time-sensitive automation built around these fields.