Added grafana

This commit is contained in:
Pünkösd Marcell 2020-05-29 19:20:08 +02:00
parent f4ee736df4
commit 36a3b8abf7

84
grafana.yaml Normal file
View File

@ -0,0 +1,84 @@
apiVersion: v1
kind: Service
metadata:
name: grafana
namespace: birbnetes
spec:
type: NodePort
ports:
- name: grafana
port: 3000
targetPort: 3000
nodePort: 30070
protocol: TCP
selector:
app: grafana
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: grafana-nfs-pv
namespace: birbnetes
spec:
capacity:
storage: 10Gi
accessModes:
- ReadWriteMany
persistentVolumeReclaimPolicy: Recycle
nfs:
server: 192.168.100.1
path: /srv/kubedata/birbnetes/grafana
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: grafana-nfs-pvc
namespace: birbnetes
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
---
apiVersion: v1
kind: ConfigMap
metadata:
name: grafana
labels:
app: grafana
namespace: birbnetes
data:
GF_SERVER_ROOT_URL: https://luna.sch.bme.hu:30070/
--
apiVersion: apps/v1
kind: Deployment
metadata:
name: grafana
namespace: birbnetes
spec:
selector:
matchLabels:
app: grafana
strategy:
type: Recreate
template:
metadata:
labels:
app: grafana
spec:
volumes:
- name: data
persistentVolumeClaim:
claimName: grafana-nfs-pvc
containers:
- name: grafana
volumeMounts:
- name: data
mountPath: "/var/lib/grafana"
image: grafana/grafana
envFrom:
- configMapRef:
name: grafana
ports:
- containerPort: 3000