apiVersion: apps/v1
kind: Deployment
metadata:
  name: grafana
  namespace: monitoring
spec:
  replicas: 1
  selector:
    matchLabels:
      app: grafana
  template:
    metadata:
      name: grafana
      labels:
        app: grafana
    spec:
      containers:
        - name: grafana
          image: grafana/grafana:latest
          ports:
            - name: grafana
              containerPort: 3000
          volumeMounts:
            - mountPath: /var/lib/grafana
              name: grafana-storage
            - mountPath: /etc/grafana/provisioning/datasources
              name: grafana-datasources
              readOnly: false
          env:
            - name: GF_INSTALL_PLUGINS
              value: 'vonage-status-panel 1.0.10,grafana-kubernetes-app'
      volumes:
        - name: grafana-storage
          persistentVolumeClaim:
            claimName: pvc-nfs-grafana
        - name: grafana-datasources
          configMap:
            defaultMode: 420
            name: grafana-datasources
