Skip to content

Commit

Permalink
Added flag for monthly billing with nodepools
Browse files Browse the repository at this point in the history
  • Loading branch information
timetinytim committed May 10, 2024
1 parent 2860c64 commit 35b0989
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ No modules.
| <a name="input_cluster_version"></a> [cluster\_version](#input\_cluster\_version) | Kubelet version to use when creating the cluster. | `string` | n/a | yes |
| <a name="input_network_cidr"></a> [network\_cidr](#input\_network\_cidr) | Subnet to assign to the private network. | `string` | n/a | yes |
| <a name="input_network_gateway_model"></a> [network\_gateway\_model](#input\_network\_gateway\_model) | Size of the gateway to use for the private network. | `string` | `"s"` | no |
| <a name="input_node_pools"></a> [node\_pools](#input\_node\_pools) | Node pools to create for the cluster. | <pre>list(object({<br> flavor_name = string<br> nodes = number<br> name = optional(string, "")<br> template = optional(map(any), {})<br> }))</pre> | n/a | yes |
| <a name="input_node_pools"></a> [node\_pools](#input\_node\_pools) | Node pools to create for the cluster. | <pre>list(object({<br> flavor_name = string<br> nodes = number<br> name = optional(string, "")<br> template = optional(map(any), {})<br> monthly_billed = optional(bool, false)<br> }))</pre> | n/a | yes |
| <a name="input_oidc_client_id"></a> [oidc\_client\_id](#input\_oidc\_client\_id) | OIDC client ID to give the cluster for login. | `string` | `""` | no |
| <a name="input_oidc_groups_claim"></a> [oidc\_groups\_claim](#input\_oidc\_groups\_claim) | Groups to include in the OIDC claim. | `list(string)` | `[]` | no |
| <a name="input_oidc_groups_prefix"></a> [oidc\_groups\_prefix](#input\_oidc\_groups\_prefix) | Prefix to add to all groups connecting to the cluster. | `string` | `""` | no |
| <a name="input_oidc_provider_url"></a> [oidc\_provider\_url](#input\_oidc\_provider\_url) | URL to use for OIDC authentication. Enables OIDC if specified. | `string` | `""` | no |
| <a name="input_oidc_username_claim"></a> [oidc\_username\_claim](#input\_oidc\_username\_claim) | OIDC Property to use for username. | `string` | `"email"` | no |
| <a name="input_oidc_username_claim"></a> [oidc\_username\_claim](#input\_oidc\_username\_claim) | OIDC Property to use for username. | `string` | `""` | no |
| <a name="input_oidc_username_prefix"></a> [oidc\_username\_prefix](#input\_oidc\_username\_prefix) | Prefix to add to all usernames connecting to the cluster. | `string` | `""` | no |
| <a name="input_project_id"></a> [project\_id](#input\_project\_id) | The ID of the Public Cloud project the resources will be created in. | `string` | n/a | yes |
| <a name="input_region"></a> [region](#input\_region) | Region in which to create the various resources. | `string` | `"DE1"` | no |
Expand Down
15 changes: 8 additions & 7 deletions cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ resource "ovh_cloud_project_kube" "cluster" {
resource "ovh_cloud_project_kube_nodepool" "node_pool" {
count = length(var.node_pools)

service_name = var.project_id
kube_id = ovh_cloud_project_kube.cluster.id
name = var.node_pools[count.index].name != "" ? var.node_pools[count.index].name : "pool${count.index}"
flavor_name = var.node_pools[count.index].flavor_name
desired_nodes = var.node_pools[count.index].nodes
max_nodes = var.node_pools[count.index].nodes
min_nodes = var.node_pools[count.index].nodes
service_name = var.project_id
kube_id = ovh_cloud_project_kube.cluster.id
name = var.node_pools[count.index].name != "" ? var.node_pools[count.index].name : "pool${count.index}"
flavor_name = var.node_pools[count.index].flavor_name
desired_nodes = var.node_pools[count.index].nodes
max_nodes = var.node_pools[count.index].nodes
min_nodes = var.node_pools[count.index].nodes
monthly_billed = var.node_pools[count.index].monthly_billed
}
resource "ovh_cloud_project_kube_oidc" "oidc" {
Expand Down
9 changes: 5 additions & 4 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ variable "cluster_version" {
variable "node_pools" {
description = "Node pools to create for the cluster."
type = list(object({
flavor_name = string
nodes = number
name = optional(string, "")
template = optional(map(any), {})
flavor_name = string
nodes = number
name = optional(string, "")
template = optional(map(any), {})
monthly_billed = optional(bool, false)
}))
}

Expand Down

0 comments on commit 35b0989

Please sign in to comment.