k8s-monitoring-app

by Cloudscript Technology

Helm chartv1.0.0App v0.0.25MITVerified publisher

The K8s Monitoring App is a unified system for monitoring and alerting of Kubernetes clusters.

About this chart

K8s Monitoring App Helm Chart

Um Helm Chart para implantar o K8s Monitoring App em Kubernetes, com coleta automática de métricas de aplicações e recursos do cluster, autenticação via Google OAuth 2.0 e alertas opcionais via Slack.

Description

O K8s Monitoring App é uma aplicação nativa de Kubernetes que coleta métricas (pods, CPU, memória, PVC, nós, health checks HTTP) e armazena em SQLite. A autenticação pode ser habilitada via Google OAuth 2.0 com restrição por domínio, e alertas podem ser enviados via Slack.

Features

  • ✅ Coleta automática de métricas com intervalo configurável
  • ✅ Vários tipos de métricas: saúde HTTP, pods, CPU, memória, PVC e nós
  • ✅ Monitoramento de conexões: Redis, PostgreSQL, MongoDB, MySQL e Kong
  • ✅ Armazenamento em SQLite (arquivo)
  • ✅ Autenticação Google OAuth 2.0 (restrição por domínio)
  • ✅ RBAC e ServiceAccount opcionais
  • ✅ Web UI com atualização automática

Installation

Prerequisites

  • Kubernetes >= 1.27
  • Helm >= 3.0
  • metrics-server instalado no cluster
  • Credenciais Google OAuth 2.0 (se autenticação estiver habilitada)

Install the Chart

# Adicionar repositório (se aplicável)
helm repo add cloudscript https://charts.cloudscript.technology
helm repo update

# Instalar a partir do repositório
helm install k8s-monitoring-app cloudscript/k8s-monitoring-app -f values.yaml

# OU instalar localmente a partir do diretório do chart
helm install k8s-monitoring-app . -n monitoring --create-namespace

Configuration

Example values.yaml

# Imagem
image:
  repository: ghcr.io/cloudscript-technology/k8s-monitoring-app
  pullPolicy: IfNotPresent
  tag: "" # usa appVersion do chart por padrão

# Configuração principal
config:
  environment: production
  port: 8080
  metrics:
    retentionDays: 30
    cleanupInterval: "0 2 * * *"
    collectionInterval: 60
  database:
    # Caminho do arquivo SQLite; monte um volume se desejar persistência
    path: "/data/k8s_monitoring.db"
  notifications:
    dedupMinutes: 10
    slack:
      enabled: true
      webhook:
        # Defina url OU fromSecret
        url: ""
        fromSecret: "slack-webhook-url"
  oauth:
    google:
      redirectURL: "https://monitoring.example.com/auth/callback"
      allowedDomains: "example.com"
      allowedEmails: "[email protected]"
      # Defina clientID/clientSecret OU fromSecret
      clientID: ""
      clientSecret: ""
      fromSecret: "google-oauth-client-credentials"

# Service
service:
  type: ClusterIP
  # port: 8080 # opcional; padrão 8080

# Ingress
ingress:
  enabled: true
  className: "nginx"
  hosts:
    - host: monitoring.example.com
      paths:
        - path: /
          pathType: Prefix
  tls: []

# RBAC
rbac:
  create: true

# Service Account
serviceAccount:
  create: true
  automount: true
  annotations: {}
  name: ""
  namespace: monitoring

# Pod
podAnnotations: {}
podLabels: {}
podSecurityContext: {}
securityContext: {}
resources: {}
nodeSelector: {}
tolerations: []
affinity: {}

Kubernetes Secrets

Secret para Slack Webhook

kubectl -n monitoring create secret generic slack-webhook-url \
  --from-literal=url="https://hooks.slack.com/services/XXXX/XXXX/XXXX"

Secret para Google OAuth

kubectl -n monitoring create secret generic google-oauth-client-credentials \
  --from-literal=clientID="1234567890.apps.googleusercontent.com" \
  --from-literal=clientSecret="XXXXXXXXXXXXXXXXXXXXXXXX"

Storage and Volumes

O aplicativo usa SQLite (DB_PATH). Para persistência, monte um PVC em um caminho (ex.: /data) e aponte config.database.path para esse local. Este chart não cria PVC automaticamente.

