diff --git a/README.md b/README.md index 2743294..d08e9d9 100644 --- a/README.md +++ b/README.md @@ -2,19 +2,18 @@ Deploys [actions-runner-controller](https://github.com/actions-runner-controller/actions-runner-controller). - ## Requirements | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 0.15 | -| [helm](#requirement\_helm) | ~> 2.3 | +| [helm](#requirement\_helm) | ~> 2.4 | ## Providers | Name | Version | |------|---------| -| [helm](#provider\_helm) | 2.4.1 | +| [helm](#provider\_helm) | ~> 2.4 | ## Modules @@ -30,7 +29,7 @@ No modules. | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| [api\_cache\_duration](#input\_api\_cache\_duration) | Set the cache period for API calls. Defaults to syncPeriod - 10s. | `string` | `null` | no | +| [api\_cache\_duration](#input\_api\_cache\_duration) | Set the cache period for API calls. Defaults to syncPeriod - 10s. | `string` | `""` | no | | [auth\_method](#input\_auth\_method) | GitHub authentication method to be deployed. | `string` | `"pat"` | no | | [auth\_secret\_annotations](#input\_auth\_secret\_annotations) | Set the annotations of the auth secret. | `map(any)` | `{}` | no | | [auth\_secret\_created](#input\_auth\_secret\_created) | Create Kubernetes secrets to authenticate with GitHub API. | `bool` | `false` | no | @@ -38,9 +37,10 @@ No modules. | [chart\_labels](#input\_chart\_labels) | Set labels to apply to all resources in the chart. | `map(any)` | `{}` | no | | [chart\_name](#input\_chart\_name) | Helm chart name to provision. | `string` | `"actions-runner-controller"` | no | | [chart\_namespace](#input\_chart\_namespace) | Namespace to install the chart into. | `string` | `"default"` | no | -| [chart\_repository](#input\_chart\_repository) | Helm repository for the chart | `string` | `"https://actions-runner-controller.github.io/actions-runner-controller."` | no | +| [chart\_namespace\_create](#input\_chart\_namespace\_created) | Create the namespace if it does not yet exist. | `bool` | `false` | no | +| [chart\_repository](#input\_chart\_repository) | Helm repository for the chart. | `string` | `"https://actions-runner-controller.github.io/actions-runner-controller"` | no | | [chart\_timeout](#input\_chart\_timeout) | Timeout to wait for the Chart to be deployed. | `number` | `300` | no | -| [chart\_version](#input\_chart\_version) | Version of Chart to install. Set to empty to install the latest version. | `string` | `"0.14.0"` | no | +| [chart\_version](#input\_chart\_version) | Version of Chart to install. Set to empty to install the latest version. | `string` | `"0.15.0"` | no | | [controller\_affinity](#input\_controller\_affinity) | Set the controller pod affinity rules. | `map(any)` | `{}` | no | | [controller\_env](#input\_controller\_env) | Set environment variables for the controller container. | `map(any)` | `{}` | no | | [controller\_image\_tag](#input\_controller\_image\_tag) | The tag of the controller container. | `string` | `"v0.20.3"` | no | @@ -59,15 +59,15 @@ No modules. | [dind\_sidecar\_image\_tag](#input\_dind\_sidecar\_image\_tag) | The tag of the dind sidecar container. | `string` | `"dind"` | no | | [dind\_sidecar\_repository](#input\_dind\_sidecar\_repository) | The repository/image of the dind sidecar container. | `string` | `"docker"` | no | | [docker\_registry\_mirror](#input\_docker\_registry\_mirror) | The default Docker Registry Mirror used by runners. | `string` | `""` | no | -| [github\_app\_id](#input\_github\_app\_id) | GitHub App ID. This can't be set at the same time as github\_token | `string` | `null` | no | -| [github\_app\_installation\_id](#input\_github\_app\_installation\_id) | GitHub App Installation ID. This can't be set at the same time as github\_token | `string` | `null` | no | -| [github\_app\_private\_key](#input\_github\_app\_private\_key) | The multiline string of your GitHub App's private key. This can't be set at the same time as github\_token | `string` | `null` | no | -| [github\_enterprise\_url](#input\_github\_enterprise\_url) | The URL of your GitHub Enterprise server, if you're using one. | `string` | `null` | no | -| [github\_token](#input\_github\_token) | Your chosen GitHub PAT token. This can't be set at the same time as github\_app\_* | `string` | `null` | no | +| [github\_app\_id](#input\_github\_app\_id) | GitHub App ID. This can't be set at the same time as github\_token | `string` | `""` | no | +| [github\_app\_installation\_id](#input\_github\_app\_installation\_id) | GitHub App Installation ID. This can't be set at the same time as github\_token | `string` | `""` | no | +| [github\_app\_private\_key](#input\_github\_app\_private\_key) | The multiline string of your GitHub App's private key. This can't be set at the same time as github\_token | `string` | `""` | no | +| [github\_enterprise\_url](#input\_github\_enterprise\_url) | The URL of your GitHub Enterprise server, if you're using one. | `string` | `""` | no | +| [github\_token](#input\_github\_token) | Your chosen GitHub PAT token. This can't be set at the same time as github\_app\_* | `string` | `""` | no | | [image\_pull\_policy](#input\_image\_pull\_policy) | The pull policy of the controller image. | `string` | `"IfNotPresent"` | no | | [image\_pull\_secrets](#input\_image\_pull\_secrets) | Specifies the secret to be used when pulling the controller pod containers. | `list(any)` | `[]` | no | -| [leader\_election\_id](#input\_leader\_election\_id) | Set the election ID for the controller group. | `string` | `null` | no | -| [log\_level](#input\_log\_level) | Set the log level of the controller container. | `string` | `null` | no | +| [leader\_election\_id](#input\_leader\_election\_id) | Set the election ID for the controller group. | `string` | `""` | no | +| [log\_level](#input\_log\_level) | Set the log level of the controller container. | `string` | `""` | no | | [max\_history](#input\_max\_history) | Max History for Helm. | `number` | `20` | no | | [metrics\_proxy\_enabled](#input\_metrics\_proxy\_enabled) | Deploy kube-rbac-proxy container in controller pod. | `bool` | `true` | no | | [metrics\_proxy\_image\_repository](#input\_metrics\_proxy\_image\_repository) | The repository/image of the kube-proxy container. | `string` | `"quay.io/brancz/kube-rbac-proxy"` | no | @@ -91,10 +91,10 @@ No modules. | [webhook\_server\_image\_pull\_secrets](#input\_webhook\_server\_image\_pull\_secrets) | Specifies the secret to be used when pulling the githubWebhookServer pod containers. | `list(any)` | `[]` | no | | [webhook\_server\_ingress\_annotations](#input\_webhook\_server\_ingress\_annotations) | Set annotations for the githubWebhookServer ingress kind. | `map(any)` | `{}` | no | | [webhook\_server\_ingress\_enabled](#input\_webhook\_server\_ingress\_enabled) | Whether to deploy an ingress kind for the githubWebhookServer. | `bool` | `false` | no | -| [webhook\_server\_ingress\_hosts](#input\_webhook\_server\_ingress\_hosts) | Set hosts for the githubWebhookServer ingress kind. | `string` | `null` | no | +| [webhook\_server\_ingress\_hosts](#input\_webhook\_server\_ingress\_hosts) | Set hosts for the githubWebhookServer ingress kind. | `string` | `""` | no | | [webhook\_server\_ingress\_hosts\_paths](#input\_webhook\_server\_ingress\_hosts\_paths) | Set hosts paths for the githubWebhookServer ingress kind. | `list(any)` | `[]` | no | | [webhook\_server\_ingress\_tls](#input\_webhook\_server\_ingress\_tls) | Set tls configuration for the githubWebhookServer ingress kind. | `list(any)` | `[]` | no | -| [webhook\_server\_log\_level](#input\_webhook\_server\_log\_level) | Set the log level of the githubWebhookServer container. | `string` | `null` | no | +| [webhook\_server\_log\_level](#input\_webhook\_server\_log\_level) | Set the log level of the githubWebhookServer container. | `string` | `""` | no | | [webhook\_server\_node\_selector](#input\_webhook\_server\_node\_selector) | Set the githubWebhookServer pod nodeSelector. | `map(any)` | `{}` | no | | [webhook\_server\_pod\_annotations](#input\_webhook\_server\_pod\_annotations) | Set annotations for the githubWebhookServer pod. | `map(any)` | `{}` | no | | [webhook\_server\_pod\_labels](#input\_webhook\_server\_pod\_labels) | Set labels for the githubWebhookServer pod. | `map(any)` | `{}` | no | diff --git a/main.tf b/main.tf index 4be8296..891525d 100644 --- a/main.tf +++ b/main.tf @@ -1,9 +1,10 @@ resource "helm_release" "release" { - name = var.release_name - chart = var.chart_name - repository = var.chart_repository - version = var.chart_version - namespace = var.chart_namespace + name = var.release_name + chart = var.chart_name + repository = var.chart_repository + version = var.chart_version + namespace = var.chart_namespace + create_namespace = var.chart_namespace_create max_history = var.max_history timeout = var.chart_timeout diff --git a/templates/values.yaml b/templates/values.yaml index 0f11755..be4f7ac 100644 --- a/templates/values.yaml +++ b/templates/values.yaml @@ -26,24 +26,22 @@ logLevel: ${log_level} # Only 1 authentication method can be deployed at a time # Uncomment the configuration you are applying and fill in the details -%{ if auth_secret_created } authSecret: - create: true + create: ${auth_secret_created} name: ${auth_secret_name} annotations: ${auth_secret_annotations} +%{ if auth_method == "github-app" ~} ### GitHub Apps Configuration ## NOTE: IDs MUST be strings, use quotes -%{ if auth_method == "github-app" ~} - github_app_id: ${github_app_id} - github_app_installation_id: ${github_app_installation_id} - github_app_private_key: | -${github_app_private_key} + github_app_id: "${github_app_id}" + github_app_installation_id: "${github_app_installation_id}" + github_app_private_key: |- + ${github_app_private_key} %{ endif ~} - ### GitHub PAT Configuration %{ if auth_method == "pat" ~} + ### GitHub PAT Configuration github_token: ${github_token} %{ endif ~} -%{ endif ~} dockerRegistryMirror: ${docker_registry_mirror} image: diff --git a/variables.tf b/variables.tf index 0e8620d..6f090ad 100644 --- a/variables.tf +++ b/variables.tf @@ -19,7 +19,7 @@ variable "chart_repository" { variable "chart_version" { description = "Version of Chart to install. Set to empty to install the latest version." type = string - default = "0.14.0" + default = "0.15.0" } variable "chart_namespace" { @@ -28,6 +28,12 @@ variable "chart_namespace" { default = "default" } +variable "chart_namespace_create" { + description = "Create the namespace if it does not yet exist." + type = bool + default = false +} + variable "chart_timeout" { description = "Timeout to wait for the Chart to be deployed." type = number @@ -64,25 +70,25 @@ variable "sync_period" { variable "leader_election_id" { description = "Set the election ID for the controller group." type = string - default = null + default = "" } variable "api_cache_duration" { description = "Set the cache period for API calls. Defaults to syncPeriod - 10s." type = string - default = null + default = "" } variable "github_enterprise_url" { description = "The URL of your GitHub Enterprise server, if you're using one." type = string - default = null + default = "" } variable "log_level" { description = "Set the log level of the controller container." type = string - default = null + default = "" } variable "auth_secret_created" { @@ -117,25 +123,25 @@ variable "auth_secret_annotations" { variable "github_app_id" { description = "GitHub App ID. This can't be set at the same time as github_token" type = string - default = null + default = "" } variable "github_app_installation_id" { description = "GitHub App Installation ID. This can't be set at the same time as github_token" type = string - default = null + default = "" } variable "github_app_private_key" { description = "The multiline string of your GitHub App's private key. This can't be set at the same time as github_token" type = string - default = null + default = "" } variable "github_token" { description = "Your chosen GitHub PAT token. This can't be set at the same time as github_app_*" type = string - default = null + default = "" } variable "docker_registry_mirror" { @@ -366,7 +372,7 @@ variable "webhook_server_sync_period" { variable "webhook_server_log_level" { description = "Set the log level of the githubWebhookServer container." type = string - default = null + default = "" } variable "webhook_server_secret_created" { @@ -504,7 +510,7 @@ variable "webhook_server_ingress_annotations" { variable "webhook_server_ingress_hosts" { description = "Set hosts for the githubWebhookServer ingress kind." type = string - default = null + default = "" } variable "webhook_server_ingress_hosts_paths" { diff --git a/versions.tf b/versions.tf index 3913b3e..2f24530 100644 --- a/versions.tf +++ b/versions.tf @@ -2,7 +2,7 @@ terraform { required_providers { helm = { source = "hashicorp/helm" - version = "~> 2.3" + version = "~> 2.4" } } required_version = ">= 0.15"