Skip to content

Commit f63abd5

Browse files
README.md
1 parent 69e7796 commit f63abd5

File tree

1 file changed

+58
-14
lines changed

1 file changed

+58
-14
lines changed

README.md

Lines changed: 58 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ This Terraform module enables CAST AI Omni functionality for a Kubernetes cluste
88
- **Support for GKE, EKS, and AKS**
99
- Installs and configures Liqo for multi-cluster networking with cloud-specific optimizations
1010
- Deploys CAST AI Omni Agent for cluster management
11+
- **GitOps Support**: Optional `skip_helm` parameter to manage Helm releases via GitOps tools (ArgoCD, Flux, etc.)
1112
- Automatic extraction of network configuration from clusters (including external CIDR from Liqo)
1213
- Support for both zonal and regional GKE clusters
1314
- Automatic synchronization with Liqo IPAM for external CIDR allocation
@@ -32,9 +33,15 @@ This Terraform module enables CAST AI Omni functionality for a Kubernetes cluste
3233

3334
## What This Module Installs
3435

35-
1. **Liqo** - Multi-cluster networking capability for connecting edge locations
36-
2. **CAST AI Omni Cluster Resource** - Enables Omni functionality in CAST AI
37-
3. **CAST AI Omni Agent** - Manages cluster connectivity and operations
36+
This module creates the necessary Kubernetes resources for CAST AI Omni:
37+
38+
1. **Kubernetes Namespace** (`castai-omni`) - Dedicated namespace for CAST AI Omni components
39+
2. **Kubernetes Secret** - Contains the CAST AI API token for agent authentication
40+
3. **CAST AI Omni Cluster Resource** - Enables Omni functionality in CAST AI
41+
4. **CAST AI Omni Agent Helm Chart** (optional, skippable with `skip_helm = true`) - Manages cluster connectivity and operations
42+
5. **ConfigMap with Helm Values** (created when `skip_helm = true`) - Provides Helm values for GitOps-based deployment
43+
44+
**Note**: When `skip_helm = true`, the module creates only the namespace, secret, ConfigMap, and CAST AI Omni cluster resource, allowing you to manage the Helm chart installation via GitOps tools like ArgoCD or Flux.
3845

3946
## Usage
4047

