Connect Kubernetes Cluster

Servyx monitors Kubernetes clusters by deploying a lightweight collector agent inside your cluster. Unlike AWS (where collection happens server-side), Kubernetes monitoring requires an agent because cluster metrics are only accessible from within the cluster network.

How It Works

CronJob

Every 30 min

K8s API

Nodes · Pods · Metrics

HTTPS

Token auth

Servyx

Servyx

Store + analyze

Dashboard

K8s findings

The Servyx Kubernetes collector runs as a CronJob inside your cluster. On each run, it:

  1. Queries the Kubernetes API for node and pod resource usage
  2. Collects CPU and memory requests, limits, and actual utilization
  3. Sends the data to Servyx over HTTPS using an authentication token
  4. Shuts down until the next scheduled run

The collector is open source and available at github.com/marcus-gomes-v/servyx-k8s-collector.

Step 1: Register Your Cluster in Servyx

  1. In your Servyx dashboard, navigate to your Kubernetes section
  2. Click Add Cluster
  3. Enter a name for the cluster (e.g., "production-us-east-1")
  4. Servyx will generate a Collector Token

Copy this token immediately. It is shown only once. If you lose it, you can regenerate a new one from the cluster settings.

The token is stored securely and cannot be retrieved after generation.

Step 2: Install the Helm Chart

Make sure you have Helm 3 installed and your kubectl context points to the target cluster.

helm repo add servyx https://marcus-gomes-v.github.io/servyx-k8s-collector
helm repo update

Install the collector:

helm install servyx-collector servyx/servyx-k8s-collector \
  --namespace servyx \
  --create-namespace \
  --set config.token="YOUR_COLLECTOR_TOKEN" \
  --set config.endpoint="https://servyx.ai/api/collect/kubernetes"

Replace YOUR_COLLECTOR_TOKEN with the token from Step 1.

Step 3: Verify the Installation

Check that the CronJob was created:

kubectl get cronjobs -n servyx

You should see servyx-collector listed. To trigger an immediate run and verify it works:

kubectl create job --from=cronjob/servyx-collector test-run -n servyx

Then check the logs:

kubectl logs -n servyx job/test-run

A successful run will show the collector connecting to Servyx and reporting the number of nodes and pods discovered.

Step 4: Check Data in Servyx

After a successful collection, return to your Servyx dashboard. Your cluster should now show:

  • Node count and resource capacity
  • Pod resource requests vs. actual utilization
  • Over-provisioning findings (if any)

Configuration Options

ParameterDefaultDescription
config.token(required)Your Servyx collector token
config.endpointhttps://servyx.ai/api/collect/kubernetesThe Servyx ingestion endpoint
schedule*/30 * * * *CronJob schedule (default: every 30 minutes)
resources.requests.cpu50mCPU request for the collector pod
resources.requests.memory64MiMemory request for the collector pod
resources.limits.cpu200mCPU limit for the collector pod
resources.limits.memory128MiMemory limit for the collector pod

What Permissions Does the Collector Need

The Helm chart creates a ClusterRole with read-only access to:

  • nodes -- To list nodes and their allocatable resources
  • pods -- To list pods and their resource requests/limits
  • namespaces -- To organize data by namespace
  • Metrics API -- To collect actual CPU and memory usage

The collector cannot modify any resources in your cluster.

AWS vs. Kubernetes: Key Differences

AWSKubernetes
Collection methodServer-side (no agent needed)Agent inside your cluster
CredentialsIAM access keys (encrypted in Servyx)Collector token (secured in Servyx)
FrequencyOn-demand (you trigger syncs)Automated via CronJob schedule
Install requiredNoYes (Helm chart)

Updating the Collector

To update to the latest version:

helm repo update
helm upgrade servyx-collector servyx/servyx-k8s-collector -n servyx

Uninstalling

To remove the collector from your cluster:

helm uninstall servyx-collector -n servyx

This removes the CronJob, ServiceAccount, ClusterRole, and ClusterRoleBinding. Your data in Servyx is retained.