Skip to content
Install the CLI

Reference Policy and runtime contracts

Annotations, CRDs, and receipts

These docs describe Kix's main branch, which can include changes not yet released. Read the docs for the latest release.

When Kix compiles and deploys a cluster, it attaches kix.run/* labels and annotations to your manifests and writes lightweight tracking records into the cluster. You rarely need to set these annotations by hand because scope builders and the kix CLI manage them automatically, but this page is helpful when you are inspecting rendered YAML, debugging rollout order, or reading a deploy receipt from CI.

This page is maintained alongside kix/lib/core/annotations.nix, kix/lib/core/activation.nix, and cli/kix-core/src/manifest/keys.rs.

Most kix.run/* metadata is stamped automatically by resource builders (scope.mkResource, scope.mkSecret, scope.mkCRD, scope.mkCRDRef) or by the kix CLI during load and apply. Package authors should use the corresponding builder arguments (ownership.cede, readiness, holdsData, kix.untrackedRef) rather than writing kix.run/* annotations directly.

LabelPlaced onMeaning
app.kubernetes.io/managed-by: kixEvery Kix-rendered resource and CRD recordIdentifies objects managed by Kix (required by validation check 8). Pruning and garbage collection determine which Kix cluster deploys an object from its kix.run/identity-hash and each Kix cluster’s PackageInstanceRevision objects.
kix.run/clusterActivation and PackageInstanceRevision resourcesNames the Kix cluster that owns the record or revision so multiple Kix clusters can share a single Kubernetes cluster.
kix.run/kubernetes-uidActivation resources of a definition that sets cluster.kubernetes.uidThe UID of the Kubernetes cluster’s kube-system Namespace the build was bound to. While any record carries it, the Kubernetes cluster refuses definitions that do not set the UID. See Bind a cluster definition to its Kubernetes cluster.
kix.run/consumerNamespace resources in consumer clustersNames the consumer cluster (built with kix.interface) that owns the namespace, allowing platform network policies to select consumer pods.
kix.run/derivedDerived network policies"true" on network policy resources synthesized by Kix’s network policy plugin. (Derived PodDisruptionBudget objects do not carry this label.)
kix.run/policy-typeDerived network policiesRule category that produced a derived network policy ("default-deny", "caller-ingress", "scrape", "cr-operand", "apiserver-supplement", "external-ingress-supplement", "gateway", "ingress-controller", "operator-managed-workload", or "platform-intent"). Basic per-workload egress and ingress policies carry kix.run/derived: "true" without kix.run/policy-type.
kix.run/db-clusterstackgres-database and cnpg-database resourcesName of the target PostgreSQL cluster resource that the database belongs to.
pod-security.kubernetes.io/enforceNamespace resourcesPod Security Admission level (privileged, baseline, or restricted) set from namespaces.<name>.podSecurity, package meta.podSecurity, or a platform interface.

Build identity and live ownership annotations

Section titled “Build identity and live ownership annotations”
AnnotationWritten byMeaning
kix.run/identity-hashCLI on load32-character store hash of the sealed manifest. Changes whenever the manifest content or any dependency in its store context changes.
kix.run/packageCLI on loadName of the owning package instance.
kix.run/package-namespaceCLI on loadNamespace of the owning package instance.
kix.run/lifecycleCLI on loadLifecycle classification from meta.lifecycle ("stateful", "stateless", or "ephemeral"). Only "stateful" changes Kix behavior (requiring holdsData on custom resources in the instance and marking resources as stateful during migration checks); other values are informational.
kix.run/holds-datascope.mkResource / scope.mkCR"true" or "false". Indicates whether deleting the resource loses persistent data. Derived automatically for PersistentVolumeClaim, PersistentVolume, and StatefulSet resources with volumeClaimTemplates, and required via CRD holdsData for custom resources in stateful packages.
kix.run/built-viaCLI on ActivationStore path of the cluster activation index (kix-activation-<cluster>.json), a JSON file that names the store paths of kix-packages.json, kix-image-sources.json, and related build metadata. Records written by Kix 0.6 and earlier name the activation output directory (k8s-activation-<cluster>) instead, and Kix still reads them.
kix.run/withdrawn-kixCLI on ActivationWithdrawn Kix version that deployed or rolled back to this record when KIX_ALLOW_WITHDRAWN was set to that version. See Withdrawn releases.
kix.run/downgraded-fromCLI on ActivationNewer Kix version that last deployed the cluster, recorded when an older minor version deploys or rolls back to this Activation with KIX_ALLOW_DOWNGRADE set. See Deploys by an older Kix.

Deployment graph and apply behavior annotations

Section titled “Deployment graph and apply behavior annotations”
AnnotationSet viaMeaning
kix.run/depends-onNix string context, requires, controller, extraDepsComma-separated dependency entries (<hash>, requires:<hash>, controller:<hash>, extra:<hash>) that define the deployment dependency graph. All prefixes affect deploy and delete order the same way. A controller:<hash> entry comes from controller on scope.mkCRD or scope.mkCRDRef, and Kix uses it to report the controller’s status when deleting a custom resource times out ([K2794]).
kix.run/readinessreadiness on scope.mkCRD / scope.mkCRDRef, or on scope.mkCR for one resourceJSON readiness rule evaluated by kix deploy for custom resources. See kix.run/readiness.
kix.run/rerunscope.mkJob, on every Job it builds"on-change" on a Job resource. Instructs kix deploy, kix rollback, and the operator to delete and recreate the Job when its kix.run/rerun-hash changes. kix deploy and kix rollback also recreate it when its previous run failed. A change that leaves the Job’s own manifest alone, such as a new label on its namespace, updates the Job in place without running it again.
kix.run/rerun-hashscope.mkResource, on every resource that carries kix.run/rerunHash of the content that triggers a rerun. Combines the resource’s out.contentHash with the out.contentHash of each Kix-built Secret and ConfigMap that its pod reads through a volume, env, or envFrom (or equals out.contentHash when the pod reads none). Excludes kix.run/* metadata and other dependencies. Pod template checksum/* annotations are part of the Job’s own manifest, so changing one (such as an annotation set to another resource’s out.contentHash) also reruns the Job. Jobs deployed before Kix added this annotation run once more on the first deploy after upgrading.
kix.run/cede-fieldsownership.cede on scope.mkResource / scope.mkCRDComma-separated field paths another controller may take over after creation. See kix.run/cede-fields.
kix.run/expectskix.untrackedRef { kind; name; by?; }Comma-separated apiVersion|Kind|name entries that kix deploy waits to exist before applying the resource. See kix.run/expects.

Earlier versions of Kix wrote two additional annotations onto every object after applying it. Kix no longer writes them, and the first deploy after upgrading removes them (see The first deploy after upgrading).

AnnotationWhat it heldWhere Kix keeps it now
kix.run/activationsComma-separated identity hashes of the Activation records that included the object.status.revisions on the Activation record, which links to PackageInstanceRevision objects listing the objects.
kix.run/applied-hashHash of the fields Kix owned after its last apply.status.applied on the revision that lists the object.

If another Kix cluster on an earlier version also deploys a shared object, Kix keeps both annotations on that object until the other cluster upgrades, because the earlier version checks kix.run/activations before deleting orphans. Meanwhile, Kix appends its own deployment record hash to kix.run/activations.

Kix applies every object with Server-Side Apply under the field manager kix/<cluster>, where <cluster> is the Kix cluster’s name (such as kix/production). Kubernetes records each field manager in metadata.managedFields, showing which Kix clusters manage the object. When two Kix clusters set conflicting values for a field on a shared object, Kubernetes rejects the second apply and Kix stops with [K5636].

Earlier versions of Kix applied under the shared field manager kix for every Kix cluster. On the first deploy after upgrading, Kix renames kix to kix/<cluster> on each object listed in this cluster’s deployment records, and removes the Update entry under kix left by the retired annotations. On objects also deployed by another Kix cluster, Kix leaves the kix entry in place until every sharing cluster has its own kix/<cluster> entry and has upgraded to revisions. On an object never listed in this cluster’s deployment records, Kix applies without force and adds kix/<cluster> alongside any existing kix entry rather than claiming kix as its own.

Stamped on custom resources built via scope.mkCR when the CRD or CRD reference declares readiness, or when scope.mkCR receives its own readiness, which replaces the kind’s:

CRD readiness declarationStamped JSON valueWhen kix deploy considers the resource ready
{ path = "/status/phase"; equals = "Ready"; }{"equals":"Ready","path":"/status/phase"}The JSON pointer path equals "Ready" (booleans and numbers are compared as their JSON text, such as "true").
{ path = "/status/updateStatus"; notEquals = "failed"; }{"notEquals":"failed","path":"/status/updateStatus"}The JSON pointer path is absent or holds any value other than "failed".
{ condition = { type = "Programmed"; status = "True"; }; }{"condition":{"status":"True","type":"Programmed"}}status.conditions contains an entry with matching type and status.
{ condition = { type = "Valid"; status = "True"; }; failed = [ { condition = { type = "Valid"; status = "False"; }; } ]; }{"condition":{"status":"True","type":"Valid"},"failed":[{"condition":{"status":"False","type":"Valid"}}]}Ready as in the row above. When a failed entry matches instead, kix deploy stops waiting and fails the resource with the controller’s message.

A failed entry is { condition = { type; status; reason ? ...; }; } (the reason is matched only when declared) or { path; equals; rejected ? false; hint ? ...; message ? ...; }, where rejected = true makes the message say to change the object (the default for conditions), hint is the next step for a runtime outcome, and message is a JSON pointer, or a list of them, whose values the message quotes (stamped as a list). A match counts once the condition’s observedGeneration, or status.observedGeneration, has reached metadata.generation; without a generation, once the condition’s lastTransitionTime is later than this deploy’s apply of the object (an earlier one is not reported); and with neither field, once the match has held for ten seconds of polling. A version of Kix that predates failed ignores the key and waits as before.

Two more keys can sit beside the ready rule:

  • observedGeneration names the status field where the controller reports the generation it has acted on, as a JSON pointer such as "/status/desiredGeneration", or is false when the kind reports none. Without it, Kix reads status.observedGeneration. The ready rule, the failed entries, and pendingRestart wait until that field has reached metadata.generation. A declared field that is absent counts as not reached yet, while an absent status.observedGeneration imposes no wait. A condition’s own observedGeneration still comes first. A value that is neither a JSON pointer nor false makes Kix ignore the whole annotation.
  • pendingRestart is { condition = { type; status; reason ? ...; }; hint ? ...; } or { path; equals; hint ? ...; message ? ...; }. It names the state in which the controller has accepted the spec and the running workload keeps the previous one until it restarts. When it matches on a ready resource whose status is current, kix deploy reports the resource as ready with a restart pending, quoting the controller’s message and the hint. Without a generation, a condition that last changed before this deploy applied the resource is not reported. The JSON deploy log reports it as an awaiting_restart detail with the message.

A version of Kix that predates these keys ignores them, waits on status.observedGeneration, and reports plain ready.

Generated from ownership.cede = [ "spec.versions" "webhooks[*].rules" ]; on scope.mkResource or scope.mkCRD. Paths use server-side apply field notation without a leading dot. In lists, [*] matches any item, [2] matches zero-based index 2, and key selectors such as [name="web"] or spec.ports[port=53,protocol="UDP"].name match an item by its key fields (in the order shown in the API server’s conflict message). Write string values in double quotes and numbers without quotes: [port=53] matches the number 53, and [name="1"] matches the string "1". When an apply receives 409 Conflict from the API server and every conflicting path falls under a declared kix.run/cede-fields prefix, kix deploy retries the apply once with the ceded fields omitted so the external controller retains ownership of those fields. Forced applies (whether reverting drift or running with --force-conflicts) also omit any ceded field owned by another manager on the live object, so that manager keeps it.

Generated from the experimental attribute-set form of kix.untrackedRef when kind is specified (kix.untrackedRef { apiVersion = "v1"; kind = "Secret"; name = "webhook-cert"; by = self.certJob; }). Before applying the resource, kix deploy waits up to 180 seconds for each apiVersion|Kind|name target to exist.

AnnotationSet viaMeaning
kix.run/secret-keysscope.mkSecretComma-separated list of keys declared on the Secret.
kix.run/secret-sourcesscope.mkSecretComma-separated <key>=<source> pairs (inline, plain, sops, controller, or *=controller) read by the security.secretSource scorecard rule.
kix.run/sops-sourcescope.mkSecret (source)Store path of the encrypted SOPS file decrypted at deploy time.
kix.run/sops-digestscope.mkSecret (source)SHA-256 of the encrypted SOPS file, in hex. kix deploy checks the file against it before decrypting.
kix.run/secret-typescope.mkSecret (type)Kubernetes Secret type (defaults to "Opaque").
kix.run/classificationscope.mkSecret (meta.classification)Data classification (such as "configuration").
kix.run/rotation-policyscope.mkSecret (meta.rotationPolicy)Rotation policy metadata.
AnnotationMeaning
kix.run/operand-of"<group>/<Kind>/<name>" of the operator custom resource whose runtime pods a Service, NetworkPolicy, or PodDisruptionBudget selects.
kix.run/network-policy-widenedComma-separated reason codes (such as world-egress-services or pod-start-egress-open) added to a generated NetworkPolicy when it allows broader traffic than intended, such as CIDR rules matching in-cluster IPs or brief outbound traffic during pod startup. Written by the standard NetworkPolicy enforcer and checked by the security.networkPolicyWidened scorecard rule, which warns when a cluster.network setting can narrow the rule and reports platform limits at info.
kix.run/monitors-external-service"true" on a ServiceMonitor or VMServiceScrape that intentionally targets a Service outside the Kix build.
kix.run/roleReserved key (kix.keys.role); not currently stamped by built-in builders or packages.

Activation (activations.kix.run, API version kix.run/v1alpha1) is the cluster-scoped custom resource that serves as the root of a Kix cluster’s deployment graph and records deployment state on the Kubernetes cluster. When the CLI loads a build, it names the Activation <cluster>-<12-char identity-hash prefix> so each distinct build gets its own historical record on the cluster.

apiVersion: kix.run/v1alpha1
kind: Activation
metadata:
name: production-jak8b4glx8fn
labels:
app.kubernetes.io/managed-by: kix
kix.run/cluster: production
annotations:
kix.run/identity-hash: jak8b4glx8fnbq2c3hkb0khyyvigb96i
kix.run/built-via: /nix/store/...-kix-activation-production.json
kix.run/depends-on: ...
spec:
instances:
apps:
web: web
data:
postgres: postgres
PathTypeMeaning
spec.instancesobject ({ <namespace>: { <instance>: string } })Nested map from namespace and instance name to the PackageInstance resource name for every active instance in the build.
spec.consumersobject (optional)Hosted consumer clusters ({ <consumer>: { interface, sha256 } }) declared by a platform cluster.
spec.interfacesobject (optional)Platform interfaces ({ <platform>: { consumer, path, sha256 } }) that a consumer cluster was built against.
spec.sourceobject (optional)Build location for the Kix operator ({ type: "storePath", path }). Written only by kix deploy --operator and kix rollback --operator.
spec.requeststring (optional)Random token written on each run of kix deploy --operator or kix rollback --operator to ask the Kix operator to deploy this record. Compared by equality with status.startedRequest and status.finishedRequest, so clock differences between machines do not matter. Commands without --operator never set it.
status.phasestringLifecycle state: Queued, Deploying, Active, Degraded, Failed, Partial, or Superseded.
status.startedRequeststring (optional)Most recent spec.request token the Kix operator has started processing. When spec.request has a different value, that request is still waiting to start.
status.finishedRequeststring (optional)Most recent spec.request token the Kix operator has finished applying. kix deploy --operator and kix rollback --operator wait until this field or status.failedRequest.request matches spec.request, or the record enters Failed or Superseded.
status.failedRequestobject (optional)Most recent spec.request that failed on an Active or Degraded record, written when redeploying the current build fails. Contains request (the spec.request token), reason (why the redeploy failed), and at (RFC 3339 UTC timestamp). Because the operator leaves status.finishedRequest unchanged, older versions of Kix keep waiting rather than reporting success.
status.partialobject (optional)Present only when status.phase is Partial, written by kix deploy --only. Contains only (sorted namespace/instance names of every selected and required instance applied so far across --only runs of this build) and at (RFC 3339 UTC timestamp). Cleared when a new deploy of this record starts or when the record is marked Superseded.
status.receiptobjectProvenance record written by kix deploy (see Deploy receipt schema).
status.revisionsobject (optional)Map of PackageInstanceRevision objects for this deploy, written when the deploy starts and updated when it finishes. See Revision map.
status.packageIndexobject (optional)Legacy map of package instances and cluster-level resources to manifest identity hashes, written only by earlier versions of Kix. Kix still reads it on older records. See The package index.
status.orphansKeptFromarray of string (optional)Legacy list of previous activation build paths whose orphaned resources were kept when --prune was omitted. Kix still reads it on older records and clears it when a deploy finishes (replaced by the kept-orphans revision).

status.revisions links one revision per package instance in the build, one revision for cluster-level objects outside any package instance, and (when unpruned orphans remain) one kept-orphans revision.

PathTypeMeaning
formatintegerSchema version of the revision map. Kix reads and writes 1, and refuses to prune or garbage-collect when a deployment record has a format it cannot read.
instancesobjectMap from namespace/instance to the PackageInstanceRevision name for that package instance.
clusterLevelstringName of the PackageInstanceRevision for cluster-level objects outside any package instance, such as Namespaces.
keptOrphansstring (optional)Name of the PackageInstanceRevision listing orphans kept by this deploy or earlier deploys that ran without --prune. kix deploy --prune and kix gc delete the objects it lists.
status:
revisions:
format: 1
instances:
apps/web: production-3f1c0a9e5b7d2c4e8a6f0b1d3c5e7a9b
data/postgres: production-8e2d4c6a0b1f3e5d7c9a2b4d6f8e0a1c
clusterLevel: production-1a3c5e7b9d0f2a4c6e8b0d1f3a5c7e9b
keptOrphans: production-5b7d9f1a3c5e7b9d0f2a4c6e8b0d1f3a

When a package instance is unchanged from the previous deploy, status.revisions reuses the existing revision name.

Earlier versions of Kix wrote status.packageIndex to list a deploy’s objects grouped by package. Kix still reads status.packageIndex on older records and writes revisions instead on new deploys. Commands that read the cluster without building it, such as kix status and kix diff, use it to group objects by package and to find objects that are gone from the cluster.

PathTypeMeaning
formatintegerVersion of the index’s shape. Readers check it before the rest.
packagesobjectMap from namespace/instance to { instance, resources }: the identity hash of the package’s PackageInstance, and the identity hashes of its resources.
clusterLevelarray of stringIdentity hashes of the resources no package lists, such as Namespaces.
namesobject (optional)Map from each object’s identity hash to [kind, namespace, name]. namespace is "" for a cluster-scoped object.
groupsobject (optional)Map from each object’s identity hash to its API group (such as apps or kix.run) for objects in names outside the core v1 API group. Kix treats any object in names without a groups entry as part of the core v1 API group, including in indexes written by earlier versions.
status:
packageIndex:
format: 1
packages:
default/web:
instance: 1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
resources: [3aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]
clusterLevel: [4aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]
names:
1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa: [PackageInstance, default, web]
3aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa: [ConfigMap, default, web-config]
4aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa: [Namespace, "", default]
groups:
1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa: kix.run

The index had a size limit of 150 KiB, so a record of a large deploy may have an index without names, or none.

Activation lifecycle and operator finalizer

Section titled “Activation lifecycle and operator finalizer”
  • Queued -> Deploying -> Active | Degraded | Failed | Partial -> Superseded: kix deploy creates or updates the Activation record before applying the first wave. Active means every resource applied and became ready. Degraded means the deploy completed but one or more resources failed readiness; it remains the cluster’s current activation. Failed means the deploy aborted before completion. Partial means kix deploy --only applied every selected resource and left the rest of the build for a later deploy (recorded in status.partial). After a Failed or Partial record, the next deploy uses the previous Active or Degraded activation as its primary diff baseline while also sweeping changes from that run.
  • Operator requests (--operator): Each run of kix deploy --operator or kix rollback --operator writes a new token to spec.request, and the Kix operator copies it to status.startedRequest when work begins. If the record is Superseded, Failed, or Partial (for example, during kix rollback --operator, a retry of a failed deploy, or a full deploy after kix deploy --only), the operator sets status.phase back to Queued and deploys the build. During any new deploy or rollback, the cluster’s existing Active or Degraded record remains current until the deploy finishes, when the operator marks it Superseded. If the deploy reaches Failed instead, that record remains current and the operator restores the cluster to match it. If the record is already Active or Degraded (when kix deploy --operator redeploys the current build), it keeps that phase while the operator applies the build again. Once per request, when the deploy starts, the operator reruns any Job marked kix.run/rerun whose last run failed. When the deploy finishes, the operator writes the token to status.finishedRequest. If redeploying the current build fails, the operator writes the token and failure reason to status.failedRequest instead of status.finishedRequest, and the record keeps its phase.
  • Operator features (kix.run/operator-features): On startup, the Kix operator sets kix.run/operator-features on the activations.kix.run CustomResourceDefinition to requests,head-lock,revisions: requests (processes spec.request), head-lock (takes each Kix cluster’s deploy lock before modifying the cluster), and revisions (records deployed objects in revisions instead of writing post-apply annotations on workload objects). kix deploy --operator and kix rollback --operator check this annotation before making changes and stop with [K9557] if any feature is missing, because an older operator ignores spec.request, deploys without the deploy lock, or writes back the retired annotations. Other cluster-modifying commands also stop with [K9557] before planning if an active, queued, or deploying record for that Kix cluster has spec.source (meaning the operator manages it) and the annotation lacks revisions (including operators from Kix 0.9 or earlier, which write no annotation). Other Kix clusters on the same Kubernetes cluster are unaffected. If you uninstalled the operator, run kix deploy <cluster> --operator-removed once to reclaim the cluster (see --operator-removed).
  • In-cluster operator (--operator): When managed by kix-operator, the record carries the finalizer kix.run/operator-gc. Deleting an Active, Deploying, or Degraded Activation causes the operator to delete all resources owned by that activation except Namespace and CustomResourceDefinition objects. Deleting a Superseded record (for example, during kix gc --operator) simply removes the finalizer.

ActivationHead (activationheads.kix.run, API version kix.run/v1alpha1) is a cluster-scoped custom resource. Each Kix cluster has one, named after the Kix cluster and labelled kix.run/cluster. It holds the cluster’s deploy lock, names the active deployment record, and records the Kix version that last changed the cluster. An Activation record without a kix.run/cluster label uses an ActivationHead named after the record itself.

Kix installs its four CustomResourceDefinitions automatically (activations.kix.run, packageinstances.kix.run, activationheads.kix.run, and packageinstancerevisions.kix.run), and cluster builds do not include them. Before taking the lock, kix deploy, kix rollback, kix gc, and kix migrate domain create any missing CRD, as does the Kix operator on startup. Each CRD carries a kix.run/definition annotation recording its schema revision: newer versions of Kix update older CRD definitions, while older versions of Kix leave newer definitions untouched and stop with an error only if the cluster’s CRD no longer serves the API version they require.

The activationheads.kix.run CRD has no status subresource. On every write, Kix replaces the whole object with the resourceVersion it read, so the Kubernetes API server rejects concurrent writes. Do not edit ActivationHead objects directly; inspect them with kubectl get activationhead or kix status.

FieldMeaning
status.currentName of the active Activation record for the cluster. A deploy or rollback updates this field in a single write after applying all resources and before updating Activation record phases.
status.generationCounter that increments whenever a run that modified the cluster commits or releases the lock (including finished or stopped deploys, --only deploys, and kix gc), when a run takes over an expired lock, or when Kix repairs out-of-sync state. Plans record this number, and commands stop if it changed before they take the lock. Operator drift repair does not increment it.
status.lockPresent while a run holds the lock: holder (run ID; the operator’s ID stays constant across pod restarts), hint (human-readable caller, such as kix deploy by ana@laptop, process 4242), activation (record being deployed, if any), purpose (deploy, rollback, gc, migrate, repair, or teardown), renewed (RFC 3339 timestamp from the holder’s clock), durationSeconds (lease duration: 30), and waiting (ID of a run waiting for operator drift repair to yield).
status.writerKix version that last modified the cluster: version and program (cli or operator). Used by the required stops and older Kix checks. Omitted before a lock-aware Kix writes to the cluster, or after Kix rebuilds ActivationHead following a deploy by an older Kix; in both cases, those checks fall back to the active record’s deploy receipt.

An active holder renews its lock every 10 seconds. When another run finds the lock held, it watches for up to 30 seconds: if the holder renews, the waiting run stops; if nothing renews for 30 seconds, the waiting run takes over the lock and marks any other record the stopped run was deploying as Failed.

If ActivationHead and the Activation record phases disagree, the next run that takes the lock reconciles them. When the Activation record named in status.current no longer exists or is in phase Superseded while another record is Active or Degraded (for example, after an older Kix deployed), when another record without status.revisions is Active or Degraded while the record in status.current still is too (because an earlier version of Kix deployed after this version), or when ActivationHead has no status (such as on first creation or after restoring a backup without status), Kix rebuilds ActivationHead from the record phases. When the record named in status.current exists without an Active or Degraded phase (because a deploy stopped after updating ActivationHead and before updating record phases), Kix updates the record phases to match ActivationHead. Rebuilding an existing status or repairing phases increments status.generation.

PackageInstanceRevision (packageinstancerevisions.kix.run, API version kix.run/v1alpha1) is a cluster-scoped custom resource that lists the objects one build produces for one slot of a Kix cluster and records the applied hash of each object. Deployment records link to their revisions in status.revisions. Each revision carries the label kix.run/cluster, so you can list all revisions for a cluster with:

❱ kubectl get packageinstancerevisions -l kix.run/cluster=production
FieldMeaning
spec.clusterName of the Kix cluster.
spec.slotScope covered by the revision: { kind: instance, namespace, name } for a package instance, { kind: clusterLevel } for cluster-level objects outside any package instance, or { kind: keptOrphans } for orphaned objects kept by deploys that ran without --prune.
spec.objectsSorted list of objects: hash (kix.run/identity-hash), group ("" for core v1), kind, namespace (omitted when cluster-scoped), and name.
status.appliedMap from each object’s hash to the hash of the Kix-owned live fields after its last apply (excluding fields listed in kix.run/cede-fields). Used to detect drift. If an object has no entry, the next deploy reapplies it and records its hash.

Each revision is named <cluster>-<32-char spec hash>, so any machine holding the same build computes the same revision name. The CRD makes spec immutable, and Kix verifies that the name matches spec whenever it reads a revision. Because status is a separate subresource, RBAC rules can allow an account to edit workloads while denying write access to packageinstancerevisions/status.

Kix retains only revisions referenced by deployment records it still consults: the active record, any queued or deploying record, and any Failed or Partial record until a later deploy finishes and folds in its changes. Superseded records carry no revision links. Finishing a deploy or running kix gc deletes unreferenced revisions for that Kix cluster, and kix rollback recreates the target record’s revisions from its build. Each revision holds up to roughly 1.5 MB (around 6,500 objects), and Kix stops before applying if a package instance exceeds that limit. Because deployment records from Kix 0.5 and earlier have no package index, upgrading places all of a record’s objects into a single revision. If they exceed the size limit, Kix stops and tells you to deploy an updated build of the cluster once with Kix 0.9 (which writes a package index), then upgrade Kix again and redeploy.

If a deployment record references a revision that is missing from the cluster, kix deploy, kix gc, and the Kix operator refuse to prune or delete resources, while kix status warns and continues. Redeploying that record’s build recreates the missing revision under the same name. If the missing revision is keptOrphans, run kix gc --full-scan to rebuild it from live objects owned by this Kix cluster that no other revision lists.

Do not edit PackageInstanceRevision objects by hand.

PackageInstance (packageinstances.kix.run, API version kix.run/v1alpha1) is a namespaced custom resource emitted for each active package instance, external import (kix.mkImport), Secret reference (scope.mkSecretRef), Service reference (scope.mkServiceRef), and CRD reference (scope.mkCRDRef).

A package instance’s record sits in the instance’s namespace. The record of an instance under a _-prefixed key, such as instances._cluster, sits in cluster.recordNamespace (kube-system by default), and its spec.namespaceName keeps the key.

apiVersion: kix.run/v1alpha1
kind: PackageInstance
metadata:
name: web
namespace: apps
labels:
app.kubernetes.io/managed-by: kix
annotations:
kix.run/root: web-server
kix.run/depends-on: ...
spec:
instanceName: web
namespaceName: apps
version: "1.2.0"
package: echo-server
lifecycle: stateless
Field or annotationPresent onMeaning
spec.instanceNameManaged and import instancesName of the instance within its namespace.
spec.namespaceNameManaged and import instancesNamespace of the instance, or its _-prefixed key such as _cluster. Kix groups a package’s resources by this value, not by the record’s own namespace.
spec.versionManaged and import instancesThe instance’s version option, else the out.version the package builds, else the package’s meta.version. Left out when none is set, or when out.version is null because the image tag names no version.
spec.packageInstances of built-in packagesPackage ID: <name> for stable packages (such as harbor) and experimental/<name> for experimental packages (such as experimental/coredns). Kix release notes use the same IDs, so tools can match release notes to running instances. Omitted for imports, custom packages, and wrapper functions around built-in packages.
spec.lifecycleWhen meta.lifecycle is setWorkload lifecycle ("stateful", "stateless", or "ephemeral"). Only "stateful" changes build validation and deploy behavior; other values are informational.
kix.run/rootManaged instancesName of the package’s root resource.
kix.run/package-requiresWhen non-emptyComma-separated <Kind>/<name> entries that the package’s root resource transitively depends on.
kix.run/post-hooksWhen non-emptyComma-separated <Kind>/<name> entries declared in root.postHooks.
kix.run/inverse-depsWhen non-emptyComma-separated <Kind>/<name> entries outside the instance that depend on it.
kix.run/auto-instantiatedAuto-instantiated instances"true" when created on demand from availablePackages.
kix.run/optional-activatedActivated optional instances"true" when an optional = true instance was activated by dependency demand.
kix.run/modeImport and ref markers"import" on markers created by kix.mkImport, scope.mkSecretRef, scope.mkServiceRef, and scope.mkCRDRef.
kix.run/import-kind, kix.run/import-apiversion, kix.run/import-nameImport, SecretRef, ServiceRef markersTarget Kubernetes object identity verified by kix deploy before dependent waves run.
kix.run/import-namespacekix.mkImport markers when namespace differs from the instance’s namespaceNamespace of the target Kubernetes object. When omitted, build validation and kix deploy look for a namespaced target in the marker’s own namespace.
kix.run/import-secret-keysscope.mkSecretRef markersComma-separated keys that must exist in the external Secret’s data.
kix.run/import-fqdn, kix.run/service-selector, kix.run/service-ports, kix.run/service-labelsscope.mkServiceRef and Service importsService address, JSON-encoded selector, ports, and metadata labels used by network policy derivation and scorecard rules.
kix.run/crd-kind, kix.run/crd-version, kix.run/crd-served-versions, kix.run/crd-scopescope.mkCRDRef and kix.mkImport { crds } markersCRD kind, default version, comma-separated served versions, and scope (Namespaced or Cluster) verified against the live CRD during kix deploy.

spec.package holds the package ID from the Kix version that built the PackageInstance. When an experimental package becomes stable, new builds write <name> instead of experimental/<name>. Live PackageInstance resources on the cluster keep experimental/<name> until the next deploy.

Every kix deploy writes a provenance receipt to status.receipt on the Activation resource (schema: "kix.run/receipt/v1"). Storing the receipt in status rather than spec ensures that re-applying or rolling back an Activation spec never overwrites the historical record of what was deployed.

Inspect the live receipt with kubectl or generate a SLSA provenance attestation from it with kix compliance attest:

{
"schema": "kix.run/receipt/v1",
"cluster": "production",
"activationHash": "jak8b4glx8fnbq2c3hkb0khyyvigb96i",
"deployedAt": "2026-09-09T10:47:55Z",
"source": {
"flakeRef": "./clusters",
"gitCommit": "700ab956bbe98187a21f4cc99acb938e1401245e",
"dirty": false,
"revision": "700ab956bbe98187a21f4cc99acb938e1401245e",
"flakeLock": "blake3:1d2417994d31f798..."
},
"builder": {
"kixVersion": "0.1.0",
"nixVersion": "nix (Nix) 2.28.5",
"arch": "x86_64",
"os": "linux"
},
"inputs": [
{
"name": "nixpkgs",
"rev": "8d8c1fa...",
"narHash": "sha256-J0dZU4a..."
}
],
"images": [
"docker.io/nginxinc/nginx-unprivileged:1.28-alpine@sha256:7377697a..."
]
}
FieldTypeMeaning
schemastringReceipt format identifier ("kix.run/receipt/v1").
clusterstringName of the Kix cluster.
activationHashstring32-character store hash of the deployed Activation.
deployedAtstringRFC 3339 UTC timestamp when the deployment finalized.
source.flakeRefstringFlake reference passed to kix deploy (or kix bundle when deployed from a bundle).
source.gitCommitstring (optional)Git commit SHA of the source repository. Omitted when the source directory is not a Git repository.
source.dirtyboolean (optional)true when tracked files in the Git working tree had uncommitted changes at build time (untracked files are ignored by Nix flake evaluation). Omitted when source.gitCommit is absent.
source.revisionstring (optional)Commit SHA, suffixed with -dirty when source.dirty is true. Omitted when source.gitCommit is absent.
source.flakeLockstring (optional)blake3:<hex> digest of flake.lock. Omitted when no flake.lock is present.
source.bundle{ sha256, kixRev? } (optional)Present only when deploying from a .kixbundle archive. Records the sha256 hex digest of the bundle archive verified by kix deploy and the optional kixRev recorded in the bundle.
builder{ kixVersion, nixVersion?, kixInput?, arch, os }Versions and platform of the machine that built the activation (for bundle deploys, the machine that ran kix bundle). nixVersion is omitted when Nix is unavailable. kixInput names the flake input that provided the cluster’s Kix library (such as "kix" or "kix-stable"), and is included only when kix.toml defines [versions].
deployer{ kixVersion, arch, os } (optional)Present only when deploying from a .kixbundle archive. Records the kix version and platform of the machine that ran kix deploy.
inputsarray of objectFlake inputs from flake.lock. Locked inputs record { name, rev, narHash }; unlocked local path: inputs record { name, type, path?, url?, locked: false }.
imagesarray of stringContainer image references collected across all workloads in the activation.

Rendered manifests are intentionally excluded from status.receipt so inline Secret values never appear in cluster-wide status objects.