mirror of
				https://github.com/fluxcd/flux2.git
				synced 2025-11-04 11:56:11 +08:00 
			
		
		
		
	Merge pull request #1399 from SomtochiAma/kube-prometheus
Replace monitoring stack with kube-prometheus-stack
This commit is contained in:
		@ -482,16 +482,20 @@
 | 
			
		||||
              "job": true,
 | 
			
		||||
              "kubernetes_namespace": true,
 | 
			
		||||
              "kubernetes_pod_name": true,
 | 
			
		||||
              "namespace": true,
 | 
			
		||||
              "pod_template_hash": true,
 | 
			
		||||
              "status": true,
 | 
			
		||||
              "type": true
 | 
			
		||||
              "type": true,
 | 
			
		||||
              "pod": true,
 | 
			
		||||
              "container": true,
 | 
			
		||||
              "endpoint": true,
 | 
			
		||||
              "exported_namespace": true
 | 
			
		||||
            },
 | 
			
		||||
            "indexByName": {},
 | 
			
		||||
            "renameByName": {
 | 
			
		||||
              "Value": "Status",
 | 
			
		||||
              "kind": "Kind",
 | 
			
		||||
              "name": "Name"
 | 
			
		||||
              "name": "Name",
 | 
			
		||||
              "namespace": "Namespace"
 | 
			
		||||
            }
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
@ -594,15 +598,19 @@
 | 
			
		||||
              "job": true,
 | 
			
		||||
              "kubernetes_namespace": true,
 | 
			
		||||
              "kubernetes_pod_name": true,
 | 
			
		||||
              "namespace": true,
 | 
			
		||||
              "pod_template_hash": true,
 | 
			
		||||
              "pod": true,
 | 
			
		||||
              "status": true,
 | 
			
		||||
              "type": true
 | 
			
		||||
              "type": true,
 | 
			
		||||
              "container": true,
 | 
			
		||||
              "endpoint": true,
 | 
			
		||||
              "exported_namespace": true
 | 
			
		||||
            },
 | 
			
		||||
            "indexByName": {},
 | 
			
		||||
            "renameByName": {
 | 
			
		||||
              "Value": "Status",
 | 
			
		||||
              "kind": "Kind",
 | 
			
		||||
              "namespace": "Namespace",
 | 
			
		||||
              "name": "Name"
 | 
			
		||||
            }
 | 
			
		||||
          }
 | 
			
		||||
