apiVersion: apps/v1
kind: Deployment
metadata:
  name: jmeter-grafana
  labels:
    app: jmeter-grafana
spec:
  replicas: 1
  selector:
    matchLabels:
      app: jmeter-grafana
  template:
    metadata:
      labels:
        app: jmeter-grafana
    spec:
      containers:
        - name: grafana
          image: grafana/grafana:8.2.1
          imagePullPolicy: IfNotPresent
          ports:
            - containerPort: 3000
              protocol: TCP
          env:
            - name: GF_AUTH_BASIC_ENABLED
              value: "true"
            - name: GF_USERS_ALLOW_ORG_CREATE
              value: "true"
            - name: GF_AUTH_ANONYMOUS_ENABLED
              value: "true"
            - name: GF_AUTH_ANONYMOUS_ORG_ROLE
              value: Admin
            - name: GF_SERVER_ROOT_URL
              # If you're only using the API Server proxy, set this value instead:
              # value: /api/v1/namespaces/kube-system/services/monitoring-grafana/proxy
              value: /
          volumeMounts:
            - mountPath: /etc/grafana/provisioning/datasources/ds_influxdb.yaml
              name: jmeter-grafana
              subPath: ds_influxdb.yaml
            - mountPath: /etc/grafana/provisioning/dashboards/dashboard.yaml
              name: jmeter-grafana
              subPath: dashboard.yaml
            - mountPath: /etc/grafana/dashboards
              name: jmeter-dashboards
      volumes:
        - name: jmeter-grafana
          configMap:
            name: jmeter-grafana
        - name: jmeter-dashboards
          configMap:
            name: jmeter-dashboards

              
