Home

lastapplied

Lastapplied is a term used to describe the most recently applied configuration for a resource in declarative configuration workflows, most notably within Kubernetes when using kubectl apply. It refers to the manifest that a user previously submitted through an apply operation and serves as a baseline for subsequent updates.

In Kubernetes, the last applied configuration is stored on the resource as an annotation named kubectl.kubernetes.io/last-applied-configuration.

The last-applied annotation is primarily a client-side mechanism. It helps kubectl understand user intent during subsequent

With the introduction of server-side apply, Kubernetes began relying more on managedFields to track field ownership.

This
annotation
contains
a
JSON
representation
of
the
object’s
spec
as
it
was
when
the
last
successful
apply
occurred.
The
information
is
used
by
kubectl
apply
to
perform
a
three-way
merge:
it
compares
the
live
object,
the
last
applied
configuration,
and
the
new
desired
configuration
to
determine
what
changes
to
apply.
applies
and
supports
drift
detection
and
incremental
updates.
However,
it
is
not
the
authoritative
source
of
truth
for
the
resource’s
current
state,
which
is
reflected
in
the
live
spec
and
status.
If
a
user
edits
a
resource
directly
or
bypasses
apply,
the
last-applied
annotation
may
become
out
of
sync
with
reality
and
can
lead
to
surprising
patches
unless
re-applied.
In
that
context,
the
last-applied
annotation
remains
a
compatibility
artifact
and
may
be
less
central
to
state
reconciliation,
though
it
can
still
influence
traditional
client-side
apply
workflows.
See
also
kubectl
apply,
server-side
apply,
and
three-way
merge.