diff --git a/README.md b/README.md index 57c0d92..6a63a1a 100644 --- a/README.md +++ b/README.md @@ -54,54 +54,54 @@ module "actions_runner" { ## Requirements -| Name | Version | -| ---------------------------------------------------------------------------- | --------- | -| [terraform](#requirement\_terraform) | >= 0.13 | -| [kubectl](#requirement\_kubectl) | >= 1.14.0 | +| Name | Version | +|------|---------| +| [terraform](#requirement\_terraform) | >= 0.13 | +| [kubectl](#requirement\_kubectl) | >= 1.14.0 | | [kubernetes](#requirement\_kubernetes) | >= 2.23.0 | ## Providers -| Name | Version | -| ---------------------------------------------------------------------- | --------- | -| [kubectl](#provider\_kubectl) | >= 1.14.0 | +| Name | Version | +|------|---------| +| [kubectl](#provider\_kubectl) | >= 1.14.0 | | [kubernetes](#provider\_kubernetes) | >= 2.23.0 | ## Resources -| Name | Type | -| --------------------------------------------------------------------------------------------------------------------------------------- | -------- | -| [kubectl_manifest.runner](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/resources/manifest) | resource | -| [kubectl_manifest.runner_autoscaler](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/resources/manifest) | resource | -| [kubernetes_config_map.job-template](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/config_map) | resource | -| [kubernetes_namespace.this](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/namespace) | resource | -| [kubernetes_role.runner](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/role) | resource | -| [kubernetes_role_binding.runner](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/role_binding) | resource | -| [kubernetes_secret.job](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/secret) | resource | -| [kubernetes_secret.runner](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/secret) | resource | -| [kubernetes_service_account.job](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/service_account) | resource | +| Name | Type | +|------|------| +| [kubectl_manifest.runner](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/resources/manifest) | resource | +| [kubectl_manifest.runner_autoscaler](https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/resources/manifest) | resource | +| [kubernetes_config_map.job-template](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/config_map) | resource | +| [kubernetes_namespace.this](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/namespace) | resource | +| [kubernetes_role.runner](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/role) | resource | +| [kubernetes_role_binding.runner](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/role_binding) | resource | +| [kubernetes_secret.job](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/secret) | resource | +| [kubernetes_secret.runner](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/secret) | resource | +| [kubernetes_service_account.job](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/service_account) | resource | | [kubernetes_service_account.runner](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/service_account) | resource | ## Inputs -| Name | Description | Type | Default | Required | -| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------: | -| [repo\_name](#input\_repo\_name) | The name of the repository | `string` | n/a | yes | -| [repo\_owner](#input\_repo\_owner) | The owner of the repository | `string` | n/a | yes | -| [create\_namespace](#input\_create\_namespace) | If true, the namespace will be created | `bool` | `true` | no | -| [ephemeral](#input\_ephemeral) | If true, the runner will be ephemeral | `bool` | `true` | no | -| [job\_service\_account\_name](#input\_job\_service\_account\_name) | The name of the service account for the job | `string` | `"github-actions-job"` | no | -| [labels](#input\_labels) | The labels for the runner | `list(string)` |
[| no | -| [max\_count](#input\_max\_count) | The maximum number of runners | `number` | `3` | no | -| [metrics](#input\_metrics) | The metrics for the runner | `list(map(string))` |
"k8s",
"arc"
]
[| no | -| [min\_count](#input\_min\_count) | The minimum number of runners | `number` | `1` | no | -| [name](#input\_name) | The name of the runner deployment | `string` | `"github-actions-runner"` | no | -| [namespace](#input\_namespace) | The namespace to deploy the runner controller into | `string` | `"github-actions-runner"` | no | -| [runner\_image](#input\_runner\_image) | The image for the runner | `string` | `"summerwind/actions-runner:latest"` | no | -| [runner\_service\_account\_name](#input\_runner\_service\_account\_name) | The name of the service account for the runner | `string` | `"github-actions-runner"` | no | -| [scale\_down\_delay\_seconds](#input\_scale\_down\_delay\_seconds) | The number of seconds from scaling out to wait before scaling down | `number` | `300` | no | -| [storage\_class\_name](#input\_storage\_class\_name) | The storage class name for the runner | `string` | `"default"` | no | -| [storage\_size](#input\_storage\_size) | The storage size for the runner | `string` | `"100Mi"` | no | +| Name | Description | Type | Default | Required | +|------|-------------|------|---------|:--------:| +| [repo\_name](#input\_repo\_name) | The name of the repository | `string` | n/a | yes | +| [repo\_owner](#input\_repo\_owner) | The owner of the repository | `string` | n/a | yes | +| [create\_namespace](#input\_create\_namespace) | If true, the namespace will be created | `bool` | `true` | no | +| [ephemeral](#input\_ephemeral) | If true, the runner will be ephemeral | `bool` | `true` | no | +| [job\_service\_account\_name](#input\_job\_service\_account\_name) | The name of the service account for the job | `string` | `"github-actions-job"` | no | +| [labels](#input\_labels) | The labels for the runner | `list(string)` |
{
"scaleDownFactor": "0.5",
"scaleDownThreshold": "0.25",
"scaleUpFactor": "2",
"scaleUpThreshold": "0.75",
"type": "PercentageRunnersBusy"
}
]
[| no | +| [max\_count](#input\_max\_count) | The maximum number of runners | `number` | `3` | no | +| [metrics](#input\_metrics) | The metrics for the runner | `list(map(string))` |
"k8s",
"arc"
]
[| no | +| [min\_count](#input\_min\_count) | The minimum number of runners | `number` | `1` | no | +| [name](#input\_name) | The name of the runner deployment | `string` | `"github-actions-runner"` | no | +| [namespace](#input\_namespace) | The namespace to deploy the runner controller into | `string` | `"github-actions-runner"` | no | +| [runner\_image](#input\_runner\_image) | The image for the runner | `string` | `"summerwind/actions-runner:latest"` | no | +| [runner\_service\_account\_name](#input\_runner\_service\_account\_name) | The name of the service account for the runner | `string` | `"github-actions-runner"` | no | +| [scale\_down\_delay\_seconds](#input\_scale\_down\_delay\_seconds) | The number of seconds from scaling out to wait before scaling down | `number` | `300` | no | +| [storage\_class\_name](#input\_storage\_class\_name) | The storage class name for the runner | `string` | `"default"` | no | +| [storage\_size](#input\_storage\_size) | The storage size for the runner | `string` | `"100Mi"` | no | diff --git a/main.tf b/main.tf index ab3f5d9..8b37b72 100644 --- a/main.tf +++ b/main.tf @@ -30,6 +30,7 @@ resource "kubectl_manifest" "runner" { repository = "${var.repo_owner}/${var.repo_name}" labels = var.labels containerMode = "kubernetes" + ephemeral = var.ephemeral serviceAccountName = kubernetes_service_account.runner.metadata[0].name workVolumeClaimTemplate = { storageClassName = var.storage_class_name @@ -87,7 +88,6 @@ resource "kubectl_manifest" "runner_autoscaler" { minReplicas = var.min_count maxReplicas = var.max_count metrics = var.metrics - ephemeral = var.ephemeral } }) }
{
"scaleDownFactor": "0.5",
"scaleDownThreshold": "0.25",
"scaleUpFactor": "2",
"scaleUpThreshold": "0.75",
"type": "PercentageRunnersBusy"
}
]