Skip to content

Commit

Permalink
feat(helm): install kube-prometheus-stack
Browse files Browse the repository at this point in the history
  • Loading branch information
willianpaixao committed Nov 9, 2024
1 parent c421d72 commit 93bc8aa
Show file tree
Hide file tree
Showing 5 changed files with 170 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/helmrelease-helm-v2.json
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: &app kube-prometheus-stack
namespace: &namespace observability
spec:
interval: 1h
timeout: 30m
chart:
spec:
chart: kube-prometheus-stack
version: 66.0.0
sourceRef:
kind: HelmRepository
name: prometheus-community-charts
namespace: flux-system
install:
crds: CreateReplace
remediation:
retries: 3
upgrade:
cleanupOnFail: true
crds: CreateReplace
remediation:
strategy: rollback
retries: 3
values:
crds:
enabled: true
alertmanager:
ingress:
enabled: true
pathType: Prefix
ingressClassName: internal
annotations:
gethomepage.dev/enabled: "true"
gethomepage.dev/group: Monitoring
gethomepage.dev/icon: alertmanager.png
gethomepage.dev/name: Alertmanager
hosts:
- &host alertmanager.${SECRET_DOMAIN}
tls:
- hosts:
- *host
alertmanagerSpec:
replicas: 1
prometheus:
ingress:
enabled: true
ingressClassName: internal
pathType: Prefix
annotations:
gethomepage.dev/enabled: "true"
gethomepage.dev/group: Monitoring
gethomepage.dev/icon: prometheus.png
gethomepage.dev/name: Prometheus
hosts:
- &host prometheus.${SECRET_DOMAIN}
tls:
- hosts:
- *host
prometheusSpec:
replicas: 1
scrapeInterval: 30s
ruleSelectorNilUsesHelmValues: false
serviceMonitorSelectorNilUsesHelmValues: false
podMonitorSelectorNilUsesHelmValues: false
probeSelectorNilUsesHelmValues: false
scrapeConfigSelectorNilUsesHelmValues: false
enableAdminAPI: true
walCompression: true
enableFeatures:
- auto-gomaxprocs
- memory-snapshot-on-shutdown
- new-service-discovery-manager
- remote-write-receiver
enableRemoteWriteReceiver: true
retention: 30d
retentionSize: 64GiB
nodeSelector:
disktype: ssd
storageSpec:
volumeClaimTemplate:
spec:
storageClassName: longhorn
resources:
requests:
storage: 64Gi
nodeExporter:
enabled: true
prometheus-node-exporter:
fullnameOverride: node-exporter
prometheus:
monitor:
enabled: true
kubeStateMetrics:
enabled: true
kube-state-metrics:
fullnameOverride: kube-state-metrics
prometheus:
monitor:
enabled: true
grafana:
enabled: true
defaultDashboardsTimezone: ${TIMEZONE}
ingress:
enabled: true
annotations:
gethomepage.dev/enabled: "true"
gethomepage.dev/group: Monitoring
gethomepage.dev/icon: grafana.png
gethomepage.dev/name: Grafana
labels:
app.kubernetes.io/name: kube-prometheus-stack-prometheus
hosts:
- &host grafana.${SECRET_DOMAIN}
tls:
- hosts:
- *host
persistence:
enabled: true
storageClassName: longhorn
accessModes:
- ReadWriteOnce
size: 8Gi
labels:
recurring-job-group.longhorn.io/backup: enabled
nodeSelector:
disktype: ssd
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- helmrelease.yaml
21 changes: 21 additions & 0 deletions kubernetes/raspberry/observability/kube-prometheus-stack/ks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/kustomization-kustomize-v1.json
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: &app kube-prometheus-stack
namespace: flux-system
spec:
targetNamespace: observability
commonMetadata:
labels:
app.kubernetes.io/name: *app
path: ./kubernetes/raspberry/observability/kube-prometheus-stack/app
prune: true
sourceRef:
kind: GitRepository
name: home-kubernetes
wait: false
interval: 1h
retryInterval: 1m
timeout: 15m
6 changes: 6 additions & 0 deletions kubernetes/raspberry/observability/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- namespace.yaml
- kube-prometheus-stack/ks.yaml
7 changes: 7 additions & 0 deletions kubernetes/raspberry/observability/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
apiVersion: v1
kind: Namespace
metadata:
name: observability
labels:
kustomize.toolkit.fluxcd.io/prune: disabled

0 comments on commit 93bc8aa

Please sign in to comment.