-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add SKS variant with needed configuration to use SOS
- Loading branch information
Showing
7 changed files
with
125 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
variable "cluster_id" { | ||
description = "ID of the SKS cluster." | ||
type = string | ||
} | ||
|
||
variable "logs_storage" { | ||
description = "Exoscale SOS bucket configuration values for the bucket where the logs will be stored." | ||
type = object({ | ||
bucket_name = string | ||
bucket_region = string | ||
access_key = string | ||
secret_access_key = string | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
locals { | ||
helm_values = [var.distributed_mode ? { | ||
loki-distributed = { | ||
global = { | ||
clusterDomain = "${var.cluster_id}.cluster.local" | ||
} | ||
loki = { | ||
schemaConfig = local.schema_config | ||
storageConfig = local.storage_config | ||
structuredConfig = { | ||
compactor = local.compactor | ||
} | ||
} | ||
} | ||
promtail = { | ||
tolerations = local.promtail_tolerations | ||
} | ||
} : null, var.distributed_mode ? null : { | ||
loki_stack = { | ||
loki = { | ||
config = { | ||
ingester = { | ||
lifecycler = { | ||
ring = { | ||
kvstore = { | ||
store = "memberlist" | ||
} | ||
replication_factor = 1 | ||
} | ||
final_sleep = "0s" | ||
} | ||
chunk_idle_period = "5m" | ||
chunk_retain_period = "30s" | ||
} | ||
schema_config = local.schema_config | ||
storage_config = local.storage_config | ||
compactor = local.compactor | ||
} | ||
} | ||
} | ||
}] | ||
|
||
schema_config = { | ||
configs = [{ | ||
from = "2020-10-24" | ||
store = "boltdb-shipper" | ||
object_store = "s3" | ||
schema = "v11" | ||
index = { | ||
prefix = "index_" | ||
period = "24h" | ||
} | ||
}] | ||
} | ||
|
||
storage_config = { | ||
aws = { | ||
bucketnames = "${var.logs_storage.bucket_name}" | ||
region = "${var.logs_storage.bucket_region}" | ||
endpoint = "sos-${var.logs_storage.bucket_region}.exo.io" | ||
access_key_id = "${var.logs_storage.access_key}" | ||
secret_access_key = "${var.logs_storage.secret_access_key}" | ||
s3forcepathstyle = true | ||
} | ||
boltdb_shipper = { | ||
shared_store = "s3" | ||
} | ||
} | ||
|
||
compactor = { | ||
working_directory = "/data/compactor" | ||
shared_store = "s3" | ||
} | ||
|
||
promtail_tolerations = [ | ||
{ | ||
key = "nodepool" | ||
operator = "Equal" | ||
value = "router" | ||
effect = "NoSchedule" | ||
}, | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module "loki-stack" { | ||
source = "../" | ||
|
||
argocd_namespace = var.argocd_namespace | ||
target_revision = var.target_revision | ||
namespace = var.namespace | ||
app_autosync = var.app_autosync | ||
dependency_ids = var.dependency_ids | ||
|
||
distributed_mode = var.distributed_mode | ||
ingress = var.ingress | ||
enable_filebeat = var.enable_filebeat | ||
|
||
helm_values = concat(local.helm_values, var.helm_values) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
output "id" { | ||
description = "ID to pass other modules in order to refer to this module as a dependency." | ||
value = module.loki-stack.id | ||
} | ||
|
||
output "loki_credentials" { | ||
description = "Credentials to access the Loki ingress, if activated." | ||
value = module.loki-stack.loki_credentials | ||
sensitive = true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../terraform.tf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../variables.tf |