Essentials
Ankra CLI
Comprehensive guide for installing, configuring, and using the Ankra CLI to manage clusters and addons on the Ankra platform.
What is Ankra CLI?
The Ankra CLI is a secure, robust, and user-friendly command-line interface for interacting with the Ankra platform. It enables you to manage clusters, deploy addons, and automate platform operations directly from your terminal.
Main use cases:
- Cluster management (create, select, delete, etc.)
- Addon deployment (e.g., fluent-bit, cert-manager)
- Automation of platform operations
Features
- Easy cluster selection and management
- Addon deployment and management
- Secure authentication via API token
- Supports both global and user-local installation
- Clear versioning and help commands
Installation
Global Install (requires sudo)
User-Local Install (no sudo, adds to ~/bin)
Note: After installation, verify with:
Post-Installation Setup
Set the required environment variables:
ANKRA_API_TOKEN
(required)ANKRA_BASE_URL
(optional, defaults to https://platform.ankra.app)
Export for Current Session
Add to Shell Profile (~/.zshrc or ~/.bashrc)
Tip: Reload your shell profile after editing:
Quick Start
List Clusters
Select a Cluster
List Addons
Get Addon Details
List Stacks
Get Stack Details
List Operations
Get Operation Details
Get Jobs for an Operation
Get Help
Command Reference
Global Flags
Flag | Description |
---|---|
--version | Show CLI version |
--help | Show help for any command |
--base-url | Base URL for the Ankra API |
--config | Config file (default is $HOME/.ankra.yaml) |
--token | API token for authentication |
Main Commands
get
- Description: Retrieve resources (clusters, stacks, addons, operations, jobs, manifests).
- Usage:
- Examples:
- List clusters:
ankra get clusters
- List stacks:
ankra get stacks
- Get stack details:
ankra get stacks infisical
- List addons:
ankra get addons
- Get addon details:
ankra get addons kube-prometheus-stack
- List operations:
ankra get operations
- Get operation details:
ankra get operations <operation-id>
- Get jobs for an operation:
ankra get jobs <operation-id>
- List clusters:
- Flags:
Flag Description -h, --help
Show help for get command
select
- Description: Interactively select a cluster or stack and save as active.
- Usage:
- Flags:
Flag Description -h, --help
Show help for select command
apply
- Description: Apply an addon or manifest to the selected cluster.
- Usage:
- Flags:
Flag Description --help
Show help for apply command
delete
- Description: Delete a cluster, addon, or manifest.
- Usage:
- Flags:
Flag Description --help
Show help for delete command
Note: Use
ankra <command> --help
for detailed options on any command.
Troubleshooting
- PATH issues: Ensure
ankra
is in your PATH. If not, add~/bin
or the install location to your PATH. - Missing dependencies: The CLI requires
curl
andbash
for installation. - Check version:
- Verify installation:
- Common errors:
- Resource not found: Double-check the resource name and active cluster.
- Unstaged changes (git): Commit or stash changes before pulling updates.
Support & Resources
- Slack: https://join.slack.com/t/ankra-community/shared_invite/zt-30r96vykz-BGBKQ_W0F_wQdMeklRuVSg
- Support: hello@ankra.io
For more advanced usage, see the full documentation or contact support.