-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CRUSOE-16011: Implement Terraform support for CMK NodePools and Clusters
- Loading branch information
Clement Liaw
committed
Dec 19, 2024
1 parent
b38aac0
commit 43e401d
Showing
16 changed files
with
1,256 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,7 +49,6 @@ linters: | |
- gocritic | ||
- gofmt | ||
- gofumpt | ||
- gomnd | ||
- gosec | ||
- gosec | ||
- gosimple | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "crusoe_kubernetes_cluster Data Source - terraform-provider-crusoe" | ||
subcategory: "" | ||
description: |- | ||
--- | ||
|
||
# crusoe_kubernetes_cluster (Data Source) | ||
|
||
|
||
|
||
|
||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Optional | ||
|
||
- `add_ons` (List of String) | ||
- `cluster_cidr` (String) | ||
- `configuration` (String) | ||
- `location` (String) | ||
- `name` (String) | ||
- `node_cidr_mask_size` (Number) | ||
- `project_id` (String) | ||
- `service_cluster_ip_range` (String) | ||
- `subnet_id` (String) | ||
- `version` (String) | ||
|
||
### Read-Only | ||
|
||
- `dns_name` (String) | ||
- `id` (String) The ID of this resource. | ||
- `nodepool_ids` (List of String) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "crusoe_kubernetes_node_pool Data Source - terraform-provider-crusoe" | ||
subcategory: "" | ||
description: |- | ||
--- | ||
|
||
# crusoe_kubernetes_node_pool (Data Source) | ||
|
||
|
||
|
||
|
||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Optional | ||
|
||
- `cluster_id` (String) | ||
- `image_id` (String) | ||
- `instance_count` (Number) | ||
- `instance_ids` (List of String) | ||
- `name` (String) | ||
- `node_labels` (Map of String) | ||
- `project_id` (String) | ||
- `state` (String) | ||
- `subnet_id` (String) | ||
- `type` (String) | ||
|
||
### Read-Only | ||
|
||
- `id` (String) The ID of this resource. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "crusoe_kubernetes_cluster Resource - terraform-provider-crusoe" | ||
subcategory: "" | ||
description: |- | ||
--- | ||
|
||
# crusoe_kubernetes_cluster (Resource) | ||
|
||
|
||
|
||
|
||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `configuration` (String) The configuration of the Kubernetes cluster. Supports `standard` and `ha`. | ||
- `location` (String) | ||
- `name` (String) | ||
- `version` (String) | ||
|
||
### Optional | ||
|
||
- `add_ons` (List of String) | ||
- `cluster_cidr` (String) | ||
- `node_cidr_mask_size` (Number) | ||
- `project_id` (String) | ||
- `service_cluster_ip_range` (String) | ||
- `subnet_id` (String) | ||
|
||
### Read-Only | ||
|
||
- `dns_name` (String) | ||
- `id` (String) The ID of this resource. | ||
- `nodepool_ids` (List of String) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "crusoe_kubernetes_node_pool Resource - terraform-provider-crusoe" | ||
subcategory: "" | ||
description: |- | ||
--- | ||
|
||
# crusoe_kubernetes_node_pool (Resource) | ||
|
||
|
||
|
||
|
||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `cluster_id` (String) | ||
- `instance_count` (Number) | ||
- `name` (String) | ||
- `ssh_key` (String) | ||
- `type` (String) | ||
|
||
### Optional | ||
|
||
- `ib_partition_id` (String) | ||
- `project_id` (String) | ||
- `requested_node_labels` (Map of String) | ||
- `subnet_id` (String) | ||
|
||
### Read-Only | ||
|
||
- `all_node_labels` (Map of String) | ||
- `id` (String) The ID of this resource. | ||
- `image_id` (String) | ||
- `instance_ids` (List of String) | ||
- `state` (String) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
terraform { | ||
required_providers { | ||
crusoe = { | ||
source = "crusoecloud/crusoe" | ||
} | ||
} | ||
} | ||
|
||
locals { | ||
# Optional: Add your SSH public key to the created nodes to allow SSH access | ||
my_ssh_key = file("~/.ssh/id_ed25519.pub") | ||
} | ||
|
||
resource "crusoe_kubernetes_cluster" "my_cluster" { | ||
name = "tf-cluster" | ||
version = "1.30" | ||
configuration = "ha" | ||
location = "us-east1-a" | ||
|
||
# Optional: Set cluster/service CIDRs and node CIDR mask size | ||
# cluster_cidr = "192.168.1.0/24" | ||
# node_cidr_mask_size = "27" | ||
# service_cluster_ip_range = "192.168.2.0/24" | ||
} | ||
|
||
resource "crusoe_kubernetes_node_pool" "c1a_nodepool" { | ||
name = "tf-c1a-nodepool" | ||
cluster_id = crusoe_kubernetes_cluster.my_cluster.id | ||
instance_count = "1" | ||
type = "c1a.2x" | ||
ssh_key = local.my_ssh_key | ||
requested_node_labels = { | ||
# Optional: Kubernetes Node objects will be labeled with the following key:value pairs | ||
# "labelkey" = "labelvalue" | ||
} | ||
} | ||
|
||
output "cluster" { | ||
value = crusoe_kubernetes_cluster.my_cluster | ||
} | ||
|
||
output "nodepool" { | ||
value = crusoe_kubernetes_node_pool.c1a_nodepool | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.