105 lines
2.2 KiB
YAML
105 lines
2.2 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
labels:
|
|
app: grafana
|
|
name: grafana
|
|
namespace: monitoring
|
|
spec:
|
|
selector:
|
|
matchLabels:
|
|
app: grafana
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: grafana
|
|
spec:
|
|
securityContext:
|
|
fsGroup: 472
|
|
supplementalGroups:
|
|
- 0
|
|
containers:
|
|
- name: grafana
|
|
image: grafana/grafana:latest
|
|
imagePullPolicy: Always
|
|
ports:
|
|
- containerPort: 3000
|
|
name: http-grafana
|
|
protocol: TCP
|
|
readinessProbe:
|
|
failureThreshold: 3
|
|
httpGet:
|
|
path: /robots.txt
|
|
port: 3000
|
|
scheme: HTTP
|
|
initialDelaySeconds: 10
|
|
periodSeconds: 30
|
|
successThreshold: 1
|
|
timeoutSeconds: 2
|
|
livenessProbe:
|
|
failureThreshold: 3
|
|
initialDelaySeconds: 30
|
|
periodSeconds: 10
|
|
successThreshold: 1
|
|
tcpSocket:
|
|
port: 3000
|
|
timeoutSeconds: 1
|
|
resources:
|
|
requests:
|
|
cpu: 250m
|
|
memory: 750Mi
|
|
volumeMounts:
|
|
- mountPath: /var/lib/grafana
|
|
name: grafana-pv
|
|
volumes:
|
|
- name: grafana-pv
|
|
persistentVolumeClaim:
|
|
claimName: grafana-pvc
|
|
---
|
|
apiVersion: v1
|
|
kind: PersistentVolumeClaim
|
|
metadata:
|
|
name: grafana-pvc
|
|
namespace: monitoring
|
|
annotations:
|
|
nfs.io/storage-path: "grafana-data"
|
|
spec:
|
|
storageClassName: "nfs-client"
|
|
accessModes:
|
|
- ReadWriteOnce
|
|
resources:
|
|
requests:
|
|
storage: 1Gi
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
namespace: monitoring
|
|
name: grafana
|
|
spec:
|
|
ports:
|
|
- port: 3000
|
|
protocol: TCP
|
|
targetPort: http-grafana
|
|
selector:
|
|
app: grafana
|
|
type: ClusterIP
|
|
---
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: Ingress
|
|
metadata:
|
|
namespace: monitoring
|
|
name: grafana
|
|
spec:
|
|
ingressClassName: nginx
|
|
rules:
|
|
- host: grafana.haven
|
|
http:
|
|
paths:
|
|
- path: /
|
|
pathType: Prefix
|
|
backend:
|
|
service:
|
|
name: grafana
|
|
port:
|
|
number: 3000 |