Skip to content

Commit

Permalink
Add grafana
Browse files Browse the repository at this point in the history
  • Loading branch information
jveski committed Feb 11, 2024
1 parent 9b43d59 commit 5e4bd9a
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 0 deletions.
16 changes: 16 additions & 0 deletions configs/grafana.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[server]
root_url = "https://grafana.apps.thelab.ms"

[users]
auto_assign_org_role = "Owner"
allow_sign_up = false
auto_assign_org = true

[auth]
oauth_auto_login = true

[auth.proxy]
header_property = "email"
header_name = "X-Forwarded-Email"
enabled = true
auto_sign_up = true
9 changes: 9 additions & 0 deletions kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ images:
newName: ghcr.io/blakeblackshear/frigate
newTag: "0.12.1"

- name: grafana
newName: docker.io/grafana/grafana-oss
newTag: "10.0.0"

- name: keycloak
newName: ghcr.io/thelab-ms/keycloak-extensions
newTag: main-ce5b2d5
Expand Down Expand Up @@ -43,6 +47,7 @@ resources:
- manifests/access-controller-controller.yaml
- manifests/docuseal.yaml
- manifests/frigate.yaml
- manifests/grafana.yaml
- manifests/keycloak.yaml
- manifests/nvidia.ext.yaml
- manifests/profile-staging.yaml
Expand All @@ -66,3 +71,7 @@ configMapGenerator:
- name: frigate-config
files:
- configs/frigate.yml

- name: grafana-config
files:
- configs/grafana.ini
67 changes: 67 additions & 0 deletions manifests/grafana.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: grafana
labels:
app: grafana
annotations:
oauth-sidecar: "yes"
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
app: grafana
template:
metadata:
labels:
app: grafana
spec:
containers:
- name: oauth2proxy
env:
- name: OAUTH2_PROXY_UPSTREAMS
value: "http://127.0.0.1:3000"
- name: OAUTH2_PROXY_REDIRECT_URL
value: "https://grafana.apps.thelab.ms/oauth2/callback"
- name: OAUTH2_PROXY_ALLOWED_GROUPS
value: "thelab-leadership"

- name: grafana
image: grafana
volumeMounts:
- name: data
mountPath: /var/lib/grafana
- name: config
mountPath: /etc/grafana
readinessProbe:
initialDelaySeconds: 2
periodSeconds: 5
httpGet:
path: /healthz
port: 3000

volumes:
- name: data
hostPath:
path: /opt/grafana
- name: config
configMap:
name: grafana-config

---

apiVersion: v1
kind: Service
metadata:
name: grafana
spec:
type: ClusterIP
selector:
app: grafana
ports:
- name: http
protocol: TCP
port: 80
targetPort: 8880

0 comments on commit 5e4bd9a

Please sign in to comment.