Skip to content

Commit 91ea866

Browse files
authored
feat(argo-helm): add node selection support (#2)
1 parent 1a6a674 commit 91ea866

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ No modules.
9999
| <a name="input_argo_helm_enabled"></a> [argo\_helm\_enabled](#input\_argo\_helm\_enabled) | If set to true, the ArgoCD Application manifest will be deployed using Kubernetes provider as a Helm release. Otherwise it'll be deployed as a Kubernetes manifest. See Readme for more info | `bool` | `false` | no |
100100
| <a name="input_argo_helm_values"></a> [argo\_helm\_values](#input\_argo\_helm\_values) | Value overrides to use when deploying argo application object with helm | `string` | `""` | no |
101101
| <a name="input_argo_helm_wait_backoff_limit"></a> [argo\_helm\_wait\_backoff\_limit](#input\_argo\_helm\_wait\_backoff\_limit) | Backoff limit for ArgoCD Application Helm release wait job | `number` | `6` | no |
102+
| <a name="input_argo_helm_wait_node_selector"></a> [argo\_helm\_wait\_node\_selector](#input\_argo\_helm\_wait\_node\_selector) | Node selector for ArgoCD Application Helm release wait job | `map(string)` | `{}` | no |
102103
| <a name="input_argo_helm_wait_timeout"></a> [argo\_helm\_wait\_timeout](#input\_argo\_helm\_wait\_timeout) | Timeout for ArgoCD Application Helm release wait job | `string` | `"10m"` | no |
104+
| <a name="input_argo_helm_wait_tolerations"></a> [argo\_helm\_wait\_tolerations](#input\_argo\_helm\_wait\_tolerations) | Tolerations for ArgoCD Application Helm release wait job | `list(any)` | `[]` | no |
103105
| <a name="input_argo_info"></a> [argo\_info](#input\_argo\_info) | ArgoCD info manifest parameter | <pre>list(object({<br> name = string<br> value = string<br> }))</pre> | <pre>[<br> {<br> "name": "terraform",<br> "value": "true"<br> }<br>]</pre> | no |
104106
| <a name="input_argo_kubernetes_manifest_computed_fields"></a> [argo\_kubernetes\_manifest\_computed\_fields](#input\_argo\_kubernetes\_manifest\_computed\_fields) | List of paths of fields to be handled as "computed". The user-configured value for the field will be overridden by any different value returned by the API after apply. | `list(string)` | <pre>[<br> "metadata.labels",<br> "metadata.annotations",<br> "metadata.finalizers"<br>]</pre> | no |
105107
| <a name="input_argo_kubernetes_manifest_field_manager_force_conflicts"></a> [argo\_kubernetes\_manifest\_field\_manager\_force\_conflicts](#input\_argo\_kubernetes\_manifest\_field\_manager\_force\_conflicts) | Forcibly override any field manager conflicts when applying the kubernetes manifest resource | `bool` | `false` | no |

argo-helm.tf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,19 @@ resource "kubernetes_job" "helm_argo_application_wait" {
136136
}
137137
}
138138

139+
node_selector = var.argo_helm_wait_node_selector
140+
141+
dynamic "toleration" {
142+
for_each = var.argo_helm_wait_tolerations
143+
144+
content {
145+
key = try(toleration.value.key, null)
146+
operator = try(toleration.value.operator, null)
147+
value = try(toleration.value.value, null)
148+
effect = try(toleration.value.effect, null)
149+
}
150+
}
151+
139152
# ArgoCD Application status fields might not be available immediately after creation
140153
restart_policy = "OnFailure"
141154
}

variables.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,18 @@ variable "argo_helm_wait_timeout" {
152152
description = "Timeout for ArgoCD Application Helm release wait job"
153153
}
154154

155+
variable "argo_helm_wait_node_selector" {
156+
type = map(string)
157+
default = {}
158+
description = "Node selector for ArgoCD Application Helm release wait job"
159+
}
160+
161+
variable "argo_helm_wait_tolerations" {
162+
type = list(any)
163+
default = []
164+
description = "Tolerations for ArgoCD Application Helm release wait job"
165+
}
166+
155167
variable "argo_helm_wait_backoff_limit" {
156168
type = number
157169
default = 6

0 commit comments

Comments
 (0)