fullnameOverride: monitoring-stack

# ========================
# CRDs
# ========================
# CRDs are managed separately by the prometheus-operator-crds ArgoCD application
# to avoid the "metadata.annotations: Too long" error when Helm manages them
crds:
  enabled: false

# ========================
# PROMETHEUS
# ========================
prometheus:
  ingress:
    enabled: true
    ingressClassName: traefik
    hosts:
      - prometheus.dvirlabs.com
    paths:
      - /
    pathType: Prefix
    annotations:
      traefik.ingress.kubernetes.io/router.entrypoints: websecure
      traefik.ingress.kubernetes.io/router.tls: "true"

  prometheusSpec:
    replicas: 1
    retention: 10d
    externalUrl: https://prometheus.dvirlabs.com
    routePrefix: /

    storageSpec:
      volumeClaimTemplate:
        spec:
          storageClassName: nfs-client
          accessModes: ["ReadWriteOnce"]
          resources:
            requests:
              storage: 50Gi

    enableAdminAPI: true

    additionalScrapeConfigs:
      - job_name: pushgateway
        honor_labels: true
        static_configs:
          - targets:
              - pushgateway.observability-stack.svc.cluster.local:9091
      - job_name: nas-node-exporter
        static_configs:
          - targets:
              - 192.168.10.155:9100
        metrics_path: /metrics

# ========================
# GRAFANA
# ========================
grafana:
  enabled: true

  adminUser: admin
  adminPassword: admin123

  persistence:
    enabled: true
    storageClassName: nfs-client
    accessModes: ["ReadWriteOnce"]
    size: 5Gi

  ingress:
    enabled: true
    ingressClassName: traefik
    hosts:
      - grafana.dvirlabs.com
    path: /
    annotations:
      traefik.ingress.kubernetes.io/router.entrypoints: websecure
      traefik.ingress.kubernetes.io/router.tls: "true"

# ========================
# ALERTMANAGER
# ========================
alertmanager:
  enabled: true

  ingress:
    enabled: true
    ingressClassName: traefik
    hosts:
      - alertmanager.dvirlabs.com
    paths:
      - /
    pathType: Prefix
    annotations:
      traefik.ingress.kubernetes.io/router.entrypoints: websecure
      traefik.ingress.kubernetes.io/router.tls: "true"

  alertmanagerSpec:
    storage:
      volumeClaimTemplate:
        spec:
          storageClassName: nfs-client
          accessModes: ["ReadWriteOnce"]
          resources:
            requests:
              storage: 5Gi

# ========================
# EXPORTERS
# ========================
nodeExporter:
  enabled: true

kubeStateMetrics:
  enabled: true

# ========================
# OPERATOR
# ========================
prometheusOperator:
  enabled: true

# ========================
# RULES
# ========================
defaultRules:
  create: false

# ========================
# PUSHGATEWAY
# ========================
extraManifests:
  - apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: pushgateway
      namespace: observability-stack
      labels:
        app: pushgateway
    spec:
      replicas: 1
      selector:
        matchLabels:
          app: pushgateway
      template:
        metadata:
          labels:
            app: pushgateway
        spec:
          containers:
            - name: pushgateway
              image: prom/pushgateway:v1.10.0
              ports:
                - containerPort: 9091
  - apiVersion: v1
    kind: Service
    metadata:
      name: pushgateway
      namespace: observability-stack
      labels:
        app: pushgateway
    spec:
      selector:
        app: pushgateway
      ports:
        - name: http
          port: 9091
          targetPort: 9091