Skip to content

Commit

Permalink
feat: update grafana to ha mode by migrate to pg
Browse files Browse the repository at this point in the history
  • Loading branch information
incubator4 committed Oct 21, 2023
1 parent db85bb6 commit f930df9
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 5 deletions.
13 changes: 13 additions & 0 deletions grafana/prod/alert-svc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: grafana-alerting
namespace: guardian
spec:
type: ClusterIP
clusterIP: 'None'
ports:
- port: 9094
selector:
app.kubernetes.io/instance: grafana
app.kubernetes.io/name: grafana
22 changes: 17 additions & 5 deletions grafana/prod/values.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
resources:
limits:
cpu: 300m
memory: 300Mi
cpu: 500m
memory: 512Mi
requests:
cpu: 100m
memory: 128Mi
memory: 256Mi
replicas: 3
nodeSelector:
rss3.io/usage: internal
tolerations:
Expand All @@ -14,8 +15,8 @@ tolerations:
effect: "NoSchedule"
persistence:
type: pvc
enabled: true
storageClassName: alicloud-disk-essd
enabled: false
storageClassName: alicloud-disk-ssd
size: 20Gi
admin:
existingSecret: "grafana-secrets"
Expand All @@ -29,6 +30,11 @@ grafana.ini:
domain: grafana.nsl.xyz
root_url: "https://%(domain)s"
serve_from_sub_path: false
database:
type: postgres
host: pgm-7go76ijtdor158l6195200.pg.rds.aliyuncs.com
user: grafana
name: grafana
auth.generic_oauth:
enabled: true
name: Natural Selection Labs
Expand All @@ -42,6 +48,12 @@ grafana.ini:
api_url: https://account.nsl.xyz/auth/realms/google/protocol/openid-connect/userinfo
signout_redirect_url: https://account.nsl.xyz/auth/realms/google/protocol/openid-connect/logout?redirect_uri=https%3A%2F%2grafana.nsl.xyz%2Flogin
role_attribute_path: contains(roles[*], 'admin') && 'Admin' || contains(roles[*], 'editor') && 'Editor' || 'Viewer'
unified_alerting:
enabled: true
ha_listen_address: "${POD_IP}:9094"
ha_peers: "grafana-alerting.guardian:9094"
ha_advertise_address: "${POD_IP}:9094"
ha_peer_timeout: 15s
# auth.google:
# enabled: true
# auto_login: false
Expand Down

0 comments on commit f930df9

Please sign in to comment.