diff --git a/terraform/modules/k8s-cluster/manager-node.tf b/terraform/modules/k8s-cluster/manager-node.tf index bf1cebb..139e5db 100644 --- a/terraform/modules/k8s-cluster/manager-node.tf +++ b/terraform/modules/k8s-cluster/manager-node.tf @@ -116,6 +116,12 @@ resource "hcloud_server" "manager" { hcloud_token_enabled : var.hcloud_token_enabled hcloud_token : var.hcloud_token hcloud_namespace : var.hcloud_namespace + thanos_enabled : var.thanos_enabled + thanos_namespace : var.thanos_namespace + s3_bucket_name : var.thanos_s3_bucket_name + aws_region_name : var.aws_region_name + aws_access_key : var.aws_access_key + aws_secret_key : var.aws_secret_key })) argocd_ha_values : base64encode(file("${path.module}/templates/helm/argocd-values-ha.yaml")) argocd_values : base64encode(file("${path.module}/templates/helm/argocd-values.yaml")) diff --git a/terraform/modules/k8s-cluster/templates/helm/cluster-setup-values.yaml b/terraform/modules/k8s-cluster/templates/helm/cluster-setup-values.yaml index b4317a4..6bfcd2b 100644 --- a/terraform/modules/k8s-cluster/templates/helm/cluster-setup-values.yaml +++ b/terraform/modules/k8s-cluster/templates/helm/cluster-setup-values.yaml @@ -10,3 +10,10 @@ hcloud: enabled: ${hcloud_token_enabled} token: ${hcloud_token} namespace: {$hcloud_namespace} +thanos: + enabled: ${thanos_enabled} + namespace: ${thanos_namespace} + bucketName: ${s3_bucket_name} + awsRegion: ${aws_region_name} + accessKey: ${aws_access_key} + secretKey: ${aws_secret_key} diff --git a/terraform/modules/k8s-cluster/variables.tf b/terraform/modules/k8s-cluster/variables.tf index f4f7ad7..9740a26 100644 --- a/terraform/modules/k8s-cluster/variables.tf +++ b/terraform/modules/k8s-cluster/variables.tf @@ -172,4 +172,37 @@ variable "hcloud_namespace" { description = "Namespace in which the hcloud token will be created" type = string default = "hcloud" +} + +variable "thanos_enabled" { + description = "If true, a namespace configured by thanos_namespace will be created and thanos object store config with provided access key and secret key will be created" + type = bool + default = false +} +variable "thanos_namespace" { + description = "Namespace for thanos sidecar in Prometheus" + type = string + default = "observability" +} +variable "thanos_s3_bucket_name" { + description = "Name of the S3 bucket to store data from thanos in. If thanos is enabled, it must be overriden and filled." + type = string + default = "" +} +variable "aws_region_name" { + description = "AWS region in which the bucket resides." + type = string + default = "eu-central-1" +} +variable "aws_access_key" { + description = "AWS access key to retrieve/store data in the bucket. Must be filled if thanos is enabled." + type = string + default = "" + sensitive = true +} +variable "aws_secret_key" { + description = "AWS secret key to retrieve/store data in the bucket. Must be filled if thanos is enabled" + type = string + default = "" + sensitive = true } \ No newline at end of file