apiVersion: apps/v1
kind: Deployment
metadata:
  name:  grafana
  labels:
    app:  grafana
spec:
  replicas: 3
  selector:
    matchLabels:
      app: grafana
  template:
    metadata:
      labels:
        app: grafana
    spec:
      securityContext:
        fsGroup: 472
        supplementalGroups:
          - 0
      containers:
      - name: grafana
        image: grafana
        resources:
          requests:
            memory: "10G"
            cpu: "2"
          limits:
            memory: "16G"
            cpu: "4"
        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
          successThreshold: 1
          tcpSocket:
            port: 3000
          timeoutSeconds: 10
        volumeMounts:
          - mountPath: /var/lib/grafana
            name: grafana-pvc
      volumes:
        - name: grafana-pvc
          persistentVolumeClaim:
            claimName: grafana-pvc-claim