@ -831,7 +839,7 @@
 | 
			
		||||
  "schemaVersion": 26,
 | 
			
		||||
  "style": "light",
 | 
			
		||||
  "tags": [
 | 
			
		||||
    "gitops-toolkit"
 | 
			
		||||
    "flux"
 | 
			
		||||
  ],
 | 
			
		||||
  "templating": {
 | 
			
		||||
    "list": [
 | 
			
		||||
 | 
			
		||||
@ -1356,7 +1356,7 @@
 | 
			
		||||
  "schemaVersion": 26,
 | 
			
		||||
  "style": "light",
 | 
			
		||||
  "tags": [
 | 
			
		||||
    "gitops-toolkit"
 | 
			
		||||
    "flux"
 | 
			
		||||
  ],
 | 
			
		||||
  "templating": {
 | 
			
		||||
    "list": [
 | 
			
		||||
@ -1424,7 +1424,7 @@
 | 
			
		||||
    ]
 | 
			
		||||
  },
 | 
			
		||||
  "timezone": "",
 | 
			
		||||
  "title": "GitOps Toolkit Control Plane",
 | 
			
		||||
  "uid": "gitops-toolkit-control-plane",
 | 
			
		||||
  "title": "Flux Control Plane",
 | 
			
		||||
  "uid": "flux-control-plane",
 | 
			
		||||
  "version": 1
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -0,0 +1,7 @@
 | 
			
		||||
apiVersion: kustomize.config.k8s.io/v1beta1
 | 
			
		||||
kind: Kustomization
 | 
			
		||||
namespace: monitoring
 | 
			
		||||
resources:
 | 
			
		||||
  - namespace.yaml
 | 
			
		||||
  - repository.yaml
 | 
			
		||||
  - release.yaml
 | 
			
		||||
@ -0,0 +1,4 @@
 | 
			
		||||
apiVersion: v1
 | 
			
		||||
kind: Namespace
 | 
			
		||||
metadata:
 | 
			
		||||
  name: monitoring
 | 
			
		||||
							
								
								
									
										25
									
								
								manifests/monitoring/kube-prometheus-stack/release.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								manifests/monitoring/kube-prometheus-stack/release.yaml
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,25 @@
 | 
			
		||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
 | 
			
		||||
kind: HelmRelease
 | 
			
		||||
metadata:
 | 
			
		||||
  name: kube-prometheus-stack
 | 
			
		||||
spec:
 | 
			
		||||
  interval: 5m
 | 
			
		||||
  chart:
 | 
			
		||||
    spec:
 | 
			
		||||
      chart: kube-prometheus-stack
 | 
			
		||||
      sourceRef:
 | 
			
		||||
        kind: HelmRepository
 | 
			
		||||
        name: prometheus-community
 | 
			
		||||
      interval: 1m
 | 
			
		||||
  values:
 | 
			
		||||
    alertmanager:
 | 
			
		||||
      enabled: false
 | 
			
		||||
    grafana:
 | 
			
		||||
      sidecar:
 | 
			
		||||
        dashboards:
 | 
			
		||||
          searchNamespace: ALL
 | 
			
		||||
    prometheus:
 | 
			
		||||
      prometheusSpec:
 | 
			
		||||
        podMonitorSelector:
 | 
			
		||||
          matchLabels:
 | 
			
		||||
            app.kubernetes.io/part-of: flux
 | 
			
		||||
@ -0,0 +1,7 @@
 | 
			
		||||
apiVersion: source.toolkit.fluxcd.io/v1beta1
 | 
			
		||||
kind: HelmRepository
 | 
			
		||||
metadata:
 | 
			
		||||
  name: prometheus-community
 | 
			
		||||
spec:
 | 
			
		||||
  interval: 1m
 | 
			
		||||
  url: https://prometheus-community.github.io/helm-charts
 | 
			
		||||
							
								
								
									
										13
									
								
								manifests/monitoring/monitoring-config/kustomization.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								manifests/monitoring/monitoring-config/kustomization.yaml
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,13 @@
 | 
			
		||||
apiVersion: kustomize.config.k8s.io/v1beta1
 | 
			
		||||
kind: Kustomization
 | 
			
		||||
namespace: flux-system
 | 
			
		||||
resources:
 | 
			
		||||
  - podmonitor.yaml
 | 
			
		||||
configMapGenerator:
 | 
			
		||||
  - name: flux-grafana-dashboards
 | 
			
		||||
    files:
 | 
			
		||||
      - ../grafana/dashboards/control-plane.json
 | 
			
		||||
      - ../grafana/dashboards/cluster.json
 | 
			
		||||
    options:
 | 
			
		||||
      labels:
 | 
			
		||||
        grafana_dashboard: flux-system
 | 
			
		||||
							
								
								
									
										24
									
								
								manifests/monitoring/monitoring-config/podmonitor.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								manifests/monitoring/monitoring-config/podmonitor.yaml
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,24 @@
 | 
			
		||||
apiVersion: monitoring.coreos.com/v1
 | 
			
		||||
kind: PodMonitor
 | 
			
		||||
metadata:
 | 
			
		||||
  name: flux-system
 | 
			
		||||
  namespace: flux-system
 | 
			
		||||
  labels:
 | 
			
		||||
    app.kubernetes.io/part-of: flux
 | 
			
		||||
spec:
 | 
			
		||||
  namespaceSelector:
 | 
			
		||||
    matchNames:
 | 
			
		||||
      - flux-system
 | 
			
		||||
  selector:
 | 
			
		||||
    matchExpressions:
 | 
			
		||||
      - key: app
 | 
			
		||||
        operator: In
 | 
			
		||||
        values:
 | 
			
		||||
          - helm-controller
 | 
			
		||||
          - source-controller
 | 
			
		||||
          - kustomize-controller
 | 
			
		||||
          - notification-controller
 | 
			
		||||
          - image-automation-controller
 | 
			
		||||
          - image-reflector-controller
 | 
			
		||||
  podMetricsEndpoints:
 | 
			
		||||
    - targetPort: http-prom
 | 
			
		||||
		Reference in New Issue
	
	Block a user