Skip to content

Commit

Permalink
feat(upgrade): upgrade charts and github actions and some minor impro…
Browse files Browse the repository at this point in the history
…vements
  • Loading branch information
Monska85 committed May 31, 2024
1 parent 01aeed1 commit b2c8bf8
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tflint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- uses: actions/checkout@v4
name: Checkout source code

- uses: actions/cache@v3
- uses: actions/cache@v4
name: Cache plugin dir
with:
path: ~/.tflint.d/plugins
Expand Down
15 changes: 14 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,24 @@

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [4.0.0] - 2024-05-31

[Compare with previous version](https://github.com/sparkfabrik/terraform-sparkfabrik-prometheus-stack/compare/3.0.0...4.0.0)

⚠️ **BREAKING CHANGES** ⚠️

In the previous version, if the `prometheus_adapter_chart_version` variable was set, the module enabled the Prometheus Adapter installation. **This behavior has been changed**. Now, to enable the Prometheus Adapter installation, you must set the `prometheus_adapter_enabled` variable to `true`. The `prometheus_adapter_chart_version` variable is now optional and is used if you want to specify a different chart version from the default one. Remember that the shipped chart values are specific to the default chart version.

### Added

- Add the default versions for `prometheus_stack_chart_version` and `prometheus_adapter_chart_version` variables. These values indicate the default chart version to use and the reference to the shipped chart values.
- Add the `prometheus_adapter_enabled` variable to enable or disable the Prometheus Adapter installation.

## [3.0.0] - 2023-11-30

[Compare with previous version](https://github.com/sparkfabrik/terraform-sparkfabrik-prometheus-stack/compare/2.1.0...3.0.0)
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,11 @@ moved {
| <a name="input_grafana_tls_secret_name"></a> [grafana\_tls\_secret\_name](#input\_grafana\_tls\_secret\_name) | TLS secret name. If the variable is left empty, the value will be filled by the module using default value. | `string` | `""` | no |
| <a name="input_namespace"></a> [namespace](#input\_namespace) | This is the namespace used to install kube-prometheus-stack. | `string` | `"kube-prometheus-stack"` | no |
| <a name="input_prometheus_adapter_additional_values"></a> [prometheus\_adapter\_additional\_values](#input\_prometheus\_adapter\_additional\_values) | Override values for prometheus-adapter release. If this variable is not an empy list, it will be merged with the other values. | `list(string)` | `[]` | no |
| <a name="input_prometheus_adapter_chart_version"></a> [prometheus\_adapter\_chart\_version](#input\_prometheus\_adapter\_chart\_version) | Chart version Prometheus Adapter. If the variable is left empty, the Prometheus Adapter Chart will not be installed. | `string` | `""` | no |
| <a name="input_prometheus_adapter_chart_version"></a> [prometheus\_adapter\_chart\_version](#input\_prometheus\_adapter\_chart\_version) | Chart version Prometheus Adapter. If the variable `prometheus_adapter_enabled` is set to `false`, the Prometheus Adapter Chart will not be installed. | `string` | `"4.10.0"` | no |
| <a name="input_prometheus_adapter_enabled"></a> [prometheus\_adapter\_enabled](#input\_prometheus\_adapter\_enabled) | If true, the Prometheus Adapter Chart will be installed. | `bool` | `false` | no |
| <a name="input_prometheus_stack_additional_values"></a> [prometheus\_stack\_additional\_values](#input\_prometheus\_stack\_additional\_values) | Override values for kube-prometheus-stack release. If this variable is not an empy list, it will be merged with the other values. | `list(string)` | `[]` | no |
| <a name="input_prometheus_stack_chart_version"></a> [prometheus\_stack\_chart\_version](#input\_prometheus\_stack\_chart\_version) | Chart version Prometheus-stack. | `string` | n/a | yes |
| <a name="input_regcred"></a> [regcred](#input\_regcred) | Name of the secret of the docker credentials. | `string` | n/a | yes |
| <a name="input_prometheus_stack_chart_version"></a> [prometheus\_stack\_chart\_version](#input\_prometheus\_stack\_chart\_version) | Chart version Prometheus-stack. You can change the version of the chart to install a different version of the chart, but the shipped values are created for the specified version. | `string` | `"59.0.0"` | no |
| <a name="input_regcred"></a> [regcred](#input\_regcred) | Name of the secret of the docker credentials. | `string` | `""` | no |

## Outputs

Expand Down
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ resource "helm_release" "kube_prometheus_stack" {
}

resource "helm_release" "prometheus_adapter" {
count = trimspace(var.prometheus_adapter_chart_version) != "" ? 1 : 0
count = var.prometheus_adapter_enabled ? 1 : 0

name = local.app_name_adapter
repository = "https://prometheus-community.github.io/helm-charts"
Expand Down
2 changes: 2 additions & 0 deletions values/kube-prometheus-stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ grafana:
%{~ if trimspace(grafana_ingress_class) != "" ~}
ingressClassName: ${grafana_ingress_class}
%{~ endif ~}
%{~ if trimspace(grafana_cluster_issuer_name) != "" ~ || if trimspace(grafana_ingress_basic_auth_username) != "" ~}
annotations:
%{~ if trimspace(grafana_cluster_issuer_name) != "" ~}
cert-manager.io/cluster-issuer: "${grafana_cluster_issuer_name}"
Expand All @@ -32,6 +33,7 @@ grafana:
nginx.ingress.kubernetes.io/auth-realm: "${grafana_ingress_basic_auth_message}"
nginx.ingress.kubernetes.io/auth-secret: "${grafana_ingress_basic_auth_secret}"
%{~ endif ~}
%{~ endif ~}
hosts:
- ${grafana_ingress_host}
%{~ if trimspace(grafana_cluster_issuer_name) != "" ~}
Expand Down
13 changes: 10 additions & 3 deletions variables.tf
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
variable "prometheus_stack_chart_version" {
type = string
description = "Chart version Prometheus-stack."
description = "Chart version Prometheus-stack. You can change the version of the chart to install a different version of the chart, but the shipped values are created for the specified version."
default = "59.0.0"
}

variable "prometheus_adapter_enabled" {
type = bool
description = "If true, the Prometheus Adapter Chart will be installed."
default = false
}
variable "prometheus_adapter_chart_version" {
type = string
description = "Chart version Prometheus Adapter. If the variable is left empty, the Prometheus Adapter Chart will not be installed."
default = ""
description = "Chart version Prometheus Adapter. If the variable `prometheus_adapter_enabled` is set to `false`, the Prometheus Adapter Chart will not be installed."
default = "4.10.0"
}

variable "create_namespace" {
Expand All @@ -24,6 +30,7 @@ variable "namespace" {
variable "regcred" {
type = string
description = "Name of the secret of the docker credentials."
default = ""
}

variable "grafana_ingress_host" {
Expand Down

0 comments on commit b2c8bf8

Please sign in to comment.