Use kube-prometheus-stack for monitoring

Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
pull/1399/head
Somtochi Onyekwere 4 years ago
parent 17e3c57d7e
commit 3b91e14f6d

@ -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

@ -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

@ -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

@ -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
Loading…
Cancel
Save