@@ -179,6 +186,40 @@ module "castai_omni_cluster" {
179186
}
180187
```
181188

189+
### GitOps Example (with skip_helm)
190+
191+
When using GitOps tools like ArgoCD or Flux, you can skip the Helm chart installation by Terraform and manage it via your GitOps workflow:
192+
193+
```hcl
194+
module "castai_omni_cluster" {
195+
source = "github.com/castai/terraform-castai-omni-cluster"
196+
197+
k8s_provider = "gke"
198+
api_url = var.castai_api_url
199+
api_token = var.castai_api_token
200+
organization_id = var.organization_id
201+
cluster_id = var.cluster_id
202+
cluster_name = var.cluster_name
203+
cluster_region = var.cluster_region
204+
205+
api_server_address = var.api_server_address
206+
pod_cidr = var.pod_cidr
207+
service_cidr = var.service_cidr
208+
reserved_subnet_cidrs = var.reserved_subnet_cidrs
209+
210+
# Skip Helm chart installation - manage via GitOps instead
211+
skip_helm = true
212+
}
213+
```
214+
215+
When `skip_helm = true`, the module creates a ConfigMap named `castai-omni-helm-values` in the `castai-omni` namespace containing:
216+
- `liqo.version`: The Liqo image tag to use
217+
- `omni-agent.repository`: CAST AI Helm repository URL
218+
- `omni-agent.chart`: CAST AI Omni Agent chart name
219+
- `values.yaml`: Complete Helm values YAML for the CAST AI Omni Agent chart
220+
221+
You can then reference this ConfigMap in your GitOps tools (ArgoCD, Flux, etc.) to install the Helm chart with the correct values.
222+
182223
### Required Providers
183224

184225
```hcl
@@ -249,9 +290,10 @@ provider "castai" {
249290
| api_server_address | Kubernetes API server address | `string` | - | yes |
250291
| pod_cidr | Pod CIDR for network configuration | `string` | - | yes |
251292
| service_cidr | Service CIDR for network configuration | `string` | - | yes |
252-
| reserved_subnet_cidrs | List of reserved subnet CIDRs | `list(string)` | - | yes |
293+
| reserved_subnet_cidrs | List of reserved subnet CIDRs | `list(string)` | `[]` | no |
253294
| api_url | CAST AI API URL | `string` | `"https://api.cast.ai"` | no |
254-
| liqo_chart_version | Liqo Helm chart version | `string` | `"v1.0.1-5"` | no |
295+
| liqo_image_tag | Liqo image version tag | `string` | `"v1.0.1-5"` | no |
296+
| skip_helm | Skip installing Helm charts (for GitOps workflows) | `bool` | `false` | no |
255297

256298
## Outputs
257299

@@ -314,15 +356,16 @@ The module includes cloud-specific submodules for optimal Liqo configuration:
314356

315357
The module ensures proper installation order by:
316358

317-
1. **Liqo Installation** - Installs the Liqo Helm chart with network configuration
318-
2. **Network Resource Readiness Check** - Waits for Liqo network resources to be ready:
319-
- Waits for `networks.ipam.liqo.io` CRD to be established
320-
- Waits for the external CIDR network resource to be created and populated
321-
- Validates that the `status.cidr` field contains the external CIDR value
322-
3. **CAST AI Omni Cluster** - Enables Omni functionality in CAST AI
323-
4. **CAST AI Omni Agent** - Deploys the agent for cluster management
359+
1. **Namespace and Secret Creation** - Creates the `castai-omni` namespace and API token secret
360+
2. **CAST AI Omni Cluster** - Enables Omni functionality in CAST AI
361+
3. **CAST AI Omni Agent Installation** (when `skip_helm = false`, default):
362+
- Installs the CAST AI Omni Agent Helm chart with the configured values
363+
- The agent manages cluster connectivity and operations
324364

325-
This ordering ensures that Liqo's IPAM system is fully initialized and the external CIDR network resource is available before proceeding with CAST AI components.
365+
**When `skip_helm = true` (GitOps mode)**:
366+
- Step 3 is skipped, and instead a ConfigMap (`castai-omni-helm-values`) is created
367+
- The ConfigMap contains all necessary Helm values for manual or GitOps-based deployment
368+
- You are responsible for installing the CAST AI Omni Agent Helm chart using your preferred deployment method
326369

327370
## Examples
328371

@@ -391,11 +434,12 @@ MIT
391434
| <a name="input_cluster_region"></a> [cluster\_region](#input\_cluster\_region) | K8s cluster region | `string` | n/a | yes |
392435
| <a name="input_cluster_zone"></a> [cluster\_zone](#input\_cluster\_zone) | K8s cluster zone | `string` | `""` | no |
393436
| <a name="input_k8s_provider"></a> [k8s\_provider](#input\_k8s\_provider) | Kubernetes cloud provider (gke, eks, aks) | `string` | n/a | yes |
394-
| <a name="input_liqo_chart_version"></a> [liqo\_chart\_version](#input\_liqo\_chart\_version) | Liqo helm chart version | `string` | `"v1.0.1-5"` | no |
437+
| <a name="input_liqo_image_tag"></a> [liqo\_image\_tag](#input\_liqo\_image\_tag) | Liqo image version tag | `string` | `"v1.0.1-5"` | no |
395438
| <a name="input_organization_id"></a> [organization\_id](#input\_organization\_id) | CAST AI organization ID | `string` | n/a | yes |
396439
| <a name="input_pod_cidr"></a> [pod\_cidr](#input\_pod\_cidr) | Pod CIDR for network configuration | `string` | n/a | yes |
397440
| <a name="input_reserved_subnet_cidrs"></a> [reserved\_subnet\_cidrs](#input\_reserved\_subnet\_cidrs) | List of reserved subnet CIDR's (relevant for GKE) | `list(string)` | `[]` | no |
398441
| <a name="input_service_cidr"></a> [service\_cidr](#input\_service\_cidr) | Service CIDR for network configuration | `string` | n/a | yes |
442+
| <a name="input_skip_helm"></a> [skip\_helm](#input\_skip\_helm) | Skip installing any helm release; allows managing helm releases using GitOps | `bool` | `false` | no |
399443

400444
## Outputs
401445

0 commit comments

Comments
 (0)