Skip to content

Commit 0180638

Browse files
Add variable for prometheus service account
1 parent cc37cbf commit 0180638

File tree

5 files changed

+23
-5
lines changed

5 files changed

+23
-5
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ No modules.
124124
| <a name="input_prometheus_ingress_tls"></a> [prometheus\_ingress\_tls](#input\_prometheus\_ingress\_tls) | TLS configuration for ingress | `list(any)` | `[]` | no |
125125
| <a name="input_prometheus_operator_image_repository"></a> [prometheus\_operator\_image\_repository](#input\_prometheus\_operator\_image\_repository) | Prometheus Operator Image repository | `string` | `"quay.io/prometheus-operator/prometheus-operator"` | no |
126126
| <a name="input_prometheus_operator_image_tag"></a> [prometheus\_operator\_image\_tag](#input\_prometheus\_operator\_image\_tag) | Prometheus Operator Image Tag | `string` | `"v0.57.0"` | no |
127+
| <a name="input_prometheus_service_account"></a> [prometheus\_service\_account](#input\_prometheus\_service\_account) | Name of the Service Account for Grafana | `string` | `""` | no |
128+
| <a name="input_prometheus_service_account_annotations"></a> [prometheus\_service\_account\_annotations](#input\_prometheus\_service\_account\_annotations) | Annotations for service account | `map(any)` | `{}` | no |
127129
| <a name="input_promethues_operator_nodeSelector"></a> [promethues\_operator\_nodeSelector](#input\_promethues\_operator\_nodeSelector) | Promethues Operator node selector | `any` | `""` | no |
128130
| <a name="input_recreate_pods"></a> [recreate\_pods](#input\_recreate\_pods) | Recreate the pods with every helm update | `bool` | `false` | no |
129131
| <a name="input_release_name"></a> [release\_name](#input\_release\_name) | Helm release name | `string` | `"kube-prometheus-stack"` | no |

example/.gitkeep

Whitespace-only changes.

locals.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ locals {
44
prometheus_image_tag = var.prometheus_image_tag
55
prometheus_host_url = var.prometheus_host_url
66

7+
prometheus_service_account = var.prometheus_service_account
8+
prometheus_service_account_annotations = jsonencode(var.prometheus_service_account_annotations)
9+
710
prometheus_ingress_enabled = var.prometheus_ingress_enabled
811
prometheus_ingress_annotations = jsonencode(var.prometheus_ingress_annotations)
912
prometheus_ingress_labels = jsonencode(var.prometheus_ingress_labels)

templates/values.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2350,8 +2350,9 @@ prometheus:
23502350
##
23512351
serviceAccount:
23522352
create: true
2353-
name: ""
2354-
annotations: {}
2353+
name: ${prometheus_service_account}
2354+
annotations: ${prometheus_service_account_annotations}
2355+
autoMount: true
23552356

23562357
# Service for thanos service discovery on sidecar
23572358
# Enable this can make Thanos Query can use

variables.tf

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ variable "recreate_pods" {
5656
default = false
5757
}
5858

59-
########################
60-
# Chart Values
61-
########################
59+
###############################
60+
### Prometheus Chart Values ###
61+
###############################
6262

6363
variable "prometheus_image_repository" {
6464
description = "Prometheus Image repository"
@@ -78,6 +78,18 @@ variable "prometheus_host_url" {
7878
default = ""
7979
}
8080

81+
variable "prometheus_service_account" {
82+
description = "Name of the Service Account for Grafana"
83+
type = string
84+
default = ""
85+
}
86+
87+
variable "prometheus_service_account_annotations" {
88+
description = "Annotations for service account"
89+
type = map(any)
90+
default = {}
91+
}
92+
8193
### prometheus Ingress ###
8294
variable "prometheus_ingress_enabled" {
8395
description = "Enable Ingress"

0 commit comments

Comments
 (0)