Introducing a new way to review your PRs.

Read the announcement

replicatedhq / kots

KOTS provides the framework, tools and integrations that enable the delivery and management of 3rd-party Kubernetes applications, a.k.a. Kubernetes Off-The-Shelf (KOTS) Software.

View on GitHub

21 documents · Updated Nov 23, 2026

docs / application-delivery

Application delivery lifecycle

The application delivery lifecycle moves an application release from an upstream source to a downstream cluster. It keeps the release identity, metadata, source files, rendered files, and delivery state together so that the system can acquire, review, and deploy the same release in online and air-gapped environments.

Lifecycle model

An application release is a versioned set of application content. The lifecycle separates source acquisition from rendering and deployment so that the same release can be stored, inspected, compared, and delivered to one or more downstream clusters.

Release flow

The flow below shows how an upstream release becomes a stored version and then a cluster deployment.

flowchart LR
    S[Upstream source or air-gap bundle] --> A[Acquire release]
    A --> M[Build release metadata]
    M --> R[Store source and archive]
    R --> T[Render for downstream]
    T --> P[Check configuration and preflights]
    P --> D[Create deployment request]
    D --> C[Downstream cluster]
    C --> Q[Record status and output]

Acquisition and rendering are separate concerns. The upstream release acquisition page covers how release content is found and fetched. The application rendering and deployment page covers how that content becomes manifests and cluster resources.

References: pkg/…/pull.go• L117-149 pkg/…/pull.go• L302-339 pkg/…/pull.go• L453-515 pkg/…/pull.go• L607-662

Release identity

The system uses stable application identity and release identity to connect upstream content with stored records and downstream state. This lets an operator distinguish an application from one of its releases and distinguish a release from its deployment on a particular cluster.

Application identity

An application is identified by an internal ID and a user-facing slug. Its record also carries the upstream URI, display data, the current release sequence, the selected channel, and whether the application uses an air-gapped source. A downstream identifies a target cluster and keeps the current release for that application on that cluster.

References: pkg/…/app.go• L9-34 pkg/…/types.go• L15-22 migrations/…/app.yaml• L11-39 migrations/…/app_downstream.yaml• L11-28

Release identity

Each application release has a sequence number within the application. Its release identity also includes a version label, update cursor, channel, release notes, release time, and required-release flag. A downstream release record links that release to a cluster and records its parent sequence, source, deployment status, and applied time.

The update cursor is the source position used to ask for the next release. The parent sequence provides the comparison point for an upgrade. These values preserve the link between an upstream release and the change that a downstream cluster receives.

References: pkg/…/types.go• L11-24 pkg/…/types.go• L24-40 migrations/…/app_version.yaml• L15-47 migrations/…/app_downstream_version.yaml• L16-46

Release representation

The system represents a release in two related forms. Structured metadata supports product behavior and status views. A version archive preserves the files needed to render or deploy the release later.

Metadata record

Release metadata includes the application and KOTS resource definitions needed by later stages. KOTS is the application delivery model used by this system. The stored metadata can describe configuration, installation state, licensing, preflight checks, backup and restore behavior, identity, and embedded-cluster settings.

The record also stores branding and release notes for operator-facing views. This keeps important release facts available without unpacking the full archive for every request.

References: pkg/…/version_store.go• L580-649 migrations/…/app_version.yaml• L47-82 pkg/…/types.go• L11-20

Version archive

The version archive is the durable package for a release. It can contain the upstream files, the normalized base, downstream overlays, rendered output, KOTS resource data, Helm content, and skipped files. The archive is written to shared file storage under the application and sequence, then extracted when another process needs to inspect or deploy the release.

The archive is the hand-off point between the process that acquires a release and the process that runs deployment. It also allows older releases to be loaded for upgrade comparisons and rollback-related work.

References: pkg/…/app.go• L273-331 pkg/…/version_store.go• L243-256 pkg/…/deploy.go• L70-81 pkg/…/types.go• L20-43

Manifest rendering

Rendering turns release content and installation data into Kubernetes manifests for a named downstream. It applies configuration and other runtime context, handles KOTS resources, and supports both regular Kubernetes content and Helm-based application content.

Render inputs

