kind: StatefulSet
apiVersion: apps/v1
metadata:
  name: grafana
  namespace: prometheus
  labels:
    name: grafana
spec:
  serviceName: grafana
  replicas: 1
  selector:
    matchLabels:
      name: grafana
  template:
    metadata:
      labels:
        name: grafana
    spec:
      imagePullSecrets:
        - name: qcloudregistry
      containers:
        - name: grafana
          image: harbor.freedom.org/grafana/grafana:7.3.6
          env:
            - name: TZ
              value: Asia/Shanghai
          resources:
            requests:
              memory: 256M
              cpu: 200m
            limits:
              memory: 4096M
              cpu: 2000m
          ports:
            - containerPort: 3000
          volumeMounts:
            - name: grafana-data
              mountPath: /var/lib/grafana
  volumeClaimTemplates:
    - metadata:
        name: grafana-data
        annotations:
          volume.beta.kubernetes.io/storage-class: storageclass-nfs-infra
      spec:
        accessModes: ["ReadWriteOnce"]
        resources:
          requests:
            storage: 50Gi