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,
 | 
					              "job": true,
 | 
				
			||||||
              "kubernetes_namespace": true,
 | 
					              "kubernetes_namespace": true,
 | 
				
			||||||
              "kubernetes_pod_name": true,
 | 
					              "kubernetes_pod_name": true,
 | 
				
			||||||
              "namespace": true,
 | 
					 | 
				
			||||||
              "pod_template_hash": true,
 | 
					              "pod_template_hash": true,
 | 
				
			||||||
              "status": true,
 | 
					              "status": true,
 | 
				
			||||||
              "type": true
 | 
					              "type": true,
 | 
				
			||||||
 | 
					              "pod": true,
 | 
				
			||||||
 | 
					              "container": true,
 | 
				
			||||||
 | 
					              "endpoint": true,
 | 
				
			||||||
 | 
					              "exported_namespace": true
 | 
				
			||||||
            },
 | 
					            },
 | 
				
			||||||
            "indexByName": {},
 | 
					            "indexByName": {},
 | 
				
			||||||
            "renameByName": {
 | 
					            "renameByName": {
 | 
				
			||||||
              "Value": "Status",
 | 
					              "Value": "Status",
 | 
				
			||||||
              "kind": "Kind",
 | 
					              "kind": "Kind",
 | 
				
			||||||
              "name": "Name"
 | 
					              "name": "Name",
 | 
				
			||||||
 | 
					              "namespace": "Namespace"
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@ -594,15 +598,19 @@
 | 
				
			|||||||
              "job": true,
 | 
					              "job": true,
 | 
				
			||||||
              "kubernetes_namespace": true,
 | 
					              "kubernetes_namespace": true,
 | 
				
			||||||
              "kubernetes_pod_name": true,
 | 
					              "kubernetes_pod_name": true,
 | 
				
			||||||
              "namespace": true,
 | 
					 | 
				
			||||||
              "pod_template_hash": true,
 | 
					              "pod_template_hash": true,
 | 
				
			||||||
 | 
					              "pod": true,
 | 
				
			||||||
              "status": true,
 | 
					              "status": true,
 | 
				
			||||||
              "type": true
 | 
					              "type": true,
 | 
				
			||||||
 | 
					              "container": true,
 | 
				
			||||||
 | 
					              "endpoint": true,
 | 
				
			||||||
 | 
					              "exported_namespace": true
 | 
				
			||||||
            },
 | 
					            },
 | 
				
			||||||
            "indexByName": {},
 | 
					            "indexByName": {},
 | 
				
			||||||
            "renameByName": {
 | 
					            "renameByName": {
 | 
				
			||||||
              "Value": "Status",
 | 
					              "Value": "Status",
 | 
				
			||||||
              "kind": "Kind",
 | 
					              "kind": "Kind",
 | 
				
			||||||
 | 
					              "namespace": "Namespace",
 | 
				
			||||||
              "name": "Name"
 | 
					              "name": "Name"
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
@ -831,7 +839,7 @@
 | 
				
			|||||||
  "schemaVersion": 26,
 | 
					  "schemaVersion": 26,
 | 
				
			||||||
  "style": "light",
 | 
					  "style": "light",
 | 
				
			||||||
  "tags": [
 | 
					  "tags": [
 | 
				
			||||||
    "gitops-toolkit"
 | 
					    "flux"
 | 
				
			||||||
  ],
 | 
					  ],
 | 
				
			||||||
  "templating": {
 | 
					  "templating": {
 | 
				
			||||||
    "list": [
 | 
					    "list": [
 | 
				
			||||||
 | 
				
			|||||||
@ -1356,7 +1356,7 @@
 | 
				
			|||||||
  "schemaVersion": 26,
 | 
					  "schemaVersion": 26,
 | 
				
			||||||
  "style": "light",
 | 
					  "style": "light",
 | 
				
			||||||
  "tags": [
 | 
					  "tags": [
 | 
				
			||||||
    "gitops-toolkit"
 | 
					    "flux"
 | 
				
			||||||
  ],
 | 
					  ],
 | 
				
			||||||
  "templating": {
 | 
					  "templating": {
 | 
				
			||||||
    "list": [
 | 
					    "list": [
 | 
				
			||||||
@ -1424,7 +1424,7 @@
 | 
				
			|||||||
    ]
 | 
					    ]
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  "timezone": "",
 | 
					  "timezone": "",
 | 
				
			||||||
  "title": "GitOps Toolkit Control Plane",
 | 
					  "title": "Flux Control Plane",
 | 
				
			||||||
  "uid": "gitops-toolkit-control-plane",
 | 
					  "uid": "flux-control-plane",
 | 
				
			||||||
  "version": 1
 | 
					  "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