Skip to content

Commit

Permalink
Better password management
Browse files Browse the repository at this point in the history
  • Loading branch information
gitkvark committed Dec 22, 2023
1 parent 86b7f64 commit cee9bd9
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 1 deletion.
3 changes: 3 additions & 0 deletions docs/documentation/monitoring.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Monitoring

##
1 change: 1 addition & 0 deletions terraform/deployments/preprod/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module "releases" {
source = "../releases"
s3_backup_aws_access_key_id = var.s3_backup_aws_access_key_id
s3_backup_aws_secret_access_key = var.s3_backup_aws_secret_access_key
grafana_admin_password = var.grafana_admin_password
}

module "environment_specific_releases" {
Expand Down
3 changes: 3 additions & 0 deletions terraform/deployments/preprod/terraform.tfvars.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@ AWS_SECRET_ACCESS_KEY = aws_key
TF_VAR_s3_backup_aws_access_key_id = s3_backup_aws_access_key_id
TF_VAR_s3_backup_aws_secret_access_key = s3_backup_aws_secret_access_key

# Password for the grafana interface
TF_VAR_grafana_admin_password = [adminPassword]

# These values need to be set as enviromental secrets in Terraform Cloud.
6 changes: 6 additions & 0 deletions terraform/deployments/preprod/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,9 @@ variable "s3_backup_aws_secret_access_key" {
type = string
sensitive = true
}

variable "grafana_admin_password" {
description = "Password for the admin user of Grafana"
type = string
sensitive = true
}
4 changes: 4 additions & 0 deletions terraform/deployments/releases/kube-prometheus-stack.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ resource "helm_release" "kube-prom-stack" {
namespace = "monitoring"
create_namespace = true
version = "55.1.0"
set {
name = "grafana.adminPassword"
value = var.grafana_admin_password
}
values = [
file("${path.module}/kube-prometheus-stack/kube-prometheus-stack-values.yaml")
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ alertmanager:
enabled: true
grafana:
enabled: true
adminPassword: prom-operator
persistence:
enabled: true
storageClassName: ebs-sc
Expand All @@ -24,3 +23,5 @@ prometheus:
resources:
requests:
storage: 5Gi
# Full reference:
# https://github.com/prometheus-community/helm-charts/blob/main/charts/kube-prometheus-stack/values.yaml
6 changes: 6 additions & 0 deletions terraform/deployments/releases/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,9 @@ variable "s3_backup_aws_secret_access_key" {
type = string
sensitive = true
}

variable "grafana_admin_password" {
description = "Password for the admin user of Grafana"
type = string
sensitive = true
}

0 comments on commit cee9bd9

Please sign in to comment.