Skip to content

Terraform module to set up Bitbucket self-hosted runners on a Kubernetes cluster

License

Notifications You must be signed in to change notification settings

skyscrapers/terraform-bitbucket-runners

Repository files navigation

Terraform Bitbucket Runners

This module sets up a set of Bitbucket runners on a Kubernetes cluster. It accepts a list of runner configurations and deploys a Service and a StatefulSet for each of them.

Requirements

Name Version
terraform >= 1.0, < 1.6.0
kubernetes ~> 2.13

Providers

Name Version
kubernetes ~> 2.13

Modules

No modules.

Resources

Name Type
kubernetes_service.bitbucket_runner resource
kubernetes_service_account.bitbucket_runner resource
kubernetes_stateful_set.bitbucket_runner resource

Inputs

Name Description Type Default Required
bitbucket_runners Map of Bitbucket runner definitions
map(object({
runner_resources = optional(object({
limits = optional(object({
cpu = optional(string)
memory = optional(string)
}))
requests = optional(object({
cpu = optional(string)
memory = optional(string)
}))
}))
dind_resources = optional(object({
limits = optional(object({
cpu = optional(string)
memory = optional(string)
}))
requests = optional(object({
cpu = optional(string)
memory = optional(string)
}))
}))
}))
n/a yes
k8s_namespace Kubernetes namespace where to deploy the runners to string n/a yes
bitbucket_runner_container_default_resources Default resources that will be applied to the Bitbucket runner container of all runner Pods, unless overriden in the runner definition
object({
limits = optional(object({
cpu = optional(string)
memory = optional(string)
}))
requests = optional(object({
cpu = optional(string)
memory = optional(string)
}))
})
{
"limits": {
"cpu": null,
"memory": "4G"
},
"requests": {
"cpu": 1,
"memory": "1G"
}
}
no
dind_container_default_resources Default resources that will be applied to the DinD container of all runner Pods, unless overriden in the runner definition
object({
limits = optional(object({
cpu = optional(string)
memory = optional(string)
}))
requests = optional(object({
cpu = optional(string)
memory = optional(string)
}))
})
{
"limits": {
"cpu": null,
"memory": "4G"
},
"requests": {
"cpu": 1,
"memory": "1G"
}
}
no
k8s_labels Labels to apply to all Kubernetes objects map(string) {} no
k8s_node_selector Node selector to apply to the runner StatefulSets map(string) null no
k8s_service_account_annotations Annotations to attach to the ServiceAccount map(string) {} no
k8s_tolerations Tolerations to apply to the runner StatefulSets
list(object({
effect = string
key = string
value = string
}))
[] no

Outputs

Name Description
kubernetes_service_account_name n/a

About

Terraform module to set up Bitbucket self-hosted runners on a Kubernetes cluster

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages