Skip to content

Commit

Permalink
feat(loki-stack)!: deprecate and remove the loki-stack chart (#95)
Browse files Browse the repository at this point in the history
* feat(loki-stack)!: deprecate and remove the loki-stack chart

* docs(terraform-docs): generate docs and write to README.adoc

---------

Co-authored-by: lentidas <lentidas@users.noreply.github.com>
  • Loading branch information
lentidas and lentidas authored Sep 8, 2023
1 parent 4a77cec commit fd4a0f4
Show file tree
Hide file tree
Showing 22 changed files with 298 additions and 693 deletions.
22 changes: 4 additions & 18 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Description: Override of target revision of the application chart.

Type: `string`

Default: `"v4.0.1"`
Default: `"v4.0.2"`

==== [[input_namespace]] <<input_namespace,namespace>>

Expand Down Expand Up @@ -112,14 +112,6 @@ Type: `map(string)`

Default: `{}`

==== [[input_distributed_mode]] <<input_distributed_mode,distributed_mode>>

Description: Boolean to activate Loki in distributed mode.

Type: `bool`

Default: `false`

==== [[input_ingress]] <<input_ingress,ingress>>

Description: Loki frontend ingress configuration.
Expand All @@ -146,7 +138,7 @@ Default: `false`

==== [[input_retention]] <<input_retention,retention>>

Description: Logs retention period.To deactivate retention, pass 0s.
Description: Logs retention period. To deactivate retention, pass 0s.

Type: `string`

Expand Down Expand Up @@ -217,7 +209,7 @@ Description: Credentials to access the Loki ingress, if activated.
|[[input_target_revision]] <<input_target_revision,target_revision>>
|Override of target revision of the application chart.
|`string`
|`"v4.0.1"`
|`"v4.0.2"`
|no

|[[input_namespace]] <<input_namespace,namespace>>
Expand Down Expand Up @@ -264,12 +256,6 @@ object({
|`{}`
|no

|[[input_distributed_mode]] <<input_distributed_mode,distributed_mode>>
|Boolean to activate Loki in distributed mode.
|`bool`
|`false`
|no

|[[input_ingress]] <<input_ingress,ingress>>
|Loki frontend ingress configuration.
|
Expand All @@ -293,7 +279,7 @@ object({
|no

|[[input_retention]] <<input_retention,retention>>
|Logs retention period.To deactivate retention, pass 0s.
|Logs retention period. To deactivate retention, pass 0s.
|`string`
|`"30d"`
|no
Expand Down
22 changes: 4 additions & 18 deletions aks/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Description: Override of target revision of the application chart.

Type: `string`

Default: `"v4.0.1"`
Default: `"v4.0.2"`

==== [[input_namespace]] <<input_namespace,namespace>>

Expand Down Expand Up @@ -127,14 +127,6 @@ Type: `map(string)`

Default: `{}`

==== [[input_distributed_mode]] <<input_distributed_mode,distributed_mode>>

Description: Boolean to activate Loki in distributed mode.

Type: `bool`

Default: `false`

==== [[input_ingress]] <<input_ingress,ingress>>

Description: Loki frontend ingress configuration.
Expand All @@ -161,7 +153,7 @@ Default: `false`

==== [[input_retention]] <<input_retention,retention>>

Description: Logs retention period.To deactivate retention, pass 0s.
Description: Logs retention period. To deactivate retention, pass 0s.

Type: `string`

Expand Down Expand Up @@ -252,7 +244,7 @@ object({
|[[input_target_revision]] <<input_target_revision,target_revision>>
|Override of target revision of the application chart.
|`string`
|`"v4.0.1"`
|`"v4.0.2"`
|no

|[[input_namespace]] <<input_namespace,namespace>>
Expand Down Expand Up @@ -299,12 +291,6 @@ object({
|`{}`
|no

|[[input_distributed_mode]] <<input_distributed_mode,distributed_mode>>
|Boolean to activate Loki in distributed mode.
|`bool`
|`false`
|no

|[[input_ingress]] <<input_ingress,ingress>>
|Loki frontend ingress configuration.
|
Expand All @@ -328,7 +314,7 @@ object({
|no

|[[input_retention]] <<input_retention,retention>>
|Logs retention period.To deactivate retention, pass 0s.
|Logs retention period. To deactivate retention, pass 0s.
|`string`
|`"30d"`
|no
Expand Down
98 changes: 36 additions & 62 deletions aks/locals.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
locals {
use_managed_identity = var.logs_storage.managed_identity_node_rg_name != null

helm_values = [var.distributed_mode ? {
helm_values = [{
loki-distributed = merge(local.use_managed_identity ? {
serviceAccount = {
annotations = {
Expand All @@ -19,8 +19,40 @@ locals {
"azure.workload.identity/use" = "true"
}
} : null, {
schemaConfig = local.schema_config
storageConfig = local.storage_config
schemaConfig = {
configs = [
{
from = "2020-12-22"
store = "boltdb-shipper"
object_store = "azure"
schema = "v11"
index = {
prefix = "index_"
period = "24h"
}
}
]

}
storageConfig = {
azure = merge(local.use_managed_identity ? null : {
account_key = var.logs_storage.storage_account_key
}, local.use_managed_identity ? {
use_federated_token = true
} : null,
{
container_name = var.logs_storage.container
account_name = var.logs_storage.storage_account
request_timeout = "180s"
max_retries = 50
min_retry_delay = "1s"
max_retry_delay = "5s"
})
boltdb_shipper = {
shared_store = "azure"
}

}
structuredConfig = {
compactor = {
shared_store = "azure"
Expand All @@ -29,63 +61,5 @@ locals {
}
})
})
} : null, var.distributed_mode ? null : {
loki-stack = {
loki = merge(local.use_managed_identity ? {
# Current chart version uses loki 2.6.1.
# TODO remove once chart uses a version >= 2.8.
image = {
tag = "2.8.0"
}
serviceAccount = {
annotations = {
"azure.workload.identity/client-id" = azurerm_user_assigned_identity.loki[0].client_id
}
}
podLabels = {
"azure.workload.identity/use" = "true"
}
} : null, {
config = {
schema_config = local.schema_config
storage_config = local.storage_config
}
})
}
}
]

schema_config = {
configs = [
{
from = "2020-12-22"
store = "boltdb-shipper"
object_store = "azure"
schema = "v11"
index = {
prefix = "index_"
period = "24h"
}
}
]
}

storage_config = {
azure = merge(local.use_managed_identity ? null : {
account_key = var.logs_storage.storage_account_key
}, local.use_managed_identity ? {
use_federated_token = true
} : null,
{
container_name = var.logs_storage.container
account_name = var.logs_storage.storage_account
request_timeout = "180s"
max_retries = 50
min_retry_delay = "1s"
max_retry_delay = "5s"
})
boltdb_shipper = {
shared_store = "azure"
}
}
}]
}
7 changes: 3 additions & 4 deletions aks/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,9 @@ module "loki-stack" {
app_autosync = var.app_autosync
dependency_ids = var.dependency_ids

retention = var.retention
distributed_mode = var.distributed_mode
ingress = var.ingress
enable_filebeat = var.enable_filebeat
retention = var.retention
ingress = var.ingress
enable_filebeat = var.enable_filebeat

helm_values = concat(local.helm_values, var.helm_values)
}
6 changes: 0 additions & 6 deletions charts/loki-stack/Chart.lock

This file was deleted.

11 changes: 0 additions & 11 deletions charts/loki-stack/Chart.yaml

This file was deleted.

Binary file removed charts/loki-stack/charts/loki-stack-2.8.9.tgz
Binary file not shown.
121 changes: 0 additions & 121 deletions charts/loki-stack/templates/event_handler.yaml

This file was deleted.

Loading

0 comments on commit fd4a0f4

Please sign in to comment.