Add WireGuard monitor and docs
This commit adds a manifest for deploying a WireGuard prometheus exporter, Role and RoleBinding for kube-prometheus to monitor the Kilo namespace and a new guide in the docs about how to monitor Kilo. Signed-off-by: leonnicolas <leonloechner@gmx.de>
This commit is contained in:
		
							
								
								
									
										56
									
								
								manifests/wg-exporter-role-kube-prometheus.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										56
									
								
								manifests/wg-exporter-role-kube-prometheus.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,56 @@ | ||||
| apiVersion: rbac.authorization.k8s.io/v1 | ||||
| kind: Role | ||||
| metadata: | ||||
|   labels: | ||||
|     app.kubernetes.io/component: prometheus | ||||
|     app.kubernetes.io/name: prometheus | ||||
|     app.kubernetes.io/part-of: kube-prometheus | ||||
|     app.kubernetes.io/version: 2.26.0 | ||||
|   name: prometheus-k8s | ||||
|   namespace: kilo | ||||
| rules: | ||||
| - apiGroups: | ||||
|   - "" | ||||
|   resources: | ||||
|   - services | ||||
|   - endpoints | ||||
|   - pods | ||||
|   verbs: | ||||
|   - get | ||||
|   - list | ||||
|   - watch | ||||
| - apiGroups: | ||||
|   - extensions | ||||
|   resources: | ||||
|   - ingresses | ||||
|   verbs: | ||||
|   - get | ||||
|   - list | ||||
|   - watch | ||||
| - apiGroups: | ||||
|   - networking.k8s.io | ||||
|   resources: | ||||
|   - ingresses | ||||
|   verbs: | ||||
|   - get | ||||
|   - list | ||||
|   - watch | ||||
| --- | ||||
| apiVersion: rbac.authorization.k8s.io/v1 | ||||
| kind: RoleBinding | ||||
| metadata: | ||||
|   labels: | ||||
|     app.kubernetes.io/component: prometheus | ||||
|     app.kubernetes.io/name: prometheus | ||||
|     app.kubernetes.io/part-of: kube-prometheus | ||||
|     app.kubernetes.io/version: 2.26.0 | ||||
|   name: prometheus-k8s | ||||
|   namespace: kilo | ||||
| roleRef: | ||||
|   apiGroup: rbac.authorization.k8s.io | ||||
|   kind: Role | ||||
|   name: prometheus-k8s | ||||
| subjects: | ||||
| - kind: ServiceAccount | ||||
|   name: prometheus-k8s | ||||
|   namespace: monitoring | ||||
							
								
								
									
										67
									
								
								manifests/wg-exporter.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										67
									
								
								manifests/wg-exporter.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,67 @@ | ||||
| apiVersion: monitoring.coreos.com/v1 | ||||
| kind: PodMonitor | ||||
| metadata: | ||||
|   labels: | ||||
|     app.kubernetes.io/name: wg-exporter | ||||
|     app.kubernetes.io/part-of: kilo | ||||
|   name: wg-exporter | ||||
|   namespace: kilo | ||||
| spec: | ||||
|   namespaceSelector: | ||||
|     matchNames: | ||||
|     - kilo | ||||
|   podMetricsEndpoints: | ||||
|   - interval: 15s | ||||
|     port: metrics | ||||
|     path: /metrics | ||||
|   selector: | ||||
|     matchLabels: | ||||
|       app.kubernetes.io/part-of: kilo | ||||
|       app.kubernetes.io/name: wg-exporter | ||||
| --- | ||||
| apiVersion: apps/v1 | ||||
| kind: DaemonSet | ||||
| metadata: | ||||
|   labels: | ||||
|     app.kubernetes.io/name: wg-exporter | ||||
|     app.kubernetes.io/part-of: kilo | ||||
|   name: wg-exporter | ||||
|   namespace: kilo | ||||
| spec: | ||||
|   selector: | ||||
|     matchLabels: | ||||
|       app.kubernetes.io/name: wg-exporter | ||||
|       app.kubernetes.io/part-of: kilo | ||||
|   template: | ||||
|     metadata: | ||||
|       labels: | ||||
|         app.kubernetes.io/name: wg-exporter | ||||
|         app.kubernetes.io/part-of: kilo | ||||
|     spec: | ||||
|       containers: | ||||
|       - args: | ||||
|         - -a | ||||
|         - -i=kilo0 | ||||
|         - -p=9586 | ||||
|         image: mindflavor/prometheus-wireguard-exporter | ||||
|         name: wg-exporter | ||||
|         ports: | ||||
|         - containerPort: 9586 | ||||
|           name: metrics | ||||
|           protocol: TCP | ||||
|         securityContext: | ||||
|           privileged: true | ||||
|         terminationMessagePath: /dev/termination-log | ||||
|         terminationMessagePolicy: File | ||||
|         volumeMounts: | ||||
|         - name: wireguard | ||||
|           mountPath: /var/run/wireguard | ||||
|       volumes: | ||||
|       - name: wireguard | ||||
|         hostPath: | ||||
|           path: /var/run/wireguard | ||||
|       tolerations: | ||||
|       - effect: NoSchedule | ||||
|         operator: Exists | ||||
|       - effect: NoExecute | ||||
|         operator: Exists | ||||
		Reference in New Issue
	
	Block a user