Skip to content

Commit

Permalink
feat: add Pod Pinner (#85)
Browse files Browse the repository at this point in the history
* feat: add Pod Pinner
  • Loading branch information
vladklokun authored Sep 27, 2024
1 parent ff09fae commit 2128f2d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ Usage examples are located in [terraform provider repo](https://github.com/casta
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13 |
| <a name="requirement_azuread"></a> [azuread](#requirement\_azuread) | >= 2.22.0 |
| <a name="requirement_azurerm"></a> [azurerm](#requirement\_azurerm) | >= 3.7.0 |
| <a name="requirement_castai"></a> [castai](#requirement\_castai) | ~> 7.11 |
| <a name="requirement_castai"></a> [castai](#requirement\_castai) | ~> 7.14 |
| <a name="requirement_helm"></a> [helm](#requirement\_helm) | >= 2.0.0 |

## Providers
Expand All @@ -302,7 +302,7 @@ Usage examples are located in [terraform provider repo](https://github.com/casta
|------|---------|
| <a name="provider_azuread"></a> [azuread](#provider\_azuread) | >= 2.22.0 |
| <a name="provider_azurerm"></a> [azurerm](#provider\_azurerm) | >= 3.7.0 |
| <a name="provider_castai"></a> [castai](#provider\_castai) | ~> 7.11 |
| <a name="provider_castai"></a> [castai](#provider\_castai) | ~> 7.14 |
| <a name="provider_helm"></a> [helm](#provider\_helm) | >= 2.0.0 |
| <a name="provider_null"></a> [null](#provider\_null) | n/a |

Expand Down Expand Up @@ -361,7 +361,8 @@ No modules.
| <a name="input_castai_components_sets"></a> [castai\_components\_sets](#input\_castai\_components\_sets) | Optional additional 'set' configurations for helm resources. | `map(string)` | `{}` | no |
| <a name="input_cluster_controller_values"></a> [cluster\_controller\_values](#input\_cluster\_controller\_values) | List of YAML formatted string values for cluster-controller helm chart | `list(string)` | `[]` | no |
| <a name="input_cluster_controller_version"></a> [cluster\_controller\_version](#input\_cluster\_controller\_version) | Version of castai-cluster-controller helm chart. If not provided, latest version will be used. | `string` | `null` | no |
| <a name="input_default_node_configuration"></a> [default\_node\_configuration](#input\_default\_node\_configuration) | ID of the default node configuration | `string` | n/a | yes |
| <a name="input_default_node_configuration"></a> [default\_node\_configuration](#input\_default\_node\_configuration) | ID of the default node configuration | `string` | `""` | no |
| <a name="input_default_node_configuration_name"></a> [default\_node\_configuration\_name](#input\_default\_node\_configuration\_name) | Name of the default node configuration | `string` | `""` | no |
| <a name="input_delete_nodes_on_disconnect"></a> [delete\_nodes\_on\_disconnect](#input\_delete\_nodes\_on\_disconnect) | Optionally delete Cast AI created nodes when the cluster is destroyed | `bool` | `false` | no |
| <a name="input_evictor_ext_values"></a> [evictor\_ext\_values](#input\_evictor\_ext\_values) | List of YAML formatted string with evictor-ext values | `list(string)` | `[]` | no |
| <a name="input_evictor_ext_version"></a> [evictor\_ext\_version](#input\_evictor\_ext\_version) | Version of castai-evictor-ext chart. Default latest | `string` | `null` | no |
Expand Down
12 changes: 10 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ resource "helm_release" "castai_pod_pinner" {
depends_on = [helm_release.castai_agent]

lifecycle {
ignore_changes = [set, version]
ignore_changes = [version]
}
}

Expand Down Expand Up @@ -859,6 +859,14 @@ resource "castai_autoscaler" "castai_autoscaler_policies" {
max_ram_mib = try(node_constraints.value.max_ram_mib, null)
}
}

dynamic "pod_pinner" {
for_each = try([unschedulable_pods.value.pod_pinner], [])

content {
enabled = try(pod_pinner.value.enabled, null)
}
}
}
}

Expand Down Expand Up @@ -943,5 +951,5 @@ resource "castai_autoscaler" "castai_autoscaler_policies" {
}
}

depends_on = [helm_release.castai_agent, helm_release.castai_evictor]
depends_on = [helm_release.castai_agent, helm_release.castai_evictor, helm_release.castai_pod_pinner]
}
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ terraform {
}
castai = {
source = "castai/castai"
version = "~> 7.13"
version = "~> 7.14"
}
helm = {
source = "hashicorp/helm"
Expand Down

0 comments on commit 2128f2d

Please sign in to comment.