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
Store + analyze
Dashboard
K8s findings
The Servyx Kubernetes collector runs as a CronJob inside your cluster. On each run, it:
- Queries the Kubernetes API for node and pod resource usage
- Collects CPU and memory requests, limits, and actual utilization
- Sends the data to Servyx over HTTPS using an authentication token
- 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
- In your Servyx dashboard, navigate to your Kubernetes section
- Click Add Cluster
- Enter a name for the cluster (e.g., "production-us-east-1")
- 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
| Parameter | Default | Description |
|---|---|---|
config.token | (required) | Your Servyx collector token |
config.endpoint | https://servyx.ai/api/collect/kubernetes | The Servyx ingestion endpoint |
schedule | */30 * * * * | CronJob schedule (default: every 30 minutes) |
resources.requests.cpu | 50m | CPU request for the collector pod |
resources.requests.memory | 64Mi | Memory request for the collector pod |
resources.limits.cpu | 200m | CPU limit for the collector pod |
resources.limits.memory | 128Mi | Memory 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 resourcespods-- To list pods and their resource requests/limitsnamespaces-- 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
| AWS | Kubernetes | |
|---|---|---|
| Collection method | Server-side (no agent needed) | Agent inside your cluster |
| Credentials | IAM access keys (encrypted in Servyx) | Collector token (secured in Servyx) |
| Frequency | On-demand (you trigger syncs) | Automated via CronJob schedule |
| Install required | No | Yes (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.