Kots cli Application Management
The kots cli can be used to manage installations from pulling releases, to configuration, to deploying and applying rollbacks. We describe a workflow for managing Credo AI solely through the kots cli below.
Installation
Install kots without the UI using the install
command
The --no-port-forward
flag in the example below prevents a k8s port forward to the kots admin UI. This is useful when a browser cannot be used to access the deployment host.
If you coordinated an airgap option with Credo AI support but would like to use an online installation, the --airgap=false
flag in the example below allows all resources to be downloaded from the internet. Omit this and use the --airgap-bundle
flag if you would like to do an airgap installation.
❯ kubectl kots install credoai \
-n credoai-ns \
--airgap=false \
--disable-image-push \
--license-file=license.yaml \
--no-port-forward \
--shared-password test-only
• Deploying Admin Console
• Creating namespace ✓
• Waiting for datastore to be ready ✓
• Waiting for Admin Console to be ready ✓
• Waiting for installation to complete ✓
• Waiting for preflight checks to complete ✓
• To access the Admin Console, run kubectl kots admin-console --namespace credoai-ns
initialize the first release of Credo AI with the upstream upgrade
command
After the above command, the application status may show unavailable until the first Credo AI release has been added to kots.
Similar to the above kots installation, using the --airgap-bundle
flag permits uploading the Credo AI assets from a local .airgap
file.
❯ kubectl kots upstream upgrade credoai -n credoai-ns
• Checking for application updates ✓
• There are no application updates available
• To access the Admin Console, run kubectl kots admin-console --namespace credoai-ns
• Currently deployed release: sequence 0, version v2024.4.2-0
and check that it is ready
❯ kubectl kots get apps -n test-replicated-travis
SLUG STATUS VERSION
credoai ready v2024.4.2-0
Application
Check the detailed status of an installation with the kots cli get versions
command
❯ kubectl kots get versions credoai -n credoai-ns
VERSION SEQUENCE STATUS SOURCE
v2024.4.2-0 0 deployed Online Install
Configuration
the kots cli upstream upgrade
command will pull the latest, or next required, release of Credo AI:
You can download any new releases but hold off on deploying by setting the --deploy=false
flag. A later set config
with the --deploy
flag can be used to trigger the deployment of the new release.
kubectl kots upstream upgrade credoai
the get config
command pulls the configuration file and dumps to stdout.
You can save the config output to a file and manage further deployments by editing it offline and uploading with the kots cli. Using a version control system is recommended if selecting this workflow.
❯ kubectl kots get config credoai | tee kots-config.yaml
apiVersion: kots.io/v1beta1
kind: ConfigValues
metadata:
creationTimestamp: null
spec:
values:
IngressAnnotations: {}
IngressClass:
value: alb
IngressKind:
...
Deployment
Apply your configuration with set config
❯ kubectl kots set config credoai \
--config-file kots-config-edited.yaml \
--deploy \
-n credoai-ns
• Updating credoai configuration...
• Done
and check the status of the new version
❯ kubectl kots get versions credoai -n credoai-ns
VERSION SEQUENCE STATUS SOURCE
v2024.4.2-0 1 deployed Config Change
v2024.4.2-0 0 deployed Online Install
Rollbacks
To effect a rollback, get the kots config from an earlier sequence number and set it as the current deployment.
❯ kubectl kots get config credoai -n test-replicated-travis --sequence 1 | tee kots-config-rollback.yaml
apiVersion: kots.io/v1beta1
kind: ConfigValues
...
❯ kubectl kots set config credoai \
--config-file kots-config-rollback.yaml \
--deploy \
-n test-replicated-travis
• Updating credoai configuration...
• Done