KOTS command-line workflows
The KOTS command line gives an operator one place to install, update, inspect, and maintain applications and the KOTS Admin Console on a Kubernetes cluster. The kots surface acts as the client for these tasks, while kotsadm starts the Admin Console service and provides its storage migration paths.
Command surfaces
kots entrypoint
The kots entrypoint in cmd/…/main.go starts the operator-facing CLI. Its root command in cmd/…/root.go sets shared cluster flags and groups commands around application delivery, Admin Console access, state queries, configuration, backup and restore, and cluster services.
The CLI reads settings from command flags and from environment variables with the KOTS_ prefix. Most commands use the current Kubernetes context and a target namespace to reach the Admin Console that manages the application.
References: cmd/…/main.go• L1-10 cmd/…/root.go• L13-78
kotsadm entrypoint
The kotsadm entrypoint in cmd/…/main.go starts the Admin Console process rather than an operator workflow. Its root command in cmd/…/root.go exposes the API server, storage migrations, and shell completion.
The api command starts the service that receives the application and administrative requests made by kots and by the web Admin Console. The migrate command supports storage moves when the Admin Console changes its storage model. Runtime settings use the KOTSADM_ environment prefix.
References: cmd/…/main.go• L1-14 cmd/…/root.go• L14-53 cmd/…/api.go• L15-45 cmd/…/migrate.go• L12-99
Command organization
Application delivery commands
Application delivery commands move an application release between an upstream source, local files, the Admin Console, and the cluster. The main paths are pull for local rendering, upload for creating a version from local files, install for first deployment, and upstream upgrade for checking and obtaining later releases.
| Command group | User goal |
|---|---|
pull | Turn an upstream release into local Kubernetes files for review or editing. |
upload | Send local application files to the Admin Console as a new version. |
install | Set up the Admin Console and deploy an application, or deploy only the application when the console is excluded. |
upstream upgrade and upstream download | Obtain a later release or retry a release download. |
download | Save an application version from the cluster for local review or change. |
set config | Change application configuration and optionally deploy the resulting version. |
References: cmd/…/root.go• L36-61 cmd/…/pull.go• L20-169 cmd/…/upload.go• L22-119 cmd/…/install.go• L60-618 cmd/…/upstream.go• L10-34 cmd/…/download.go• L23-109 cmd/…/set-config.go• L28-177
Administrative commands
Administrative commands operate on the Admin Console and its stored application state. They use get to inspect resources, backup and restore to protect or recover state, and direct commands to open the console or change its access settings.
| Command group | User goal |
|---|---|
admin-console | Open the browser Admin Console from the local machine. |
get | View applications, versions, configuration, backups, restores, and cluster join data. |
app-status | Return status for one application in automation-oriented use. |
backup and restore | Create, list, and recover Admin Console instance backups. |
remove | Remove an application reference, with an explicit option to delete its cluster resources. |
reset-password and reset-tls | Recover access to the console password or its local TLS setup. |
References: cmd/…/admin-console.go• L16-111 cmd/…/get.go• L8-30 cmd/…/get-apps.go• L20-36 cmd/…/backup.go• L15-71 cmd/…/restore.go• L21-89 cmd/…/remove.go• L22-158 cmd/…/reset-password.go• L16-76 cmd/…/reset-tls.go• L17-74
Cluster service commands
Cluster service commands change supporting services that affect how operators reach or protect the Admin Console. Ingress and identity service commands manage external access and login choices. Velero commands manage backup storage setup. Other commands handle image cleanup, high availability, Docker registry access, or air-gap updates.
These commands are mostly operational extensions of the main application flow. They do not replace application release commands. Instead, they prepare or maintain the services that those release commands depend on.
References: cmd/…/identity.go• L21-35 cmd/…/ingress.go• L18-29 cmd/…/enable-ha.go• L15-69 cmd/…/airgap-update.go• L29-150 cmd/…/root.go• L42-60
Installation and administration workflows
Initial installation flow
The install command turns an upstream application source or an air-gap bundle into a working application deployment. It normally also deploys the Admin Console, but it can exclude that console when the application-only path is required. Before deployment, it validates access to the cluster and any supplied registry, resolves the license and release, selects a namespace, and accepts optional application configuration.
The command passes the selected release, registry, access, scheduling, and cluster settings into the deployment flow. It then waits for the Admin Console and application work to complete. When a license is present, it checks the automated install state and waits for preflight results. Errors, failures, and non-skipped warnings stop deployment and show the operator the preflight results. A successful console install can keep a local port forward open or tell the operator how to start one later.
The flow can run online or in air-gap mode. An air-gap install uses release content and image data from a local bundle and can use an embedded or supplied registry. A license can select the application and release channel. Configuration values can be supplied before deployment so the command can complete without a later console step.
This diagram shows the main relationship between the CLI, the cluster, the Admin Console, and the application release.
flowchart LR
A[Upstream source or air-gap bundle] --> B[kots install]
B --> C[Cluster checks and release validation]
C --> D[Admin Console and support resources]
D --> E[Application version and preflight processing]
E --> F[Application deployment]
D --> G[Local Admin Console access]
C --> H[Application-only deployment when console is excluded]
H --> F
References: cmd/…/install.go• L60-227 cmd/…/install.go• L232-396 cmd/…/install.go• L405-550 cmd/…/install_inpackage_test.go• L14-27 cmd/…/install_inpackage_test.go• L29-103
Local edit and deployment flow
The pull and upload commands form a file-based release workflow. pull obtains an upstream release and writes files for inspection or editing. upload sends those files to the Admin Console as a new application version. The operator can then deploy that version through the upload option or through a later configuration or upgrade action.
The reverse path starts with download. It saves a selected or currently deployed version locally and prints the matching upload command. This gives an operator a controlled way to inspect a running release and produce a changed version without changing the cluster first.
flowchart LR
A[Upstream release] --> B[kots pull]
B --> C[Local application files]
C --> D[kots upload]
D --> E[Admin Console application version]
E --> F[Deploy to cluster]
F --> G[kots download]
G --> C
References: cmd/…/pull.go• L20-139 cmd/…/upload.go• L22-107 cmd/…/download.go• L23-97
Release update flow
The upstream upgrade command asks the Admin Console to find and obtain newer application releases. The operator can keep the new release available for later review or request deployment as part of the same workflow. The command also supports an air-gap bundle, so online release discovery and local release delivery share the same user-facing update path.
If a release download fails, upstream download retries a specific application sequence. This separates recovery of release content from the decision to deploy it.
References: cmd/…/upstream-upgrade.go• L20-170 cmd/…/upstream-download.go• L20-173
Configuration flow
The get config and set config commands treat application configuration as a versioned input to deployment. get config selects the latest, current, or specified application version and prints its values. set config accepts a configuration file or selected key values, can merge only the supplied keys, and can start deployment of the resulting version.
Configuration validation belongs to the Admin Console workflow. The CLI reports validation errors instead of treating a rejected configuration as a successful update.
References: cmd/…/get-config.go• L27-161 cmd/…/set-config.go• L28-177
Inspection flow
The get command group gives scripts and operators a read path into Admin Console state. It lists applications and versions and can retrieve configuration, backup, restore, and node-join information. Output commands support JSON where the command defines it, which allows automation to consume the same state that an operator sees in text output.
References: cmd/…/get.go• L8-30 cmd/…/get-apps.go• L20-113 cmd/…/get-versions.go• L22-139 cmd/…/get-config.go• L27-161
Backup and restore flow
The backup command creates a snapshot of an Admin Console instance and can wait for completion or return machine-readable JSON. The restore command selects a named backup and can restore the Admin Console, the applications, or both. The two exclusion choices are mutually exclusive because they describe opposite restore scopes.
The command surface is a control layer for the broader backup and recovery system. For provider setup and disaster-recovery behavior, see Snapshots and disaster recovery.
References: cmd/…/backup.go• L15-108 cmd/…/restore.go• L21-125
Admin Console access flow
The admin-console command makes the in-cluster Admin Console available at a local browser address until the operator stops the command. The install command can start this access path automatically. Later, the operator can run admin-console again without reinstalling the application.
The access command waits for the Admin Console to become ready and reports a replacement local port if the requested port is busy. This keeps browser access separate from the lifetime of an application deployment.
References: cmd/…/admin-console.go• L16-111 cmd/…/install.go• L405-550
Access recovery flow
The password and TLS recovery commands change the local access controls around the Admin Console. reset-password prompts for a new console password. reset-tls recreates the console's self-signed TLS setup and can mark the result to allow an anonymous certificate upload before normal authentication.
Identity service commands provide a separate login model. They can install or configure the service, enable shared-password access, print its OIDC callback URL, or uninstall it and restore shared-password authentication.
References: cmd/…/reset-password.go• L16-75 cmd/…/reset-tls.go• L17-74 cmd/…/identity.go• L21-35 cmd/…/identity.go• L162-288
Related operational areas
The CLI is one control surface in the wider cluster operations model. Cluster installation and operations gives the parent view of Admin Console installation and maintenance. Embedded cluster node operations covers node and embedded-cluster actions that sit beside these application and Admin Console workflows.
Change checklist
When these files or sections are changed, remember to consider these:
- Keep the
kotscommand tree aligned with the documented workflow names and with anykubectl kotsexamples exposed to users. - Keep the client-side Admin Console request paths, authentication token handling, and response shapes aligned with the server started by
kotsadm api. - Keep namespace and Kubernetes-context behavior consistent across install, access, inspection, configuration, backup, and restore commands.
- When release, configuration, or install placement inputs change, check both the online path and the air-gap path. They must agree on license, version, image, preflight, and deployment-target behavior.
- When
kotsadmstorage settings or migration commands change, review the required environment contract for both S3-backed and PVC-backed data. - When identity or ingress settings change, review their interaction with Admin Console access and the recovery commands.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| The CLI cannot use the selected Kubernetes context or namespace. | It cannot find the Admin Console or create the resources needed for the workflow. | Select the intended context and namespace before running the command. |
| The installing identity lacks the required cluster permissions. | Installation or preflight work stops before the application is deployed. | Keep the RBAC check enabled unless the operator has verified an equivalent permission model. |
| Required preflight checks report errors, failures, or warnings that are not skipped. | The application version is not deployed. | Review the printed preflight results and fix the cluster or application condition before retrying. |
| An air-gap bundle is incomplete or its registry credentials are invalid. | Images or application archive data cannot reach the Admin Console. | Validate the bundle and registry access before starting an air-gap install or update. |
| A configuration file, placement value, or toleration value is invalid. | The command rejects the install before it can deploy the application. | Validate the input format and use supported Kubernetes toleration operators and effects. |
| The Admin Console pod is not ready within the wait period. | Port forwarding and commands that depend on the console time out. | Check pod health and increase the wait duration only after finding the cause. |
restore receives both application and Admin Console exclusion flags. | The command rejects the request because the restore scope is ambiguous. | Select one exclusion scope or restore both parts. |
Key files
| File | Why to read it |
|---|---|
| cmd/…/root.go | Shows the top-level kots command tree and shared CLI setup. |
| cmd/…/install.go | Shows the end-to-end first-install workflow, its online and air-gap choices, and its application-only and console-access paths. |
| cmd/…/install_inpackage_test.go | Shows the user-visible rules for preflight notices and install toleration input. |
| cmd/…/pull.go and cmd/…/upload.go | Show the local edit path from upstream content to a version in the Admin Console. |
| cmd/…/upstream-upgrade.go | Shows how release updates can be downloaded and optionally deployed. |
| cmd/…/get.go, cmd/…/get-apps.go, and cmd/…/get-versions.go | Show the main read path for application and release state. |
| cmd/…/get-config.go and cmd/…/set-config.go | Show the versioned configuration read and update workflow. |
| cmd/…/backup.go and cmd/…/restore.go | Show the command-level backup and recovery controls. |
| cmd/…/admin-console.go | Shows the repeatable path for local Admin Console access. |
| cmd/…/root.go and cmd/…/api.go | Show the server-side command boundary and API startup role. |
| cmd/…/migrate.go | Shows the storage migration operations owned by the kotsadm process. |