Configuration Parameters

Global Configuration

ParameterDescriptionDefault
image.repositoryDocker image repositoryghcr.io/cloudscript-technology/k8s-monitoring-app
image.pullPolicyImage pull policyIfNotPresent
image.tagImage tag"" (usa appVersion)
imagePullSecretsImage pull secrets[]
nameOverrideOverride chart name""
fullnameOverrideOverride full chart name""

Application Configuration (config)

ParameterDescriptionDefault
config.environmentAmbiente da aplicaçãoproduction
config.portPorta HTTP do container8080
config.metrics.retentionDaysRetenção de métricas (dias)1
config.metrics.cleanupIntervalCron de limpeza0 2 * * *
config.metrics.collectionIntervalIntervalo de coleta (s)5
config.database.pathCaminho do arquivo SQLite""

Notifications

ParameterDescriptionDefault
config.notifications.enabledHabilitar notificaçõestrue
config.notifications.dedupMinutesDeduplicação (min)10
config.notifications.slack.enabledHabilitar Slacktrue
config.notifications.slack.webhook.urlURL Webhook do Slack""
config.notifications.slack.webhook.fromSecretSecret com url""

OAuth (Google)

ParameterDescriptionDefault
config.oauth.google.redirectURLURL de callback""
config.oauth.google.allowedDomainsDomínios permitidos""
config.oauth.google.clientIDClient ID""
config.oauth.google.clientSecretClient Secret""
config.oauth.google.fromSecretSecret com credenciais""

Service Account & RBAC

ParameterDescriptionDefault
rbac.createCriar RBACtrue
serviceAccount.createCriar ServiceAccounttrue
serviceAccount.automountAutomount tokentrue
serviceAccount.annotationsService account annotations{}
serviceAccount.nameService account name""
serviceAccount.namespaceService account namespace""

Service

ParameterDescriptionDefault
service.typeTipo do ServiceClusterIP
service.portPorta do Service8080

Ingress

ParameterDescriptionDefault
ingress.enabledHabilitar Ingressfalse
ingress.classNameClasse do Ingress""
ingress.annotationsAnotações{}
ingress.hosts[].hostHostchart-example.local
ingress.hosts[].paths[].pathCaminho/
ingress.hosts[].paths[].pathTypeTipoPrefix
ingress.tlsTLS[]

Pod Configuration

ParameterDescriptionDefault
podAnnotationsPod annotations{}
podLabelsPod labels{}
podSecurityContextPod security context{}
securityContextContainer security context{}
resourcesResource requests and limits{}
nodeSelectorNode selector{}
tolerationsTolerations[]
affinityAffinity rules{}

Usage Examples

Instalação com OAuth, Slack e Ingress

config:
  environment: production
  metrics:
    retentionDays: 30
    cleanupInterval: "0 2 * * *"
    collectionInterval: 60
  database:
    path: "/data/k8s_monitoring.db"
  notifications:
    enabled: true
    dedupMinutes: 10
    slack:
      enabled: true
      webhook:
        fromSecret: "slack-webhook-url"
  oauth:
    google:
      redirectURL: "https://monitoring.example.com/auth/callback"
      allowedDomains: "example.com"
      fromSecret: "google-oauth-client-credentials"

ingress:
  enabled: true
  className: "nginx"
  hosts:
    - host: monitoring.example.com
      paths:
        - path: /
          pathType: Prefix

Acesso ao UI via port-forward

kubectl -n monitoring port-forward svc/k8s-monitoring-app 8080:8080
open http://localhost:8080

Image Compatibility

  • image.repository: ghcr.io/cloudscript-technology/k8s-monitoring-app
  • image.tag: usa .Chart.AppVersion por padrão (ex.: v0.0.1)
  • image.pullPolicy: IfNotPresent

Notes

  • Certifique‑se de ter o metrics-server funcional para métricas de CPU/memória.
  • Ajuste config.metrics.collectionInterval conforme sua necessidade.
  • Habilite Ingress para expor o UI externamente, ou use kubectl port-forward para acesso local.

Deploy k8s-monitoring-app with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has k8s-monitoring-app on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartk8s-monitoring-app is pinned at v1.0.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply