Skip to content

Commit

Permalink
feat: add a variabele promtail_version
Browse files Browse the repository at this point in the history
  • Loading branch information
wondertalik committed May 16, 2023
1 parent 6ab5d70 commit bea0513
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 4 deletions.
9 changes: 8 additions & 1 deletion 05-install-charts.tf
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,9 @@ resource "null_resource" "promtail" {
depends_on = [
null_resource.init_masters
]
triggers = {
promtail_version = var.promtail_version
}
count = var.promtail_enabled ? 1 : 0

connection {
Expand All @@ -277,14 +280,18 @@ resource "null_resource" "promtail" {
inline = ["mkdir -p charts"]
}

provisioner "remote-exec" {
inline = ["rm -rf charts/promtail"]
}

provisioner "file" {
source = "charts/promtail"
destination = "charts"
}

provisioner "remote-exec" {
inline = [
"PROMTAIL_INSTALL=${var.promtail_install} bash charts/promtail/install.sh"
"PROMTAIL_VERSION=${var.promtail_version} PROMTAIL_INSTALL=${var.promtail_install} bash charts/promtail/install.sh"
]
}
}
Expand Down
1 change: 1 addition & 0 deletions charts/promtail/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ set -eux

if [[ $PROMTAIL_INSTALL == true ]]
then
echo "PROMTAIL_VERSION: $PROMTAIL_VERSION"
helm upgrade --install promtail charts/promtail/src/promtail -f charts/promtail/values.yaml --namespace monitoring --create-namespace
fi
4 changes: 2 additions & 2 deletions charts/promtail/src/promtail/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
appVersion: 2.7.4
appVersion: 2.8.2
description: Promtail is an agent which ships the contents of local logs to a Loki
instance
home: https://grafana.com/loki
Expand All @@ -14,4 +14,4 @@ sources:
- https://grafana.com/oss/loki/
- https://grafana.com/docs/loki/latest/
type: application
version: 6.11.1
version: 6.11.2
2 changes: 1 addition & 1 deletion charts/promtail/src/promtail/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# promtail

![Version: 6.11.1](https://img.shields.io/badge/Version-6.11.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.7.4](https://img.shields.io/badge/AppVersion-2.7.4-informational?style=flat-square)
![Version: 6.11.2](https://img.shields.io/badge/Version-6.11.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.8.2](https://img.shields.io/badge/AppVersion-2.8.2-informational?style=flat-square)

Promtail is an agent which ships the contents of local logs to a Loki instance

Expand Down
4 changes: 4 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,7 @@ output "kube_prometheus_stack_version" {
output "cert_manager_version" {
value = [var.cert_manager_version]
}

output "promtail_version" {
value = [var.promtail_version]
}
4 changes: 4 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -218,3 +218,7 @@ variable "promtail_install" {
type = bool
default = true
}

variable "promtail_version" {
default = "6.1.2"
}

0 comments on commit bea0513

Please sign in to comment.