Provider Connectors
Troubleshooting
What each answer in the LevelFour agent's logs means, and how to fix a cluster that does not install, does not report, reports no usage, shows no price or gets no recommendations.
Start with the agent's logs:
kubectl -n levelfour logs deploy/levelfour-agentWhen LevelFour refuses a report, the agent logs the HTTP status, the code and LevelFour's message, for example 401 AUTHENTICATION_ERROR: Unknown ingest token. It logs each answer once, and logs again when LevelFour accepts reports.
The agent keeps running through a refusal. For a 401, 403, 404, 409 or 410, it holds up to 24 hourly reports in memory and retries every 5 minutes. Once you fix the cause, it resends them, and LevelFour accepts reports up to a day old. A fix that changes the chart values restarts the pod, which drops the held reports.
Answers in the agent logs
401 AUTHENTICATION_ERROR
LevelFour does not accept the token or install key the agent sends. The message says which case you hit:
Unknown ingest token: the token or install key is wrong, or someone revoked the key. With an install key, put a valid key in thelevelfour-agentSecret. The agent reads it within about a minute, with no restart (Rotate an install key). With a token from the Helm command, disconnect the cluster if it still shows on Connect Providers > Kubernetes, connect it again and run the new command.Cluster disconnected: someone disconnected a cluster installed with the Helm command. Connect it again on Connect Providers > Kubernetes and run the new command.
403 module_not_enabled
Kubernetes is not turned on for your organization, or its trial has ended. Ask your LevelFour contact to turn it on. The agent holds up to 24 hourly reports and resends them when the module comes on, so a module that is off for less than a day loses no data.
409 cluster_name_taken
Another connected cluster already has the clusterName this agent reports. Give this cluster a unique name in its values and sync. If the cluster that holds the name no longer exists, disconnect it on Connect Providers > Kubernetes. Disconnecting frees the name.
409 cluster_has_token
You connected this cluster with the Helm command, and its agent now reports with an install key. Choose one:
- Keep the per-cluster token: run the agent with
tokenagain, as the Helm command set it. - Move the cluster to the install key: disconnect it on Connect Providers > Kubernetes first. Its next report with the key registers it again.
409 cluster_disconnected
An admin disconnected this cluster while its agent ran with this install key. To bring the cluster back, run the agent with a new install key, or connect it on its own with the Helm command. To leave it disconnected, remove the agent.
409 cluster_uid_mismatch
The per-cluster token belongs to a different cluster. A token from the Helm command works for one cluster only. Connect this cluster on its own on Connect Providers > Kubernetes, or use an install key for every cluster.
422 invalid_cluster_name
The agent reports a clusterName that breaks the naming rule: lowercase letters, digits and hyphens, at most 63 characters, starting and ending with a letter or digit. The chart refuses such a name at install, so this answer means the agent runs without the chart's checks. LevelFour drops these reports instead of holding them. Fix the name, and the cluster registers on its next report.
429 install_key_registration_limit
The install key registered 100 new clusters in the last hour, its limit. Do nothing: the agent keeps its reports, retries with a backoff of up to 5 minutes and registers once the hour frees a place. Clusters the key already registered keep reporting.
Helm cannot pull the chart
Pulling the chart needs no login. A 403 from public.ecr.aws, such as denied: Your authorization token has expired, means your machine still sends an old login to that registry. Helm sends both its own saved login and Docker's. Remove both and run the command again:
helm registry logout public.ecr.aws
docker logout public.ecr.awsYour logins to private ECR registries stay as they are.
The install fails
Helm, Argo CD, Flux and Terraform all render the chart with its checks, and report the same errors. The exact wording varies by Helm version:
clusterName: Does not match patternorclusterName: String length must be greater than or equal to 1: set aclusterNamethat follows the naming rule.token is required: setexistingSecret.nameto the Secret that holds the install key, ortokenfor a Helm install.set token or existingSecret.name, not both: remove one of them.chart requires kubeVersion: >=1.23.0-0: the cluster runs a Kubernetes version older than 1.23.
The pod stays in ContainerCreating
The chart mounts the Secret that holds the key, and the pod cannot start until the Secret and its key exist. The pod's events name what is missing:
kubectl -n levelfour describe pod -l app.kubernetes.io/name=levelfour-agent
kubectl -n levelfour describe secret levelfour-agentThe Secret must be named levelfour-agent (or the name in existingSecret.name) and hold the key under token (or the name in existingSecret.key). describe secret lists each key and its size, without the value. Kubernetes starts the pod once the Secret is in place.
The agent cannot reach LevelFour
The agent sends data to api.levelfour.ai on port 443. Allow that destination in your firewall, proxy or egress NetworkPolicy. If the cluster reaches the internet through a proxy, set HTTPS_PROXY and NO_PROXY as in Behind a proxy.
Usage is zero for every workload
The agent reads usage from the kubelet on port 10250 of each node. Allow traffic from the agent's pod to the nodes on that port. A security group for pods or a NetworkPolicy can block it. Behind a proxy, check that NO_PROXY covers the node CIDR.
The agent also checks each kubelet's certificate against the cluster's certificate authority. A kubelet that serves a self-signed certificate fails that check: kubeadm deploys kubelets that way by default, and some bare-metal distributions do too. Fix it one of two ways:
- Have the kubelets request certificates the cluster signs. On kubeadm, set
serverTLSBootstrap: truein the kubelet configuration and approve the certificate requests, as the kubeadm guide describes. - Point the agent at an in-cluster Prometheus that scrapes cAdvisor, with
prometheus.url. Usage then comes from Prometheus, and the agent stops calling the kubelets.
Do not set kubelet.insecureSkipTLSVerify on a real cluster: it sends the agent's service account token to kubelets the agent cannot verify.
No recommendations
Check, in order:
- The namespace carries
levelfour.ai/recommendations=enabled, and the workload does not carrydisabled. - The workload has run for at least 7 days since the agent started, or Prometheus history covers that period.
- The cluster is priced: its cloud's billing data reaches LevelFour, or you set node prices for a cluster with no cloud bill. How clusters are priced lists what each needs. Without prices, LevelFour cannot size a saving.
Costs show no price
The bill that prices the cluster has not reached LevelFour, or has not covered the most recent day yet:
- Amazon EKS: the AWS account that runs the cluster needs detailed cost data.
- Google Kubernetes Engine: the project needs the Detailed usage cost export. The Standard export has no per-instance rows, so it cannot price a node. See Billing export.
- Azure Kubernetes Service: the subscription needs billing data.
- Any other cluster: set node prices. They apply within about 12 hours.
A cluster without the agent does not appear
A cluster with no agent shows only when the bill carries its split. Check Clusters without the agent:
- Amazon EKS: split cost allocation data is on in Cost Management preferences, and the CUR export LevelFour reads includes it. An export created without it does not pick it up later.
- Google Kubernetes Engine: cost allocation is on for the cluster, and the project's detailed export is connected. Google takes up to three days to add it and does not backfill (GKE cost allocation).
Network by destination is empty
netflow.enabledis off. Network by destination needs the netflow component.- The cluster's datapath bypasses netfilter, as Cilium with eBPF host routing does. Netflow cannot see that traffic.
- The node turned
net.netfilter.nf_conntrack_acctoff again, or its netflow pod's reads fail. That node's connections then read zero, and the agent names the node in its status check with the reason, never an address:timed out,connection refused,unauthorized(the token, see the next item),answeredand a status code, oranswer over 4 MiB, which a node talking to many internet hosts over IPv6 can reach. - The netflow pods refuse the agent after each Argo CD or Flux sync. Those tools render the chart with
helm template, which makes a new token every sync. Create the token Secret yourself and setnetflow.existingSecret, as Network by destination shows. - A netflow pod restarts out of memory on a busy node. It needs about 1 KiB per tracked connection on top of about 30 MiB: raise
netflow.resources.limits.memory. - Connections open since before the netflow pod started read zero until they reconnect.
Cost metrics are missing from Prometheus
metrics.costs.enabledis off. The cost series appear only with it on.- Prometheus does not pick up the ServiceMonitor. Set
serviceMonitor.labelsto what your Prometheus selects,release: <release name>for kube-prometheus-stack. levelfour_cost_day_timestamp_secondsreads0: the cluster has no priced day yet. See Costs show no price.
What the agent reads
Every Kubernetes permission the LevelFour agent and its optional netflow component hold, every field they send to LevelFour, what they never read or send, and what LevelFour reads about an EKS cluster from your AWS account.
OpenAI
See what you spend on OpenAI and who uses it. Connect the API bill, ChatGPT Enterprise, and the usage Codex and your own apps report.