The renderer combines the release archive with values that can change between installations. These values include the application slug, release sequence, namespace, license, configuration values, identity configuration, air-gap mode, and registry settings. This means a stored release can be rendered again when operator input or local delivery settings change.

Source types use different conversion paths. Helm content is prepared as Helm content. Replicated application content is converted into a Kubernetes base and related Helm bases. Both paths produce content that downstream overlays can consume.

References: pkg/…/render.go• L39-95 pkg/…/render.go• L11-48 pkg/…/types.go• L93-122 pkg/…/pull.go• L350-359

Downstream output

Each downstream gets an overlay built from the shared release base and its midstream data. A downstream is the system's named view of an application for a target cluster. Rendering writes the final Kubernetes resources and chart files into a downstream-specific rendered area.

The system can use saved rendered content when it exists. If it does not, it rebuilds the output from the archive's base and overlay. This gives deployment and inspection a stable result while still allowing older archives to remain usable.

References: pkg/…/downstream.go• L8-26 pkg/…/app.go• L30-91 pkg/…/app.go• L105-191 pkg/…/rendered.go• L12-47

Deployment hand-off

Deployment does not send arbitrary source files directly to a cluster. It first verifies that the selected release can be deployed, records it as the current downstream version, and then hands the archive and deployment facts to the KOTS operator.

Deployment eligibility

Configuration and strict preflight checks protect the hand-off. A release that still needs configuration or has a failing strict preflight is not deployable. The system reports the reason instead of starting a partial deployment.

References: pkg/…/deploy.go• L29-59 pkg/…/version.go• L28-62 pkg/…/store_interface.go• L162-168

Cluster hand-off

The upgrade service places the release archive in shared storage and creates a deployment request in the Admin Console namespace. That request contains the application identity, release information, archive location, source, preflight choices, and whether an embedded-cluster upgrade is also needed.

For an application-only update, the service waits for the operator to process the request. When a cluster upgrade is needed, the cluster upgrade runs as a long task and then creates the same deployment hand-off. The operator performs the cluster-side work and reports the result back through the downstream version state.

References: pkg/…/deploy.go• L70-137 pkg/…/deploy.go• L140-189 pkg/…/deploy.go• L217-312

Delivery state

The lifecycle records both the current release for a downstream and the history of release attempts. Status fields cover pending work, preflight work, deployment, and errors. Deployment output keeps dry-run, apply, and Helm results so an operator can relate a failure to the release and cluster that produced it.

References: pkg/…/downstream_store.go• L26-49 pkg/…/downstream_store.go• L137-174 migrations/…/app_downstream_output.yaml• L11-41 pkg/…/types.go• L153-161

Delivery modes

The lifecycle has two source modes with the same stored-release and downstream goals. The difference is how release content and images enter the system.

Online delivery

Online delivery uses a verified license and an upstream URI to discover release content. The upstream service returns release files and release facts such as the update cursor, channel, version label, required flag, release time, registry domains, and supported Replicated charts. The latest license data is carried with the release so later Helm or application content can use the same license document.

The acquired content is written into the release layout, rendered, archived, and passed through the normal deployment hand-off. Existing configuration and identity data can be carried into the new release so an update does not discard installation state.

References: pkg/…/online.go• L30-82 pkg/…/pull.go• L91-111 pkg/…/pull.go• L137-149 pkg/…/replicated.go• L161-189 pkg/…/replicated.go• L372-486

Air-gapped delivery

Air-gapped delivery reads the release from a local bundle instead of relying on the upstream service. It checks the license, channel, application key, and bundle metadata before extracting the application archive. Bundle metadata supplies the release cursor, version, required flag, chart names, and embedded-cluster artifact information used during acquisition.

Images can be prepared for a private registry as part of delivery, while the release still follows the same archive, render, and downstream state model. Air-gap mode also makes the license and license fields available to supported Helm charts through their values, while online mode does not add the license document to chart values.

References: pkg/…/airgap.go• L33-53 pkg/…/pull.go• L248-292 pkg/…/fetch.go• L71-151 pkg/…/helm.go• L339-386 pkg/…/helm.go• L450-514

Helm release context

