apiVersion: apps/v1
kind: Deployment
metadata:
  name: health-dashboard
  labels:
    app: health-dashboard
spec:
  selector:
    matchLabels:
      app: health-dashboard
  replicas: 1
  strategy:
    type: Recreate
  template:
    metadata:
      annotations:
        prometheus.io/scrape: 'true'
        prometheus.io/path: /__/metrics
        prometheus.io/port: '8081'
        health.dsb.dev/scrape: 'true'
      labels:
        app: health-dashboard
    spec:
      serviceAccountName: health-dashboard
      automountServiceAccountToken: true
      imagePullSecrets:
      - name: registry
      containers:
      - image: ghcr.io/davidsbond/homelab:latest
        imagePullPolicy: IfNotPresent
        name: health-dashboard
        command:
        - /bin/health-dashboard
        env:
        - name: TRACER_HOST
          valueFrom:
            configMapKeyRef:
              key: tracer.host
              name: tracing
        - name: MONITORING_DSN
          valueFrom:
            secretKeyRef:
              key: sentry.dsn
              name: sentry
        readinessProbe:
          httpGet:
            path: /__/health
            port: 8081
          initialDelaySeconds: 5
