Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: 🤖 add compactor taints and affinity #309

Merged
merged 3 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ module "monitoring" {
| <a name="input_aws_subnet_exporter_image_tag"></a> [aws\_subnet\_exporter\_image\_tag](#input\_aws\_subnet\_exporter\_image\_tag) | Tag of the subnet exporter image to use | `string` | `""` | no |
| <a name="input_business_unit"></a> [business\_unit](#input\_business\_unit) | n/a | `string` | `"Platforms"` | no |
| <a name="input_cluster_domain_name"></a> [cluster\_domain\_name](#input\_cluster\_domain\_name) | The cluster domain - used by externalDNS and certmanager to create URLs | `any` | n/a | yes |
| <a name="input_compactor_existing_pvc_claim_id"></a> [compactor\_existing\_pvc\_claim\_id](#input\_compactor\_existing\_pvc\_claim\_id) | this is an existing pvc that thanos compactor should connect with | `string` | `"disabled"` | no |
| <a name="input_dockerhub_password"></a> [dockerhub\_password](#input\_dockerhub\_password) | DockerHub password - required to avoid hitting Dockerhub API limits in EKS clusters | `string` | `""` | no |
| <a name="input_dockerhub_username"></a> [dockerhub\_username](#input\_dockerhub\_username) | DockerHub username - required to avoid hitting Dockerhub API limits in EKS clusters | `string` | `""` | no |
| <a name="input_eks_cluster_name"></a> [eks\_cluster\_name](#input\_eks\_cluster\_name) | n/a | `string` | `"live"` | no |
Expand Down
19 changes: 19 additions & 0 deletions templates/thanos-values.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,29 @@ compactor:
retentionResolution5m: 180d
retentionResolution1h: 365d
persistence:
%{ if eq compactor_existing_pvc_claim_id "disabled"}
%{ else ~}
existingClaim: "${compactor_existing_pvc_claim_id}"
%{ endif ~}
size: 16000Gi
serviceAccount:
create: false
name: "${prometheus_sa_name}"
tolerations:
- key: "thanos-node"
operator: "Equal"
value: "true"
effect: "NoSchedule"

affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: cloud-platform.justice.gov.uk/thanos-ng
operator: In
values:
- "true"
resources:
requests:
cpu: 1500m
Expand Down
9 changes: 5 additions & 4 deletions thanos.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ resource "helm_release" "thanos" {
version = "15.0.0"
timeout = 900
values = [templatefile("${path.module}/templates/thanos-values.yaml.tpl", {
prometheus_sa_name = local.prometheus_sa_name
enabled_compact = var.enable_thanos_compact
monitoring_aws_role = module.iam_assumable_role_monitoring.this_iam_role_name
clusterName = terraform.workspace
prometheus_sa_name = local.prometheus_sa_name
enabled_compact = var.enable_thanos_compact
monitoring_aws_role = module.iam_assumable_role_monitoring.this_iam_role_name
clusterName = terraform.workspace
compactor_existing_pvc_claim_id = var.compactor_existing_pvc_claim_id
})]

depends_on = [
Expand Down
7 changes: 6 additions & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,9 @@ variable "aws_subnet_exporter_image_tag" {
description = "Tag of the subnet exporter image to use"
default = ""
type = string
}
}

variable "compactor_existing_pvc_claim_id" {
description = "this is an existing pvc that thanos compactor should connect with"
default = "disabled"
}