Skip to content

Commit 4cf83dd

Browse files
committed
add Grafana OKTA configurations
1 parent 2ff5ca6 commit 4cf83dd

File tree

3 files changed

+79
-9
lines changed

3 files changed

+79
-9
lines changed

main.tf

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ locals {
33
prometheus_image_repository = var.prometheus_image_repository
44
prometheus_image_tag = var.prometheus_image_tag
55

6-
grafana_image_repository = var.grafana_image_repository
7-
grafana_image_tag = var.grafana_image_tag
8-
grafana_admin_password = var.grafana_admin_password
6+
grafana_image_repository = var.grafana_image_repository
7+
grafana_image_tag = var.grafana_image_tag
8+
grafana_admin_password = var.grafana_admin_password
9+
grafana_okta_client_id = var.grafana_okta_client_id
10+
grafana_okta_client_secret = var.grafana_okta_client_secret
911

1012
prometheus_operator_image_repository = var.prometheus_operator_image_repository
1113
prometheus_operator_image_tag = var.prometheus_operator_image_tag

templates/values.yaml

Lines changed: 62 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@ grafana:
714714
ingress:
715715
## If true, Grafana Ingress will be created
716716
##
717-
enabled: false
717+
enabled: true
718718

719719
## IngressClassName for Grafana Ingress.
720720
## Should be provided if Ingress is enable.
@@ -736,7 +736,8 @@ grafana:
736736
##
737737
# hosts:
738738
# - grafana.domain.com
739-
hosts: []
739+
hosts:
740+
- bt-dev.grafana.platform.sphdigital.com
740741

741742
## Path for grafana ingress
742743
path: /
@@ -749,11 +750,65 @@ grafana:
749750
# hosts:
750751
# - grafana.example.com
751752

753+
grafana.ini:
754+
log:
755+
level: debug
756+
server:
757+
root_url: https://bt-dev.grafana.platform.sphdigital.com
758+
auth.okta:
759+
name: Okta
760+
icon: okta
761+
enabled: true
762+
allow_sign_up: true
763+
client_id: ${grafana_okta_client_id}
764+
client_secret: ${grafana_okta_client_secret}
765+
scopes: openid profile email groups
766+
auth_url: https://sphmedia.okta.com/oauth2/v1/authorize
767+
token_url: https://sphmedia.okta.com/oauth2/v1/token
768+
api_url: https://sphmedia.okta.com/oauth2/v1/userinfo
769+
# allowed_domains:
770+
# allowed_groups:
771+
# role_attribute_path:
772+
external_image_storage:
773+
provider: s3
774+
external_image_storage.s3:
775+
bucket: s3-slack-grafana
776+
region: ap-southeast-1
777+
smtp:
778+
enabled: true
779+
host: "email-smtp.us-west-2.amazonaws.com:465"
780+
user: "AKIAXJT7Y56UEV3IO4HS"
781+
password: EMAIL_AUTH_PASSWORD
782+
from_address: "noreply-grafana@sph.com.sg"
783+
from_name: "Grafana"
784+
785+
dashboardProviders:
786+
dashboardproviders.yaml:
787+
apiVersion: 1
788+
providers:
789+
- name: 'cloudwatch'
790+
orgId: 1
791+
folder: 'cloudwatch'
792+
type: file
793+
disableDeletion: true
794+
editable: false
795+
options:
796+
path: /var/lib/grafana/dashboards/cloudwatch
797+
- name: 'kubernetes'
798+
orgId: 1
799+
folder: 'kubernetes'
800+
type: file
801+
disableDeletion: true
802+
editable: false
803+
options:
804+
path: /var/lib/grafana/dashboards/kubernetes
805+
752806
sidecar:
753807
dashboards:
754808
enabled: true
755809
label: grafana_dashboard
756810
labelValue: "1"
811+
folder: /var/lib/grafana/dashboards
757812

758813
## Annotations for Grafana dashboard configmaps
759814
##
@@ -2034,7 +2089,7 @@ prometheus:
20342089
# someoneelse:$apr1$DMZX2Z4q$6SbQIfyuLQd.xmo/P0m2c.
20352090

20362091
ingress:
2037-
enabled: false
2092+
enabled: true
20382093

20392094
# For Kubernetes >= 1.18 you should specify the ingress-controller via the field ingressClassName
20402095
# See https://kubernetes.io/blog/2020/04/02/improvements-to-the-ingress-api-in-kubernetes-1.18/#specifying-the-class-of-an-ingress
@@ -2048,12 +2103,13 @@ prometheus:
20482103
##
20492104
# hosts:
20502105
# - prometheus.domain.com
2051-
hosts: []
2106+
hosts:
2107+
- bt-dev.prometheus.platform.sphdigital.com
20522108

20532109
## Paths to use for ingress rules - one path should match the prometheusSpec.routePrefix
20542110
##
2055-
paths: []
2056-
# - /
2111+
paths:
2112+
- /
20572113

20582114
## For Kubernetes >= 1.18 you should specify the pathType (determines how Ingress paths should be matched)
20592115
## See https://kubernetes.io/blog/2020/04/02/improvements-to-the-ingress-api-in-kubernetes-1.18/#better-path-matching-with-path-types

variables.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,18 @@ variable "grafana_admin_password" {
7474
sensitive = true
7575
}
7676

77+
variable "grafana_okta_client_id" {
78+
description = "OKTA Client ID for Grafana"
79+
type = string
80+
sensitive = true
81+
}
82+
83+
variable "grafana_okta_client_secret" {
84+
description = "OKTA Client Secret for Grafana"
85+
type = string
86+
sensitive = true
87+
}
88+
7789
variable "prometheus_operator_image_repository" {
7890
description = "Prometheus Operator Image repository"
7991
type = string

0 commit comments

Comments
 (0)