Helm delivery adds Replicated context to chart values before the chart enters the common rendering path. This lets a chart use application identity, air-gap state, proxy settings, private CA data, and license context without changing the rest of the delivery flow.

Chart value placement

The system finds a supported Replicated chart in the top-level chart or a direct subchart. If a dependency uses an alias, the injected values use that alias because Helm uses it as the values key. The system merges the values into the chart's existing values and preserves unrelated chart values.

Global Replicated values carry shared license and registry context when air-gapped. A chart that does not contain a supported Replicated chart is left unchanged.

References: pkg/…/helm.go• L24-61 pkg/…/helm.go• L64-168 pkg/…/helm.go• L262-337 pkg/…/helm_test.go• L16-1535

License data preservation

Air-gap chart values use the original license document when it is available. If the original bytes are not available, the system creates an equivalent document from the parsed license. This keeps fields that are not modeled by the parsed type from being lost during chart preparation.

References: pkg/…/pull.go• L158-182 pkg/…/helm.go• L339-358 pkg/…/helm_test.go• L1537-1561

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep the application sequence and downstream sequence links consistent when release creation or replacement changes.
  • Keep the archive path contract aligned between archive creation, shared storage reads, and deployment requests.
  • Keep metadata fields aligned between the stored release record and the KOTS resource set used during rendering.
  • Keep online and air-gap validation aligned when release identity or channel rules change.
  • Keep the selected release metadata aligned with the values chosen from an air-gap bundle or an online response.
  • Keep original license bytes available when air-gap Helm values must preserve fields that the parsed license model does not represent.
  • Keep chart-name and dependency-alias handling aligned with the values key used by Helm.
  • Keep rendered output and Helm output aligned when a new downstream type or chart delivery path is added.
  • Keep deployment eligibility checks aligned with the status values that the operator and Admin Console display.

Important failure modes

TriggerConsequenceGuard
Upstream metadata has a version label that differs from the requested labelThe release is rejected before acquisition completesValidate the label for an initial install before downloading the release
An air-gap bundle has no valid license, channel, or matching application keyThe application archive is not acceptedCheck license expiry, channel membership, and public-key match before extraction
Air-gap metadata selects a chart or artifact context that is not passed into acquisitionThe release can use the wrong chart values or embedded-cluster artifact pathsSelect cursor, version, chart names, and artifact paths from the bundle metadata
A release still needs configurationThe downstream version stays out of the deployable pathRender KOTS resources and stop with a configuration-needed result
A strict preflight failsDeployment is blocked with an actionable reasonCheck preflight state before marking the downstream release current
The release archive cannot be read or extractedRendering, inspection, or deployment cannot continueStore the archive before the deployment hand-off and verify reads at use time
A chart contains a supported Replicated subchart under an aliasContext is written under the wrong values key and the chart cannot use itResolve the dependency alias before merging values
Original air-gap license bytes are discardedUnmodeled license fields are missing from chart valuesCarry the original license payload and only marshal the parsed license as a fallback
Manifest or chart rendering failsNo complete downstream output is availableRecord render errors and do not create a successful deployment state

Key files

FileWhy to read it
pkg/…/pull.goMain path from input validation through upstream fetch, base creation, overlays, downstreams, and rendered output
pkg/…/fetch.goChooses online or local acquisition context and maps air-gap metadata into release selection
pkg/…/replicated.goConverts a downloaded or local release into release files, metadata, configuration values, and license data
pkg/…/helm.goAdds delivery context to supported Helm charts and preserves air-gap license data
pkg/…/types.goShared release identity and archive-area concepts
pkg/…/app.goApplication identity and lifecycle fields
pkg/…/version_store.goRelease records, archive persistence, and downstream version creation
pkg/…/app.goVersion archive boundaries and rendered application access
pkg/…/render.goRuntime inputs used to render release content
pkg/…/render.goThe high-level split between Helm and Replicated source rendering
pkg/…/deploy.goArchive hand-off and cluster deployment request flow
pkg/…/version.goDeployment eligibility and start of operator-driven deployment
pkg/…/downstream_store.goCurrent downstream release and delivery status behavior
migrations/…/app_version.yamlPersistent release metadata contract
migrations/…/app_downstream_version.yamlPersistent per-cluster release and status contract