Skip to content

Commit 3b4eb92

Browse files
authored
Quick fixes to EKS/ARC arm64 Support (cloudposse/terraform-aws-components#610)
1 parent 2088982 commit 3b4eb92

File tree

2 files changed

+57
-9
lines changed

2 files changed

+57
-9
lines changed

src/README.md

Lines changed: 56 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ components:
3838
github_app_installation_id: "REPLACE_ME_GH_INSTALLATION_ID"
3939

4040
# ssm_github_webhook_secret_token_path: "/github_runners/github_webhook_secret_token"
41+
# The webhook based autoscaler is much more efficient than the polling based autoscaler
4142
webhook:
42-
enabled: false
43+
enabled: true
4344
hostname_template: "gha-webhook.%[3]v.%[2]v.%[1]v.acme.com"
4445

4546
eks_component_name: "eks/cluster"
@@ -54,12 +55,7 @@ components:
5455
infra-runner:
5556
node_selector:
5657
kubernetes.io/os: "linux"
57-
kubernetes.io/arch: "arm64"
58-
tolerations:
59-
- key: "kubernetes.io/arch"
60-
operator: "Equal"
61-
value: "arm64"
62-
effect: "NoSchedule"
58+
kubernetes.io/arch: "amd64"
6359
type: "repository" # can be either 'organization' or 'repository'
6460
dind_enabled: false # If `true`, a Docker sidecar container will be deployed
6561
# To run Docker in Docker (dind), change image to summerwind/actions-runner-dind
@@ -80,6 +76,9 @@ components:
8076
webhook_driven_scaling_enabled: true
8177
webhook_startup_timeout: "2m"
8278
pull_driven_scaling_enabled: false
79+
# Labels are not case-sensitive to GitHub, but *are* case-sensitive
80+
# to the webhook based autoscaler, which requires exact matches
81+
# between the `runs-on:` label in the workflow and the runner labels.
8382
labels:
8483
- "Linux"
8584
- "linux"
@@ -92,6 +91,55 @@ components:
9291
- "AMD64"
9392
- "core-auto"
9493
- "common"
94+
# Uncomment this additional runner if you want to run a second
95+
# runner pool for `arm64` architecture
96+
#infra-runner-arm64:
97+
# node_selector:
98+
# kubernetes.io/os: "linux"
99+
# kubernetes.io/arch: "arm64"
100+
# # Add the corresponding taint to the Kubernetes nodes running `arm64` architecture
101+
# # to prevent Kubernetes pods without node selectors from being scheduled on them.
102+
# tolerations:
103+
# - key: "kubernetes.io/arch"
104+
# operator: "Equal"
105+
# value: "arm64"
106+
# effect: "NoSchedule"
107+
# type: "repository" # can be either 'organization' or 'repository'
108+
# dind_enabled: false # If `true`, a Docker sidecar container will be deployed
109+
# # To run Docker in Docker (dind), change image to summerwind/actions-runner-dind
110+
# # If not running Docker, change image to summerwind/actions-runner use a smaller image
111+
# image: summerwind/actions-runner-dind
112+
# # `scope` is org name for Organization runners, repo name for Repository runners
113+
# scope: "org/infra"
114+
# min_replicas: 1
115+
# max_replicas: 20
116+
# scale_down_delay_seconds: 100
117+
# resources:
118+
# limits:
119+
# cpu: 200m
120+
# memory: 512Mi
121+
# requests:
122+
# cpu: 100m
123+
# memory: 128Mi
124+
# webhook_driven_scaling_enabled: true
125+
# webhook_startup_timeout: "2m"
126+
# pull_driven_scaling_enabled: false
127+
# # Labels are not case-sensitive to GitHub, but *are* case-sensitive
128+
# # to the webhook based autoscaler, which requires exact matches
129+
# # between the `runs-on:` label in the workflow and the runner labels.
130+
# # Leave "common" off the list so that "common" jobs are always
131+
# # scheduled on the amd64 runners. This is because the webhook
132+
# # based autoscaler will not scale a runner pool if the
133+
# # `runs-on:` labels in the workflow match more than one pool.
134+
# labels:
135+
# - "Linux"
136+
# - "linux"
137+
# - "Ubuntu"
138+
# - "ubuntu"
139+
# - "amd64"
140+
# - "AMD64"
141+
# - "core-auto"
142+
95143
```
96144

97145
### Generating Required Secrets
@@ -289,7 +337,7 @@ Consult [actions-runner-controller](https://github.com/actions-runner-controller
289337
| <a name="input_regex_replace_chars"></a> [regex\_replace\_chars](#input\_regex\_replace\_chars) | Terraform regular expression (regex) string.<br>Characters matching the regex will be removed from the ID elements.<br>If not set, `"/[^a-zA-Z0-9-]/"` is used to remove all characters other than hyphens, letters and digits. | `string` | `null` | no |
290338
| <a name="input_region"></a> [region](#input\_region) | AWS Region. | `string` | n/a | yes |
291339
| <a name="input_resources"></a> [resources](#input\_resources) | The cpu and memory of the deployment's limits and requests. | <pre>object({<br> limits = object({<br> cpu = string<br> memory = string<br> })<br> requests = object({<br> cpu = string<br> memory = string<br> })<br> })</pre> | n/a | yes |
292-
| <a name="input_runners"></a> [runners](#input\_runners) | Map of Action Runner configurations, with the key being the name of the runner. Please note that the name must be in<br>kebab-case.<br><br>For example:<pre>hcl<br>organization_runner = {<br> type = "organization" # can be either 'organization' or 'repository'<br> dind_enabled: false # A Docker sidecar container will be deployed<br> image: summerwind/actions-runner # If dind_enabled=true, set this to 'summerwind/actions-runner-dind'<br> scope = "ACME" # org name for Organization runners, repo name for Repository runners<br> scale_down_delay_seconds = 300<br> min_replicas = 1<br> max_replicas = 5<br> busy_metrics = {<br> scale_up_threshold = 0.75<br> scale_down_threshold = 0.25<br> scale_up_factor = 2<br> scale_down_factor = 0.5<br> }<br> labels = [<br> "Ubuntu",<br> "core-automation",<br> ]<br>}</pre> | <pre>map(object({<br> type = string<br> scope = string<br> image = optional(string, "")<br> dind_enabled = bool<br> node_selector = optional(map(string), {})<br> tolerations = optional(list(object({<br> key = string<br> operator = string<br> value = string<br> effect = string<br> })), [])<br> scale_down_delay_seconds = number<br> min_replicas = number<br> max_replicas = number<br> busy_metrics = optional(object({<br> scale_up_threshold = string<br> scale_down_threshold = string<br> scale_up_adjustment = optional(string)<br> scale_down_adjustment = optional(string)<br> scale_up_factor = optional(string)<br> scale_down_factor = optional(string)<br> }))<br> webhook_driven_scaling_enabled = bool<br> webhook_startup_timeout = optional(string, null)<br> pull_driven_scaling_enabled = bool<br> labels = list(string)<br> storage = optional(string, null)<br> pvc_enabled = optional(string, false)<br> resources = object({<br> limits = object({<br> cpu = string<br> memory = string<br> ephemeral_storage = optional(string, null)<br> })<br> requests = object({<br> cpu = string<br> memory = string<br> })<br> })<br> }))</pre> | n/a | yes |
340+
| <a name="input_runners"></a> [runners](#input\_runners) | Map of Action Runner configurations, with the key being the name of the runner. Please note that the name must be in<br>kebab-case.<br><br>For example:<pre>hcl<br>organization_runner = {<br> type = "organization" # can be either 'organization' or 'repository'<br> dind_enabled: false # A Docker sidecar container will be deployed<br> image: summerwind/actions-runner # If dind_enabled=true, set this to 'summerwind/actions-runner-dind'<br> scope = "ACME" # org name for Organization runners, repo name for Repository runners<br> scale_down_delay_seconds = 300<br> min_replicas = 1<br> max_replicas = 5<br> busy_metrics = {<br> scale_up_threshold = 0.75<br> scale_down_threshold = 0.25<br> scale_up_factor = 2<br> scale_down_factor = 0.5<br> }<br> labels = [<br> "Ubuntu",<br> "core-automation",<br> ]<br>}</pre> | <pre>map(object({<br> type = string<br> scope = string<br> image = optional(string, "")<br> dind_enabled = bool<br> node_selector = optional(map(string), {})<br> tolerations = optional(list(object({<br> key = string<br> operator = string<br> value = optional(string, null)<br> effect = string<br> })), [])<br> scale_down_delay_seconds = number<br> min_replicas = number<br> max_replicas = number<br> busy_metrics = optional(object({<br> scale_up_threshold = string<br> scale_down_threshold = string<br> scale_up_adjustment = optional(string)<br> scale_down_adjustment = optional(string)<br> scale_up_factor = optional(string)<br> scale_down_factor = optional(string)<br> }))<br> webhook_driven_scaling_enabled = bool<br> webhook_startup_timeout = optional(string, null)<br> pull_driven_scaling_enabled = bool<br> labels = list(string)<br> storage = optional(string, null)<br> pvc_enabled = optional(string, false)<br> resources = object({<br> limits = object({<br> cpu = string<br> memory = string<br> ephemeral_storage = optional(string, null)<br> })<br> requests = object({<br> cpu = string<br> memory = string<br> })<br> })<br> }))</pre> | n/a | yes |
293341
| <a name="input_s3_bucket_arns"></a> [s3\_bucket\_arns](#input\_s3\_bucket\_arns) | List of ARNs of S3 Buckets to which the runners will have read-write access to. | `list(string)` | `[]` | no |
294342
| <a name="input_ssm_github_secret_path"></a> [ssm\_github\_secret\_path](#input\_ssm\_github\_secret\_path) | The path in SSM to the GitHub app private key file contents or GitHub PAT token. | `string` | `""` | no |
295343
| <a name="input_ssm_github_webhook_secret_token_path"></a> [ssm\_github\_webhook\_secret\_token\_path](#input\_ssm\_github\_webhook\_secret\_token\_path) | The path in SSM to the GitHub Webhook Secret token. | `string` | `""` | no |

src/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ variable "runners" {
170170
tolerations = optional(list(object({
171171
key = string
172172
operator = string
173-
value = string
173+
value = optional(string, null)
174174
effect = string
175175
})), [])
176176
scale_down_delay_seconds = number

0 commit comments

Comments
 (0)