This repository contains a Helm chart for deploying the CAST.AI Target Group Manager, which helps manage AWS target groups for Kubernetes clusters.
- castai connected EKS cluster
- Helm v3+
- CAST.AI account and API key
The CAST.AI node role in your cluster must have the following IAM policy attached:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"elasticloadbalancing:DescribeTargetGroups",
"elasticloadbalancing:DescribeTargetHealth",
"elasticloadbalancing:RegisterTargets",
"elasticloadbalancing:DeregisterTargets"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"ec2:DescribeInstances",
"ec2:DescribeTags"
],
"Resource": "*"
}
]
}
- Add the Helm repository:
helm repo add castai-charts https://raw.githubusercontent.com/castai/castai-eks-target-groups-binder/main/charts
helm repo update
- Install the chart:
helm install castai-tg-manager castai-charts/castai-agent-target-group-manager \
--namespace castai-agent \
--create-namespace \
--set secrets.apiKey=<your-castai-api-key> \
--set secrets.clusterId=<your-cluster-id> \
--set awsRegion=<your-aws-region>
- Create a
values.yaml
file:
replicaCount: 1
namespace: castai-agent
image:
repository: castai/target-groups-binder
tag: latest
pullPolicy: IfNotPresent
serviceAccount:
name: castai-tg-registrar-sa
secrets:
apiKey: "<your-castai-api-key>"
clusterId: "<your-cluster-id>"
awsRegion: "<your-aws-region>"
nodeSelector: {}
tolerations: []
- Install using the values file:
helm install castai-tg-manager castai-charts/castai-agent-target-group-manager \
-f values.yaml \
--namespace castai-agent \
--create-namespace
- Create a new Terraform file (e.g.,
castai-target-group.tf
):
provider "helm" {
kubernetes {
config_path = "~/.kube/config" # Adjust path as needed
}
}
resource "helm_release" "castai_target_group_manager" {
name = "castai-tg-manager"
repository = "https://raw.githubusercontent.com/castai/castai-eks-target-groups-binder/main/charts"
chart = "castai-agent-target-group-manager"
namespace = "castai-agent"
create_namespace = true
set {
name = "secrets.apiKey"
value = var.castai_api_key
}
set {
name = "secrets.clusterId"
value = var.cluster_id
}
set {
name = "awsRegion"
value = var.aws_region
}
set {
name = "serviceAccount.name"
value = "castai-tg-registrar-sa"
}
}
variable "castai_api_key" {
description = "CAST.AI API Key"
type = string
sensitive = true
}
variable "cluster_id" {
description = "Kubernetes Cluster ID"
type = string
}
variable "aws_region" {
description = "AWS Region"
type = string
}
- Create a
terraform.tfvars
file:
castai_api_key = "your-castai-api-key"
cluster_id = "your-cluster-id"
aws_region = "your-aws-region"
- Initialize and apply Terraform:
terraform init
terraform apply
Parameter | Description | Default |
---|---|---|
replicaCount |
Number of replicas | 1 |
image.repository |
Image repository | castai/target-groups-binder |
image.tag |
Image tag | latest |
image.pullPolicy |
Image pull policy | IfNotPresent |
serviceAccount.name |
Service account name | castai-tg-registrar-sa |
secrets.apiKey |
CAST.AI API key | "" |
secrets.clusterId |
Kubernetes cluster ID | "" |
awsRegion |
AWS region | "" |
nodeSelector |
Node labels for pod assignment | {} |
tolerations |
Tolerations for pod assignment | [] |
To upgrade an existing installation:
helm upgrade castai-tg-manager castai-charts/castai-agent-target-group-manager \
--namespace castai-agent \
--set secrets.apiKey=<your-castai-api-key> \
--set secrets.clusterId=<your-cluster-id> \
--set awsRegion=<your-aws-region>
helm uninstall castai-tg-manager -n castai-agent
terraform destroy
- Verify the deployment:
kubectl get pods -n castai-agent
- Check pod logs:
kubectl logs -f deployment/castai-tg-manager-target-group-manager -n castai-agent
For support, please refer to the following resources: