You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(eks-example): expose agent_values and cluster_controller_values for Helm customization
Adds agent_values and cluster_controller_values variables to the
eks_cluster_existing example, enabling users to pass arbitrary Helm
values (e.g. additionalEnv) to the castai-agent and cluster-controller
charts without modifying castai.tf directly.
Also fixes stale variable references in README and terraform.tfvars.example.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: examples/eks/eks_cluster_existing/README.MD
+27-8Lines changed: 27 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,17 +9,18 @@ Example configuration should be analysed in the following order:
9
9
10
10
# Usage
11
11
1. Copy `terraform.tfvars.example` to `terraform.tfvars`
12
-
2. Update `terraform.tfvars` file with your cluster name, cluster region, vpc_id, cluster_security_group_id, node_security_group_id, subnets and CAST AI API token.
12
+
2. Update `terraform.tfvars` file with your cluster name, cluster region, and CAST AI API token.
13
13
14
14
| Variable | Description |
15
15
| --- | --- |
16
-
| cluster_name = "" | Name of cluster |
17
-
| cluster_region = "" | Name of region of cluster |
18
-
| castai_api_token = "" | Cast api token |
19
-
| vpc_id = "" | Virtual Private Cloud(VPC) id |
20
-
| cluster_security_group_id = "" | Cluster security group id |
21
-
| node_security_group_id = "" | Node security group id |
22
-
| subnets = ["", ""]| Public subnets of cluster |
16
+
|`cluster_name`| Name of the EKS cluster |
17
+
|`cluster_region`| AWS region where the cluster runs |
18
+
|`castai_api_token`| CAST AI API token from console.cast.ai → API Access keys |
19
+
|`profile`| AWS CLI profile to use (default: `"default"`) |
20
+
|`delete_nodes_on_disconnect`| Delete CAST AI-provisioned nodes on disconnect (default: `true`; set to `false` for production) |
21
+
|`tags`| Optional map of tags applied to new nodes |
22
+
|`agent_values`| Optional list of YAML Helm values for castai-agent. Example: `[<<-EOF\n additionalEnv:\n MY_VAR: "value"\nEOF\n]` — see [Customizing Helm values](#customizing-helm-values-additionalenv-and-more)|
23
+
|`cluster_controller_values`| Optional list of YAML Helm values for castai-cluster-controller, same format as `agent_values`|
23
24
24
25
3. Initialize Terraform. Under example root folder run:
25
26
```
@@ -44,4 +45,22 @@ AWS CLI profile is already set to default, override if only required.
44
45
> used by CAST AI has to be present. Example of entry can be found [here](https://github.com/castai/terraform-provider-castai/blob/157babd57b0977f499eb162e9bee27bee51d292a/examples/eks/eks_cluster_autoscaler_polices/eks.tf#L28-L38).
45
46
46
47
48
+
# Customizing Helm values (additionalEnv and more)
49
+
50
+
The `agent_values` and `cluster_controller_values` variables accept lists of YAML-formatted Helm values that are merged into the respective CAST AI Helm chart releases. This is the recommended way to configure environment variables, proxy settings, resource limits, or any other chart-level option.
51
+
52
+
Example `terraform.tfvars` entry to set environment variables on the agent:
53
+
54
+
```hcl
55
+
agent_values = [<<-EOF
56
+
additionalEnv:
57
+
HTTP_PROXY: "http://proxy.example.com:8080"
58
+
HTTPS_PROXY: "http://proxy.example.com:8080"
59
+
NO_PROXY: "169.254.169.254,localhost"
60
+
EOF
61
+
]
62
+
```
63
+
64
+
Use `cluster_controller_values` for the same pattern applied to the cluster-controller component.
65
+
47
66
Please refer to this guide if you run into any issues https://docs.cast.ai/docs/terraform-troubleshooting
Copy file name to clipboardExpand all lines: examples/eks/eks_cluster_existing/variables.tf
+12Lines changed: 12 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -44,3 +44,15 @@ variable "tags" {
44
44
description="Optional tags for new cluster nodes. This parameter applies only to new nodes - tags for old nodes are not reconciled."
45
45
default={}
46
46
}
47
+
48
+
variable"agent_values" {
49
+
type=list(string)
50
+
description="List of YAML-formatted Helm values for the castai-agent chart. Use this to set additionalEnv, resource limits, pod annotations, etc."
51
+
default=[]
52
+
}
53
+
54
+
variable"cluster_controller_values" {
55
+
type=list(string)
56
+
description="List of YAML-formatted Helm values for the castai-cluster-controller chart. Use this to set additionalEnv, resource limits, pod annotations, etc."
0 commit comments