apiVersion: apps/v1
kind: Deployment
metadata:
  name: grafana
  namespace: monitoring
spec:
  replicas: 1
  selector:
    matchLabels:
      k8s-app: grafana
  template:
    metadata:
      labels:
        k8s-app: grafana
    spec:
      containers:
        - name: grafana
          image: grafana/grafana
          ports:
            - containerPort: 3000
              protocol: TCP
          volumeMounts:
            - mountPath: /var/lib/grafana
              name: grafana-storage
          env:
            - name: GF_SERVER_HTTP_PORT
              value: "3000"
            - name: GF_SECURITY_ADMIN_PASSWORD
              value: "helloworld"
            - name: GF_INSTALL_PLUGINS
              value: "grafana-kubernetes-app"
      volumes:
        - name: grafana-storage
          emptyDir: {}