rancher-centralized-monitoring

by mattmattox503

Helm chartv0.3.0App v0.3

A Helm chart for Rancher Centralized Monitoring Relay

About this chart

Rancher Centralized Monitoring Helm Chart

This Helm chart deploys the Rancher Centralized Monitoring relay agent on Kubernetes. The relay agent runs as a deployment in the Rancher local cluster and acts as a proxy to access Prometheus and Loki monitoring services in remote clusters through Rancher's service proxy functionality.

Overview

Each deployment instance acts as a relay for a specific remote cluster, making monitoring data from remote clusters accessible to centralized monitoring infrastructure without requiring direct cluster access.

Installation

helm install my-monitoring-relay ./charts/rancher-centralized-monitoring

Or using the Helm repository:

helm repo add supporttools https://charts.support.tools/
helm install my-monitoring-relay supporttools/rancher-centralized-monitoring

Configuration

The following table lists the configurable parameters of the rancher-centralized-monitoring chart and their default values.

Core Settings

ParameterDescriptionDefault
replicaCountNumber of replica pods1
image.repositoryContainer image repositorysupporttools/rancher-centralized-monitoring
image.tagContainer image taglatest
image.pullPolicyImage pull policyIfNotPresent

Rancher Configuration

ParameterDescriptionDefault
rancher.apiEndpointRancher API endpoint URL (required)""
rancher.clusterIdTarget cluster ID to monitor (required)""
rancher.clusterNameHuman-readable cluster name""
rancher.auth.existingSecretName of existing secret with API credentials""
rancher.auth.accessKeySecretKeyKey name for access key in existing secretaccess-key
rancher.auth.secretKeySecretKeyKey name for secret key in existing secretsecret-key
rancher.auth.accessKeyRancher API access key (not recommended for production)""
rancher.auth.secretKeyRancher API secret key (not recommended for production)""

Monitoring Services Configuration

ParameterDescriptionDefault
monitoring.prometheus.namespacePrometheus service namespacecattle-monitoring-system
monitoring.prometheus.servicePrometheus service namerancher-monitoring-prometheus
monitoring.prometheus.portPrometheus service port9090
monitoring.loki.namespaceLoki service namespacecattle-logging-system
monitoring.loki.serviceLoki service namerancher-logging-loki
monitoring.loki.portLoki service port3100
monitoring.remote.namespaceCustom service namespace""
monitoring.remote.serviceCustom service name""
monitoring.remote.portCustom service port""

Application Settings

ParameterDescriptionDefault
app.debugEnable debug loggingfalse
app.metricsPortMetrics endpoint port9000

Service Configuration

ParameterDescriptionDefault
service.typeKubernetes service typeClusterIP
service.portService port9000
service.targetPortTarget container port9000

Resources and Scaling

ParameterDescriptionDefault
resources.requests.cpuCPU request100m
resources.requests.memoryMemory request128Mi
resources.limits.cpuCPU limit200m
resources.limits.memoryMemory limit256Mi
autoscaling.enabledEnable horizontal pod autoscalingfalse
autoscaling.minReplicasMinimum replicas1
autoscaling.maxReplicasMaximum replicas3

Observability

ParameterDescriptionDefault
observability.serviceMonitor.enabledEnable Prometheus ServiceMonitorfalse
observability.serviceMonitor.intervalScrape interval30s
observability.serviceMonitor.scrapeTimeoutScrape timeout10s
healthCheck.enabledEnable health checkstrue
healthCheck.pathHealth check endpoint path/health

Usage Examples

Basic Configuration

rancher:
  apiEndpoint: "https://rancher.example.com/v3"
  clusterId: "c-m-12345678"
  clusterName: "production-cluster"
  auth:
    accessKey: "token-12345"
    secretKey: "secret-67890"

app:
  debug: false

Production Configuration with Existing Secret

Create a secret with your Rancher API credentials:

kubectl create secret generic rancher-credentials \
  --from-literal=access-key=token-12345 \
  --from-literal=secret-key=secret-67890

Then reference it in your values:

rancher:
  apiEndpoint: "https://rancher.example.com/v3"
  clusterId: "c-m-12345678"
  clusterName: "production-cluster"
  auth:
    existingSecret: "rancher-credentials"

resources:
  requests:
    cpu: 200m
    memory: 256Mi
  limits:
    cpu: 500m
    memory: 512Mi

observability:
  serviceMonitor:
    enabled: true
    interval: 15s

Custom Monitoring Service Configuration

rancher:
  apiEndpoint: "https://rancher.example.com/v3"
  clusterId: "c-m-12345678"

monitoring:
  prometheus:
    namespace: "custom-monitoring"
    service: "prometheus-server"
    port: "9090"
  loki:
    namespace: "custom-logging"
    service: "loki"
    port: "3100"

Multiple Remote Services

rancher:
  apiEndpoint: "https://rancher.example.com/v3"
  clusterId: "c-m-12345678"

monitoring:
  remote:
    namespace: "custom-namespace"
    service: "custom-service"
    port: "8080"

Architecture

  • Deployment: Runs in the Rancher local cluster
  • Service Proxy: Uses Rancher's built-in service proxy to access remote cluster services
  • One-to-One: Each deployment instance handles one remote cluster
  • URL Pattern: {RANCHER_API_ENDPOINT}/k8s/clusters/{CLUSTER_ID}/api/v1/namespaces/{namespace}/services/{service}:{port}/proxy/

Monitoring and Observability

The relay exposes several endpoints for monitoring and health checks:

  • /metrics - Prometheus metrics endpoint
  • /health - Health check endpoint for liveness and readiness probes
  • Application logs with structured logging using logrus

ServiceMonitor

Enable the ServiceMonitor to have Prometheus automatically scrape metrics:

observability:
  serviceMonitor:
    enabled: true
    labels:
      app: monitoring

Security

The chart follows security best practices:

  • Non-root container execution
  • Read-only root filesystem
  • Dropped capabilities
  • Security contexts enforced
  • Secret management for API credentials

Troubleshooting

Debug Mode

Enable debug logging to troubleshoot connectivity issues:

app:
  debug: true

Connection Issues

Verify Rancher API connectivity:

  1. Check that rancher.apiEndpoint is correct and accessible
  2. Verify API credentials have appropriate permissions
  3. Ensure the target clusterId exists and is accessible
  4. Check that monitoring services exist in the target cluster

Common Issues

  • 403 Forbidden: API credentials lack sufficient permissions
  • 404 Not Found: Cluster ID or service names are incorrect
  • Connection Timeout: Network connectivity issues or incorrect endpoints

Deploy rancher-centralized-monitoring with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has rancher-centralized-monitoring 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 chartrancher-centralized-monitoring is pinned at v0.3.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