Deploy Kubernetes Applications - Container & Helm Chart Management | Codiac CLI
Learn how to create and manage assets for use with Codiac.
What you'll get
- Create assets from Docker images or Helm charts, deploy to cabinets, and update or roll back
- Ingress and TLS (Let's Encrypt) via CLI prompts; no YAML
- Commands:
asset create,asset deploy,asset list,asset view,asset undeploy,asset obliterate
Prerequisites
- Codiac account and CLI installed and logged in
- An enterprise and at least one environment with a cabinet (or use a Hosted Sandbox)
- Container image in a registry (or Helm chart) for the asset
The Codiac CLI guides you through each command interactively. You don't need to memorize flags, just run the command and the CLI prompts you for what it needs. To add ingress, just answer Y when asked Accessible from outside the cabinet during asset creation.
An asset is a workload. Codiac supports two asset types:
- Docker image in a public or private registry.
- Helm charts.
Usage and Options
Use codiac asset -h to see all the available options:
Create a new asset
- Use
codiac asset createto create a new asset from the command line:
codiac asset create
-
Follow the prompts to:
- Choose your container registry.
- Log into your cloud service provider.
- Select the container image for the asset.
- Port 1: Forwarding?: Configure port forwarding, if desired. The default is
N. - Assign another port?: Configure an additional port, if desired. The default is
N. - Accessible from outside the cabinet (aka: has ingress route): Enter
Yto configure ingress orNif you don't want the asset to be available from the public internet. - Usage: external answer
Y. - Host name on the inbound domain url: If you configure DNS, this value will be used as the service name for the URL.
- Will this asset be the base ingress against your DNS: This step is part of Codiac's strategy-based host mapping. You can only have one base ingress URL for your account. You will most likely want to reserve this for your main application. Otherwise, answer
N.
-
Verify all the parameters are correct, then enter Y to start the asset creation process.
Deploy an asset
- Use
codiac asset deployto deploy the asset to the cabinet. This command defaults to the most recent version of the asset:
codiac asset deploy
- Follow the prompts to select the asset, cloud service provider, and cabinet.
Made a mistake? Changed your mind? Use Snapshots to rollback your cabinet to an earlier version..
Deploy and watch it roll out
Add --follow (-f) to watch the new pods come up right after the deploy:
codiac asset deploy -a my-api -u 1.4.2 -c orders --follow
Codiac first prints the equivalent asset view commands so you can re-check by hand later, then prints each pod state change and each new Kubernetes event as it happens:
Following my-api for up to 300s. To check on it yourself:
codiac asset view -e my-company -a my-api -n prod -c orders -t status
codiac asset view -e my-company -a my-api -n prod -c orders -t events -f
+0s pod 6f9c7d-x2kq Pending (ContainerCreating)
+6s pod 6f9c7d-x2kq Pending (ContainerCreating) → Running (not ready)
+19s pod 6f9c7d-x2kq Running (not ready) → Ready
+41s pod 5b8d4c-aaaa Ready → gone
✔ 2/2 pods ready in 41s
It stops at the first of these:
- Every new pod is Ready. Old pods that are still shutting down don't count.
- A new pod is stuck. Stuck means CrashLoopBackOff, ImagePullBackOff/ErrImagePull, CreateContainerConfigError, or a readiness or startup probe failing more times than its
failureThreshold. The summary gives the reason and the most relevant event, for example✖ 0/2 ready after 52s: Readiness probe failed: HTTP 503 /ready. - The timeout runs out. The default is 300 seconds; change it with
--follow-timeout-in-seconds. The summary says what the rollout is still waiting on, for example0/3 nodes are available: 3 Insufficient cpu.
--follow reports pod health. It never changes the deploy's result. The command exits successfully once Kubernetes accepts the new spec, even if the pods then fail to start. To gate a pipeline on rollout health, read the summary line.
--follow works with --silent and in CI. It doesn't need a terminal, and the timeout always ends it. When you deploy by cabinet tag, it follows every matching cabinet at the same time and prefixes each line with [environment/cabinet]:
codiac asset deploy -a my-api -u 1.4.2 -c orders --follow --follow-timeout-in-seconds 120 --silent
To watch events on their own at any time, use codiac asset view -a my-api -c orders -t events -f. Helm assets don't have a single set of pods to follow, so --follow prints this events command for them.
View assets and details
-
Use
codiac asset listto list all the assets in your enterprise. -
Use
codiac asset viewto select an asset and view its logs, configurations, status, and other details.
Edit an asset
Use the web to edit a Codiac asset.
Update an asset
- Use
codiac asset deployto update an existing asset.
codiac asset deploy
- Follow the prompts to select the new asset version, cloud service provider, and cabinet.
Rollback an asset
Snapshots let you rollback to earlier versions of your cabinet. Click and drag the desired snapshot into your cabinet to rollback to that version. Use the web to rollback a Codiac cabinet.
Use the web to rollback a Codiac asset.
Remove an asset from a cabinet
- Use
codiac asset undeployto remove an asset from a given cabinet.
codiac asset undeploy
Follow the prompts to choose the asset and the cabinet from which you want the asset removed.
This command does not affect the Kubernetes cluster. Your cloud service provider will continue to bill you until you destroy the cluster.
Delete (obliterate) an asset
The codiac asset obliterate command:
- Performs a full cascading delete of the given asset.
- Deletes all of the asset's related data in Codiac, including:
- Versions
- Probes
- Configs
- Tags
- Cannot be undone.
This command does NOT:
- Delete anything from the image registry.
- Affect your Kubernetes clusters.
- Your cloud service provider will continue to bill you until you destroy the cluster.
You can only delete (obliterate) assets that are not in any cabinets. If the asset you want to obliterate is in a cabinet, use codiac asset undeploy to remove the asset from its cabinet(s) first.
- Use
codiac asset obliterateto delete the given asset its Codiac data:
codiac asset obliterate
Follow the prompts to choose the asset and confirm you want to delete it.
What's next
- Manage cabinets – Create and manage cabinets
- Manage configurations – Set config and secrets per asset/cabinet
- Manage snapshots – Roll back to a previous version
- System versioning – How snapshots work
- Web UI: Manage assets – Same workflows in the dashboard