Getting started

📣

Early Access Feature

This feature is in early access. It may undergo changes based on user feedback and continued development. We recommend testing in non-production environments first and welcome your feedback to help us improve.

Getting started with Cast AI Anywhere

Cast AI Anywhere brings powerful cost optimization features to any Kubernetes environment. This guide walks you through the initial setup process to onboard your cluster and start optimizing.

Prerequisites

Before you begin, ensure you have:

  • jq – a lightweight command-line JSON processor. For more details, click here.

  • kubectl (v. 1.29+) – a Kubernetes command-line tool that allows running commands against Kubernetes clusters. For more details, see kubectl.

  • helm (v. 3.14.0+) – a command-line tool that simplifies deploying applications and services to Kubernetes clusters. For more details, see helm.

  • A Cast AI account (if you don't have one, sign up here)

Step 1: Connect your cluster

  1. Log into the Cast AI console
  2. Click "Connect cluster" in the top right corner:

  1. Select "Anywhere" as your provider, then manually enter your cluster name and click on "Generate script":
  1. Copy the generated script and run it in your terminal or cloud shell:

This will install the Cast AI components required by Cast AI Anywhere:

  • Cast AI Agent
  • Cluster Controller
  • Workload Autoscaler
  • Evictor

Step 2: Configure cost settings

There are two ways to set or adjust resource costs for your Cast AI Anywhere cluster:

During initial connection

When your cluster first connects successfully, you'll be automatically prompted to enter your normalized compute resource costs. In this dialog, you can specify:

  • CPU cost per hour
  • Memory cost per hour

Adjusting costs later

You can also modify resource costs at any time:

  1. Find your Cast AI Anywhere cluster in the cluster list
  2. Click the three dots in the cluster's row
  3. Select "Adjust costs":

  1. Enter your updated normalized costs in the configuration modal
  2. Click "Save" to apply the changes

These cost settings help Cast AI calculate your potential savings accurately and optimize decisions. You can update these values whenever your actual infrastructure costs change.

Step 3: Review your available savings

After connecting your cluster and configuring resource costs, Cast AI analyzes your current cluster state to identify optimization opportunities. At this stage, you can view your available savings report.

  1. Select your Anywhere cluster from the list
  2. Click "Available savings" in the sidebar navigation to see a detailed breakdown of optimization opportunities:

This initial analysis helps you understand the potential impact of Cast AI's optimization features and prioritize which optimizations to enable first.

For more information on the Available Savings report, see Available Savings. Note that due to the nature of Cast AI Anywhere clusters, the capabilities of this report will be limited.

📘

Note

The savings calculations are based on the resource costs you configured. Keep these values up to date to ensure accurate savings estimates.

To implement these savings, proceed with enabling workload optimization and resource consolidation features as outlined in the following sections.

Step 4: Configure optimization features

Cast AI Anywhere provides two main optimization capabilities that you can enable independently:

Resource consolidation

  1. Navigate to "Autoscaler" > "Settings"
  2. Toggle Evictor to the "On" position, as it will be disabled at first by default. Optionally, enable the "Aggressive mode." Save the changes. For more information on configuring the Evictor, see Evictor.

Workload optimization

Cast AI Anywhere offers our powerful workload autoscaling capabilities - both vertical and horizontal pod autoscaling work out of the box. This feature automatically adjusts your workload's resource requests and replica counts based on actual usage patterns, helping to:

  • Optimize resource allocation
  • Prevent over-provisioning
  • Handle traffic spikes efficiently
  • Reduce unnecessary costs

Workload autoscaler comes pre-configured with default policies. You can optimize your workloads immediately by creating and configuring scaling policies to match your needs.

To learn how to set up and configure workload autoscaling for your environment, visit our workload autoscaling documentation.

Step 5: Monitor your costs and savings

Cast AI Anywhere provides cost monitoring capabilities based on the normalized resource costs you configured earlier. While some advanced cost monitoring features available in standard Cast AI deployments aren't accessible for Anywhere clusters, you can still track key metrics:

  1. Navigate to "Cost Monitoring" to view:
    • Total compute costs calculated from your configured CPU and memory pricing
    • Resource utilization trends
    • Cost breakdowns by workload and namespace
    • Efficiency reports highlighting optimization opportunities

For the most accurate tracking, ensure your configured resource costs reflect your actual infrastructure expenses. This helps Cast AI provide meaningful optimization recommendations and accurately measure your savings.

📘

Available features

Some advanced cost monitoring features like cloud provider-specific cost breakdowns are not available for Cast AI Anywhere clusters. The reports focus on compute costs based on your configured resource pricing.

For more information on how to best leverage Cast AI's cost monitoring capabilities, see Introduction to Cost Monitoring.

Step 6: Set up pod mutations

Cast AI Anywhere can automatically mutate your Pod configurations through our Pod mutation feature. This is especially useful if you want to easily add workload autoscaling labels and annotations to existing pods in your cluster.

To learn how to set up Pod mutations and use them effectively in your environment, check out our detailed Pod mutations documentation.

📘

Note

Pod mutations are optional but recommended for efficiently managing or migrating your existing workloads at scale.

Next steps

After completing the initial setup:

Troubleshooting

Prerequisites errors

Missing jq utility

The installation script requires the jq command-line JSON processor. If you see this error:

Error: jq is not installed

Install jq based on your operating system:

# For Debian/Ubuntu
apt-get install jq

# For Red Hat/CentOS
yum install jq

# For macOS
brew install jq

Component verification

Verify the Cast AI components are running properly:

# Check component status
kubectl get pods -n castai-agent

# Should show component pods in Running state:
NAME                                          READY   STATUS    RESTARTS      AGE
castai-agent-cpvpa-597c687958-9gq4p           1/1     Running   0             125m
castai-agent-d5b774c7b-mrc7h                  2/2     Running   0             125m
castai-agent-d5b774c7b-wv9p5                  2/2     Running   0             125m
castai-cluster-controller-df4cdfb85-8gdr4     0/2     Pending   0             34m
castai-cluster-controller-df4cdfb85-mxmwq     2/2     Running   0             34m
castai-evictor-567fcbf597-rndxr               1/1     Running   0             6s
castai-evictor-cpvpa-7cf448446b-hqbk2         1/1     Running   0             10s
castai-pod-mutator-568b6dcfd4-5bmsf           1/1     Running   1 (22m ago)   22m
castai-pod-mutator-568b6dcfd4-mxtkp           0/1     Pending   0             22m
castai-workload-autoscaler-59b7d58954-47pdk   1/1     Running   1 (34m ago)   34m

Some timeout errors you might encounter may not be critical for the operation or completion of component installation.