summaryrefslogtreecommitdiff
path: root/f3s/argocd-apps/monitoring/prometheus.yaml
blob: 42651687fc01216c6beb1d7706c669c91af32c6d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: prometheus
  namespace: cicd
  finalizers:
    - resources-finalizer.argocd.argoproj.io
spec:
  project: default

  sources:
    # Source 1: Upstream Helm chart from prometheus-community
    - repoURL: https://prometheus-community.github.io/helm-charts
      chart: kube-prometheus-stack
      targetRevision: 55.5.0
      helm:
        releaseName: prometheus
        valuesObject:
          kubeEtcd:
            enabled: true
            endpoints:
              - 192.168.2.120
              - 192.168.2.121
              - 192.168.2.122
            service:
              enabled: true
              port: 2381
              targetPort: 2381

          kubeControllerManager:
            enabled: true
            endpoints:
              - 192.168.2.120
              - 192.168.2.121
              - 192.168.2.122
            service:
              enabled: true
              port: 10257
              targetPort: 10257
            serviceMonitor:
              enabled: true
              https: true
              insecureSkipVerify: true

          prometheus:
            prometheusSpec:
              additionalArgs:
                - name: web.enable-remote-write-receiver
                  value: ""
                - name: web.enable-admin-api
                  value: ""
              enableFeatures:
                - exemplar-storage
                - otlp-write-receiver
              additionalScrapeConfigs: []
              tsdb:
                outOfOrderTimeWindow: 744h  # 31 days
              additionalScrapeConfigsSecret:
                enabled: true
                name: additional-scrape-configs
                key: additional-scrape-configs.yaml
              storageSpec:
                volumeClaimTemplate:
                  spec:
                    storageClassName: ""
                    accessModes: ["ReadWriteOnce"]
                    resources:
                      requests:
                        storage: 10Gi
                    selector:
                      matchLabels:
                        type: local
                        app: prometheus

          grafana:
            persistence:
              enabled: true
              type: pvc
              existingClaim: "grafana-data-pvc"

            initChownData:
              enabled: false

            podSecurityContext:
              fsGroup: 911
              runAsUser: 911
              runAsGroup: 911

            # Disable sidecar-based datasource provisioning
            sidecar:
              datasources:
                enabled: false

            # Mount datasources ConfigMap directly to provisioning directory
            extraVolumes:
              - name: datasources-volume
                configMap:
                  name: grafana-datasources-all

            extraVolumeMounts:
              - name: datasources-volume
                mountPath: /etc/grafana/provisioning/datasources
                readOnly: true

    # Source 2: Additional manifests from Git repository
    - repoURL: https://codeberg.org/snonux/conf.git
      targetRevision: master
      path: f3s/prometheus/manifests

  destination:
    server: https://kubernetes.default.svc
    namespace: monitoring

  syncPolicy:
    automated:
      prune: false  # Manual pruning for safety on complex stack
      selfHeal: true
    syncOptions:
      - CreateNamespace=false
      - ServerSideApply=true
    retry:
      limit: 3
      backoff:
        duration: 10s
        factor: 2
        maxDuration: 3m