Skip to content

Commit

Permalink
add monitoring stack
Browse files Browse the repository at this point in the history
  • Loading branch information
juliuste committed Oct 4, 2024
1 parent b277ffc commit 8b99906
Show file tree
Hide file tree
Showing 8 changed files with 108 additions and 0 deletions.
16 changes: 16 additions & 0 deletions kubernetes/clusters/tilia/monitoring.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: kustomize.toolkit.fluxcd.io/v1beta1
kind: Kustomization
metadata:
name: monitoring
namespace: flux-system
spec:
interval: 5m0s
dependsOn:
- name: helm-repositories
namespace: flux-system
sourceRef:
kind: GitRepository
name: flux-system
path: ./kubernetes/infrastructure/monitoring
prune: true
validation: client
3 changes: 3 additions & 0 deletions kubernetes/infrastructure/alerts/slack-alert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ spec:
- kind: HelmRelease
name: '*'
namespace: 'postgres'
- kind: HelmRelease
name: '*'
namespace: 'monitoring'
- kind: HelmRelease
name: '*'
namespace: 'reloader'
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ resources:
- charts.yaml
- stakater.yaml
- bitnami.yaml
- prometheus-community.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: source.toolkit.fluxcd.io/v1beta1
kind: HelmRepository
metadata:
name: prometheus-community
spec:
interval: 30m
url: https://prometheus-community.github.io/helm-charts
5 changes: 5 additions & 0 deletions kubernetes/infrastructure/monitoring/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: monitoring
resources:
- release.yaml
71 changes: 71 additions & 0 deletions kubernetes/infrastructure/monitoring/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: monitoring
namespace: monitoring
spec:
chart:
spec:
chart: kube-prometheus-stack
sourceRef:
kind: HelmRepository
name: prometheus-community
namespace: flux-system
version: '^65.0.0'
values:
prometheusSpec:
storageSpec:
volumeClaimTemplate:
spec:
storageClassName: hcloud-volumes
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 20Gi
selector:
matchLabels:
app: prometheus
grafana:
replicas: 1
persistence:
enabled: true
type: pvc
storageClassName: hcloud-volumes
accessModes:
- ReadWriteOnce
size: 10Gi
finalizers:
- kubernetes.io/pvc-protection
dashboardProviders:
dashboardproviders.yaml:
apiVersion: 1
providers:
- name: 'grafana-dashboards-kubernetes'
orgId: 1
folder: 'Kubernetes'
type: file
disableDeletion: true
editable: true
options:
path: /var/lib/grafana/dashboards/grafana-dashboards-kubernetes
dashboards:
grafana-dashboards-kubernetes:
k8s-system-api-server:
url: https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/master/dashboards/k8s-system-api-server.json
token: ''
k8s-system-coredns:
url: https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/master/dashboards/k8s-system-coredns.json
token: ''
k8s-views-global:
url: https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/master/dashboards/k8s-views-global.json
token: ''
k8s-views-namespaces:
url: https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/master/dashboards/k8s-views-namespaces.json
token: ''
k8s-views-nodes:
url: https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/master/dashboards/k8s-views-nodes.json
token: ''
k8s-views-pods:
url: https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/master/dashboards/k8s-views-pods.json
token: ''
interval: 5m
1 change: 1 addition & 0 deletions kubernetes/infrastructure/namespaces/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ kind: Kustomization
resources:
- secrets.yaml
- postgres.yaml
- monitoring.yaml
- app-releases.yaml
# when adding namespaces here, make sure to also add them in alerts/slack-alert.yaml
4 changes: 4 additions & 0 deletions kubernetes/infrastructure/namespaces/monitoring.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: monitoring

0 comments on commit 8b99906

Please sign in to comment.