Skip to content

Commit

Permalink
Merge pull request #16 from truefoundry/hl_generic_integrations
Browse files Browse the repository at this point in the history
feat(cluster): add support for 'generic' cluster type
  • Loading branch information
shubhamrai1993 authored Dec 9, 2024
2 parents 708d13e + 65eb685 commit 4d902bc
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ No modules.
| <a name="input_azure_subscription_id"></a> [azure\_subscription\_id](#input\_azure\_subscription\_id) | Azure Subscription ID where the AKS cluster will be created (e.g., '12345678-1234-1234-1234-123456789012') | `string` | `null` | no |
| <a name="input_azure_tenant_id"></a> [azure\_tenant\_id](#input\_azure\_tenant\_id) | Azure Tenant ID associated with the subscription | `string` | `null` | no |
| <a name="input_cluster_name"></a> [cluster\_name](#input\_cluster\_name) | Name of the Kubernetes cluster to create or manage. Must be unique within your organization. | `string` | n/a | yes |
| <a name="input_cluster_type"></a> [cluster\_type](#input\_cluster\_type) | Type of cluster to create (aws-eks, azure-aks, or gcp-gke-standard) | `string` | n/a | yes |
| <a name="input_cluster_type"></a> [cluster\_type](#input\_cluster\_type) | Type of cluster to create (aws-eks, azure-aks, gcp-gke-standard, generic) | `string` | n/a | yes |
| <a name="input_control_plane_url"></a> [control\_plane\_url](#input\_control\_plane\_url) | URL of the TrueFoundry control plane (e.g., 'https://app.truefoundry.com') | `string` | n/a | yes |
| <a name="input_gcp_artifact_registry_url"></a> [gcp\_artifact\_registry\_url](#input\_gcp\_artifact\_registry\_url) | URL for GCP Artifact Registry (e.g., 'LOCATION-docker.pkg.dev/PROJECT\_ID') | `string` | `null` | no |
| <a name="input_gcp_blob_storage_enabled"></a> [gcp\_blob\_storage\_enabled](#input\_gcp\_blob\_storage\_enabled) | Enable GCP Blob Storage integration for cluster storage capabilities | `bool` | `true` | no |
Expand Down
2 changes: 1 addition & 1 deletion locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ locals {
}

# Select appropriate configuration based on cluster type
provider_config = templatefile(
provider_config = var.cluster_type == "generic" ? "" : templatefile(
local.provider_template[var.cluster_type],
var.cluster_type == "aws-eks" ? local.aws_config : (
var.cluster_type == "azure-aks" ? local.azure_config : (
Expand Down
6 changes: 4 additions & 2 deletions scripts/setup_truefoundry_cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,10 @@ main() {
cluster_id=$(create_cluster "${cluster_manifest}")
cluster_token=$(get_cluster_token "${cluster_id}")

# Setup provider account if configured
setup_provider_account
# Setup provider account if configured and cluster type is not generic
if [ "${CLUSTER_TYPE}" != "generic" ]; then
setup_provider_account
fi

# Get tenant information
tenant_name=$(get_tenant_name)
Expand Down
6 changes: 3 additions & 3 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ variable "cluster_name" {

variable "cluster_type" {
type = string
description = "Type of cluster to create (aws-eks, azure-aks, or gcp-gke-standard)"
description = "Type of cluster to create (aws-eks, azure-aks, gcp-gke-standard, generic)"
validation {
condition = contains(["aws-eks", "azure-aks", "gcp-gke-standard"], var.cluster_type)
error_message = "cluster_type must be one of: aws-eks, azure-aks, gcp-gke-standard"
condition = contains(["aws-eks", "azure-aks", "gcp-gke-standard", "generic"], var.cluster_type)
error_message = "cluster_type must be one of: aws-eks, azure-aks, gcp-gke-standard, generic"
}
}

Expand Down

0 comments on commit 4d902bc

Please sign in to comment.