apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    description: Metrics/monitoring dashboards and alerts.
  labels:
    deploy: sourcegraph
  name: grafana
spec:
  minReadySeconds: 10
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app: grafana
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: grafana
    spec:
      containers:
      - image: index.docker.io/sourcegraph/grafana:10.0.3@sha256:4a5a6ca6e2b54d2c7d74132457f4c1ddc121890fa9003ff6cf7d774fdf0a1fa0
        terminationMessagePolicy: FallbackToLogsOnError
        name: grafana
        ports:
        - containerPort: 3370
          name: http
        volumeMounts:
        - mountPath: /var/lib/grafana
          name: data
        - mountPath: /sg_config_grafana/provisioning/datasources
          name: config
        resources:
          limits:
            cpu: 100m
            memory: 100Mi
          requests:
            cpu: 100m
            memory: 100Mi
      serviceAccountName: grafana
      securityContext:
        runAsUser: 0
      volumes:
      - name: data
        persistentVolumeClaim:
          claimName: grafana
      - configMap:
          defaultMode: 0777
          name: grafana
        name: config
