Skip to content

Commit

Permalink
Merge pull request #85 from sparkfabrik/gitaly_resources
Browse files Browse the repository at this point in the history
refs platform/3278: Add option for gitaly requests
  • Loading branch information
Syphon83 authored Nov 26, 2024
2 parents fda619c + b812f80 commit a82050a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
2 changes: 2 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,8 @@ locals {
ENABLE_MIGRATIONS = var.gitab_enable_migrations
ENABLE_PROM_EXPORTER = var.gitab_enable_prom_exporter
GITALY_MAX_UNAVAILABLE = var.gitlab_gitaly_max_unavailable
GITALY_REQUEST_CPU = var.gitlab_gitaly_request_cpu
GITALY_REQUEST_MEMORY = var.gitlab_gitaly_request_mem
ENABLE_SERVICE_PING = var.gitlab_enable_service_ping
ENABLE_INCOMING_MAIL = var.gitlab_enable_incoming_mail
INC_MAIL_ADDR = var.gitlab_incoming_mail_address
Expand Down
4 changes: 4 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -286,3 +286,7 @@ gitlab:
%{ for key, value in PV_MATCH_LABEL ~}
${key}: ${value}
%{ endfor ~}
resources:
requests:
cpu: ${GITALY_REQUEST_CPU}
memory: ${GITALY_REQUEST_MEMORY}
20 changes: 20 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,26 @@ variable "gitlab_gitaly_max_unavailable" {
default = 0
}

variable "gitlab_gitaly_request_cpu" {
type = string
description = "CPU request for gitaly POD. Measurement unit needs to be specified. Default 100m."
default = "100m"
validation {
condition = can(regex("^[0-9]+(m|\\.[0-9]+)$", var.gitlab_gitaly_request_cpu))
error_message = "CPU request must be a valid Kubernetes CPU value (e.g., 100m or 0.1)."
}
}

variable "gitlab_gitaly_request_mem" {
type = string
description = "Memory request for gitaly POD. Measurement unit needs to be specified. Default 200Mi."
default = "200Mi"
validation {
condition = can(regex("^[0-9]+(Mi|Gi|Ti|Ki)$", var.gitlab_gitaly_request_mem))
error_message = "Memory request must be a valid Kubernetes memory value (e.g., 200Mi, 1Gi)."
}
}

variable "cloud_nat_endpoint_independent_mapping" {
type = bool
description = "Specifies if endpoint independent mapping is enabled."
Expand Down

0 comments on commit a82050a

Please sign in to comment.