
- Using the kagent CLI installer, and
- Using Helm charts (recommended for cluster-managed installations).
Prerequisites
- A Kubernetes cluster and kubectl configured to target it.
- Helm installed if you plan to use the Helm method.
- An LLM provider API key (the examples below use OpenAI). Export your OpenAI key into the environment so the installer can pick it up automatically.
Make sure your
OPENAI_API_KEY is set in the environment before installing kagent. You can export it like:Quick comparison
CLI-based installation
Follow these steps to install kagent using the kagent CLI installer.- Install the kagent CLI (the installer fetches the latest stable binary):
- Confirm the installed kagent version:
- Inspect available CLI commands and flags:
- Ensure the
kagentnamespace exists (this creates it if absent):
- Install kagent into the
kagentnamespace. The installer will use theOPENAI_API_KEYenvironment variable (no additional flag required for the key):
- Verify the deployed pods in the
kagentnamespace:
Uninstalling kagent (CLI)
To remove the kagent installation created via the CLI:Helm-based installation
Helm is a common method for installing kagent in production environments. The recommended sequence is: install CRDs first, then install the application Helm chart.- Install the kagent CRDs from the public Helm OCI chart:
- Verify the CRDs are present:
- Install the kagent Helm chart. Pass the OpenAI API key via Helm values so components can use it. The exact value key name may vary by chart — one common pattern is
openai.apiKey. Replace with the correct key for your chart if different:
- Verify Helm releases:
- Confirm services and pods are running:
When removing kagent, uninstall the application release first and remove CRDs separately. Deleting CRDs before removing dependent resources can leave orphaned resources or break uninstall workflows.
Uninstalling Helm release and CRDs
- Uninstall the kagent release:
- Uninstall the CRDs Helm release:
- Confirm the namespace no longer contains kagent resources:
Conclusion
This lesson covered how to install and uninstall kagent using:- the kagent CLI (quick installer +
kagent install), and - Helm charts (install CRDs first, then the application chart).
Links and references
- OpenAI
- Kubernetes Documentation
- Helm Documentation
- kagent project: https://github.com/kagent-dev/kagent