grafana.yaml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. ---
  2. apiVersion: v1
  3. kind: PersistentVolumeClaim
  4. metadata:
  5. name: grafana-pvc
  6. spec:
  7. accessModes:
  8. - ReadWriteOnce
  9. resources:
  10. requests:
  11. storage: 20Gi
  12. ---
  13. apiVersion: apps/v1
  14. kind: Deployment
  15. metadata:
  16. labels:
  17. app: grafana
  18. name: grafana
  19. spec:
  20. selector:
  21. matchLabels:
  22. app: grafana
  23. template:
  24. metadata:
  25. labels:
  26. app: grafana
  27. spec:
  28. securityContext:
  29. fsGroup: 472
  30. supplementalGroups:
  31. - 0
  32. containers:
  33. - name: grafana
  34. image: grafana/grafana:latest
  35. imagePullPolicy: IfNotPresent
  36. ports:
  37. - containerPort: 3000
  38. name: http-grafana
  39. protocol: TCP
  40. readinessProbe:
  41. failureThreshold: 3
  42. httpGet:
  43. path: /robots.txt
  44. port: 3000
  45. scheme: HTTP
  46. initialDelaySeconds: 10
  47. periodSeconds: 30
  48. successThreshold: 1
  49. timeoutSeconds: 2
  50. livenessProbe:
  51. failureThreshold: 3
  52. initialDelaySeconds: 30
  53. periodSeconds: 10
  54. successThreshold: 1
  55. tcpSocket:
  56. port: 3000
  57. timeoutSeconds: 1
  58. resources:
  59. requests:
  60. cpu: 250m
  61. memory: 750Mi
  62. volumeMounts:
  63. - mountPath: /var/lib/grafana
  64. name: grafana-pv
  65. volumes:
  66. - name: grafana-pv
  67. persistentVolumeClaim:
  68. claimName: grafana-pvc
  69. ---
  70. apiVersion: v1
  71. kind: Service
  72. metadata:
  73. name: grafana
  74. spec:
  75. ports:
  76. - port: 80
  77. protocol: TCP
  78. targetPort: http-grafana
  79. nodePort:
  80. selector:
  81. app: grafana
  82. sessionAffinity: None
  83. type: ClusterIP