apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
  name: kube-prometheus-stack
  namespace: flux-system
spec:
  interval: 10m
  timeout: 15m
  targetNamespace: observability
  chart:
    spec:
      chart: ./infrastructure/charts/kube-prometheus-stack
      sourceRef:
        kind: GitRepository
        name: platform
        namespace: flux-system
  install:
    createNamespace: true
    remediation:
      retries: 3
  upgrade:
    remediation:
      retries: 3
  values:
    grafana:
      enabled: true
      admin:
        existingSecret: grafana-admin-credentials
      grafana.ini:
        server:
          root_url: http://grafana.silverside-gopher.ts.net/
          serve_from_sub_path: false
      persistence:
        enabled: true
        storageClassName: local-path
        size: 5Gi
      service:
        type: ClusterIP
      sidecar:
        datasources:
          enabled: true
          label: grafana_datasource
          searchNamespace: observability
        dashboards:
          enabled: true
          label: grafana_dashboard
          searchNamespace: observability
    prometheus:
      service:
        type: ClusterIP
      prometheusSpec:
        externalUrl: http://prometheus.silverside-gopher.ts.net:9090/
        routePrefix: /
        retention: 7d
        storageSpec:
          volumeClaimTemplate:
            spec:
              storageClassName: local-path
              accessModes:
                - ReadWriteOnce
              resources:
                requests:
                  storage: 10Gi
    alertmanager:
      enabled: false
    kubeEtcd:
      enabled: false
    kubeControllerManager:
      enabled: false
    kubeScheduler:
      enabled: false
    prometheus-node-exporter:
      hostNetwork: false
      service:
        hostPort: false
