apiVersion: apps/v1
kind: Deployment
metadata:
  name: grafana
  labels:
    name: grafana
spec:
  replicas: 1
  selector:
    matchLabels:
      name: grafana
  template:
    metadata:
      labels:
        name: grafana
    spec:
      serviceAccountName: grafana
      containers:
        - name: grafana
          image: grafana/grafana:8.1.2
          ports:
            - name: http
              containerPort: 3000
          readinessProbe:
            httpGet:
              path: /api/health
              port: http
            initialDelaySeconds: 30
            periodSeconds: 5
          livenessProbe:
            httpGet:
              path: /api/health
              port: http
            initialDelaySeconds: 35
            periodSeconds: 30
          resources:
            limits:
              cpu: 100m
              memory: 100Mi
            requests:
              cpu: 50m
              memory: 50Mi
      securityContext:
        runAsNonRoot: true
        runAsUser: 65534
      nodeSelector:
        beta.kubernetes.io/os: linux
