diff --git a/kubernetes/raspberry/observability/kube-prometheus-stack/app/helmrelease.yaml b/kubernetes/raspberry/observability/kube-prometheus-stack/app/helmrelease.yaml new file mode 100644 index 000000000..6a8ef707e --- /dev/null +++ b/kubernetes/raspberry/observability/kube-prometheus-stack/app/helmrelease.yaml @@ -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 diff --git a/kubernetes/raspberry/observability/kube-prometheus-stack/app/kustomization.yaml b/kubernetes/raspberry/observability/kube-prometheus-stack/app/kustomization.yaml new file mode 100644 index 000000000..dbc604ed7 --- /dev/null +++ b/kubernetes/raspberry/observability/kube-prometheus-stack/app/kustomization.yaml @@ -0,0 +1,5 @@ +--- +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - helmrelease.yaml diff --git a/kubernetes/raspberry/observability/kube-prometheus-stack/ks.yaml b/kubernetes/raspberry/observability/kube-prometheus-stack/ks.yaml new file mode 100644 index 000000000..873396550 --- /dev/null +++ b/kubernetes/raspberry/observability/kube-prometheus-stack/ks.yaml @@ -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 diff --git a/kubernetes/raspberry/observability/kustomization.yaml b/kubernetes/raspberry/observability/kustomization.yaml new file mode 100644 index 000000000..f9f7a6cb9 --- /dev/null +++ b/kubernetes/raspberry/observability/kustomization.yaml @@ -0,0 +1,6 @@ +--- +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - namespace.yaml + - kube-prometheus-stack/ks.yaml diff --git a/kubernetes/raspberry/observability/namespace.yaml b/kubernetes/raspberry/observability/namespace.yaml new file mode 100644 index 000000000..ce3a5bd22 --- /dev/null +++ b/kubernetes/raspberry/observability/namespace.yaml @@ -0,0 +1,7 @@ +--- +apiVersion: v1 +kind: Namespace +metadata: + name: observability + labels: + kustomize.toolkit.fluxcd.io/prune: disabled