Provider Connectors
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.
The agent is read-only. Its ClusterRole grants only read verbs (get, list and watch; only get on nodes/metrics, nodes/stats and kro instances, and only list on kro ResourceGraphDefinitions), so it cannot create, change or delete anything in your cluster. It installs no webhook and no CRD, holds no cloud credentials, and opens no port to the outside. The optional netflow component is separate and takes more. Connect a cluster covers installing and removing it, and Configure the agent lists its chart values.
The optional automation component is the one part of the chart that changes anything. It has its own service account and its own permissions, which that page lists, and the chart installs it only when you turn it on. It also brings the chart's one webhook and its only CRDs, the six configuration objects in levelfour.ai/v1, which stay when you uninstall.
Permissions
| API group | Resources | Why the agent reads them |
|---|---|---|
| core | pods, nodes, namespaces, persistentvolumeclaims, persistentvolumes | Requests, limits, restarts, placement, node capacity, namespace labels, volume size and owner |
| core | nodes/metrics | CPU, memory and throttling per container, network bytes per pod and node, and used bytes per volume, from the kubelet |
| core | nodes/stats | Ephemeral storage per container and pod, node filesystem use and process counts, from the kubelet Summary API (read-only) |
| core | events | Karpenter's interruption and disruption events on nodes and NodePools |
| core | resourcequotas, limitranges | Each namespace's quota and container limits, so a recommendation fits inside them |
storage.k8s.io | storageclasses | Each StorageClass's provisioner and whether it allows volume expansion, so LevelFour recommends a smaller claim only on a class that can grow |
apps | deployments, statefulsets, daemonsets, replicasets | Which workload owns each pod, and its replica count. On Karpenter's controller, its version and feature gates |
batch | jobs, cronjobs | Which workload owns each pod |
autoscaling | horizontalpodautoscalers | Scaling targets and current replicas, so a recommendation never fights the autoscaler |
autoscaling.k8s.io | verticalpodautoscalers | The requests a VPA writes get no recommendation; a VPA that only recommends is shown next to ours |
keda.sh | scaledobjects, scaledjobs | Scaling targets of KEDA-scaled workloads |
policy | poddisruptionbudgets | Availability rules that a change must respect, and whether each one allows a disruption right now |
karpenter.sh | nodepools | Capacity types, instance families, limits, consolidation and expiry settings, and the source that deploys each NodePool |
karpenter.k8s.aws | ec2nodeclasses | The node image family behind each NodePool |
eks.amazonaws.com | nodeclasses | The EKS Auto Mode NodeClass behind each Auto Mode NodePool |
argoproj.io | applications | The repository and path that deploy each workload |
kustomize.toolkit.fluxcd.io | kustomizations | The path that deploys each workload |
source.toolkit.fluxcd.io | gitrepositories | The repository behind each Flux Kustomization |
serving.knative.dev | services, revisions | A KNative Service and its revisions, so a recommendation edits the Service |
kro.run | resourcegraphdefinitions, list only | Which instance field sets each container's requests and limits |
kro.run, and each group in kro.instanceGroups | every resource, get only | The instances that rendered a workload, so a recommendation edits the instance. Instance kinds are each organization's own, so the rule names the API group |
Resources from Karpenter, EKS Auto Mode, KEDA, the Vertical Pod Autoscaler, Argo CD, Flux, KNative or kro are read only when those tools are installed. Of kro's, the agent reads only the ResourceGraphDefinitions and the instances that rendered one of the cluster's workloads, at most 500 instances per hourly summary. The agent works without any of them.
Agent 0.3.0 added the events and storageclasses rows, and agent 0.4.1 the resourcequotas, limitranges and nodeclasses rows. Upgrading the chart adds them to the ClusterRole, still with read verbs only.
What it sends
The agent sends a usage summary once an hour and a short status check every few minutes. It samples usage every 30 seconds and sends percentiles, never the raw samples.
- Cluster: name, Kubernetes version, cloud provider and region. The cluster's identity is the UID of its
kube-systemnamespace. - Namespaces: name, labels, creation time.
- ResourceQuotas: for each quota, its name and namespace, and the hard and used values of requested CPU and memory, CPU and memory limits, and pods.
- LimitRanges: for each LimitRange with a
Containeritem, its name and namespace, and that item's minimum, maximum, default limit and default request for CPU and memory, and its maximum limit-to-request ratio. - Nodes: name, instance ID, instance type, zone, architecture, capacity type (Spot or On-Demand), node pool or node group, labels, capacity and allocatable CPU, memory, ephemeral storage, GPU and pod slots, CPU and memory usage, the node and image filesystems at their fullest (capacity, used, available, inodes), the process limit and the most processes running at once, how long it was Ready, evictions on it, bytes received and sent on its physical network interfaces, how long it was under memory, disk or PID pressure, its taints, whether it is cordoned, when its deletion started, and whether it is annotated
karpenter.sh/do-not-disrupt: "true". Each node also comes with its manifest askubectl get node -o yamlprints it, cut down to its name, creation time, labels, the annotations listed below, provider ID, taints, whether it is unschedulable, capacity and allocatable, its conditions (type, status, reason, message cut at 512 characters, and when it last changed) and its node info (kubelet and container runtime versions, OS image, kernel version, operating system and architecture). The manifest leaves out the node's addresses, images, volumes,managedFields, machine ID, system UUID, boot ID and each condition's heartbeat time. - Pods: every pod running or waiting to be scheduled at the end of the hour, with its namespace, name, node, owning workload, whether a controller owns it, its priority class, and the CPU and memory it reserves on its node (the larger of its containers' sum and its largest init container, plus pod overhead). Its scheduling rules: required node selector and node affinity terms, required pod anti-affinity (topology key and label selector), topology spread constraints set to
DoNotSchedule(topology key, max skew and label selector), tolerations, and which kinds of node-local storage it mounts (emptyDir on disk, hostPath, local volume). Three annotations leave the cluster as yes-or-no values, never as text:karpenter.sh/do-not-disrupt,cluster-autoscaler.kubernetes.io/safe-to-evict, andkubernetes.io/config.mirror, which marks a static pod. - Workloads: kind, name, namespace, replica counts, pod template labels, how long its pods ran on each node, how long they waited as Pending, evictions, bytes received and sent by its pods (and sent per node), the bytes its pods hold in disk-backed emptyDir volumes, overall and the largest pod per node (secret, configMap, projected and downward API volumes are never counted), whether it runs on the host network, whether topology spread or pod anti-affinity is set, and four annotations:
meta.helm.sh/release-name,meta.helm.sh/release-namespace,argocd.argoproj.io/tracking-id, and any key underlevelfour.ai/. - KNative: each Service as one workload across its revisions, its traffic split and its
autoscaling.knative.dev/*annotations, and each revision's generation, readiness, share of traffic, replicas, and container requests and limits. - kro: the instance that rendered a workload, and for that instance the ResourceGraphDefinition expressions that set its containers' requests and limits, with the instance's current value at each field they read. Nothing else from the instance's spec.
- Containers: name, image, whether a platform such as KNative added it, requests and limits as the workload's spec sets them and as its running pods held them for most of the hour (the two differ after an in-place resize or a mutating webhook; the agent reads the second from the kubelet's report of the resources in force, or from the pod's own spec), CPU, memory and ephemeral storage usage percentiles, restarts, OOM kills, the share of time its CPU was throttled, and whether liveness, readiness and startup probes are set. For a JVM, the heap settings described below. With a DCGM exporter in Prometheus, also GPU utilization percentiles, the most GPU memory it held, and the memory of the GPUs it was given.
- Volumes: name, namespace, phase, storage class, access modes, requested, provisioned and used size, the volume ID, and which workloads mount it.
- StorageClasses: name, provisioner, whether it allows volume expansion, reclaim policy, volume binding mode, its
typeparameter, and whether it is the default class. - Autoscaling: HPA and KEDA targets and replica bounds, the lowest, highest and average replicas over the hour and the time spent at the maximum, VPA update mode, its container policies (which requests it writes on which container) and its current CPU and memory recommendation per container (target, lower and upper bound, uncapped target), PodDisruptionBudget rules with their label selector expressions, how many disruptions each allows right now and how many healthy pods it has and wants, and Karpenter NodePool requirements (with their minimum values), limits, consolidation settings, node expiry, the taints and labels it gives its nodes, the API group and kind of the NodeClass it uses, its own labels, and the same four annotations as workloads. For an EKS Auto Mode NodeClass: its IAM role, ephemeral storage size, IOPS and throughput, network policy and network policy event logs, SNAT policy, and how many subnet and security group selector terms it has, never the terms themselves.
- Karpenter: the controller's version, from its image tag, and its feature gates, from the
FEATURE_GATESenvironment variable on the controller container. - JVM heap: the maximum heap, the maximum heap as a share of the memory limit, the initial heap, and where the winning setting came from. The agent reads only
-Xmx,-XX:MaxHeapSize,-XX:MaxRAMPercentage,-Xmsand-XX:InitialHeapSize, in the container's command and arguments and in the literal values ofJAVA_TOOL_OPTIONS,JDK_JAVA_OPTIONS,JAVA_OPTSand_JAVA_OPTIONS. Only the numbers leave the cluster, never the text of the command or the variables. A variable set from a ConfigMap or a Secret stays unread, because the agent cannot read either, and its heap reads as unknown. - Node events: events on nodes and NodePools with one of these reasons:
SpotInterrupted,SpotRebalanceRecommendation,CapacityReservationInstanceInterrupted,InstanceStopping,InstanceTerminating,InstanceUnhealthy,TerminatingOnInterruption,Unconsolidatable,DisruptionBlockedandDisruptionTerminating. For each: the object's kind and name, its NodePool, the reason, the count, the first and last time, and the message cut at 512 characters. - GitOps sources: for Argo CD Applications and Flux Kustomizations, the repository URL, path, revision and values files.
Agent 0.3.0 added the pods, StorageClasses, Karpenter and node events above, and the node taints, cordon, deletion and do-not-disrupt fields, the PodDisruptionBudget status and selector expressions, and the NodePool expiry, minimum values, taints, labels and annotations.
Agent 0.4.1 added the ResourceQuotas, LimitRanges and JVM heap above, the NodeClass each NodePool uses, and the EKS Auto Mode NodeClasses.
Agent 0.6.1 added the requests and limits each container's running pods held, and each node's manifest.
What it never reads or sends
The agent cannot read, because its role grants no access:
- Secrets.
- ConfigMaps.
The agent reads pod specs to find requests, limits and scheduling rules, and reads StorageClasses and events too. It drops these before sending:
- Environment variables, command and arguments. The exceptions are
FEATURE_GATESon Karpenter's controller container, and the JVM heap numbers parsed from the settings above. - Every annotation outside the ones listed above. Some annotations, such as
kubectl.kubernetes.io/last-applied-configuration, hold a full manifest. - StorageClass parameters other than
type, such as an encryption key ID. - Every event outside the reasons listed above.
- KEDA trigger settings other than CPU and memory targets. Other triggers can name hosts and queues.
- Probe settings. Only whether each probe is set leaves the cluster, because an exec probe's command can hold a secret.
It never collects logs, packets or request contents. Network data is byte counts only. The agent alone never learns where traffic goes. With the netflow component, a destination reaches LevelFour as a workload name, a zone, node, or the class private or internet, never as an address.
Network
| Direction | Destination | Purpose |
|---|---|---|
| Outbound | api.levelfour.ai, port 443 (HTTPS) | Sends the usage summary and status check |
| In cluster | The Kubernetes API | Reads the resources in the permissions table |
| In cluster | Each node's kubelet, port 10250 | Reads usage through nodes/metrics and nodes/stats |
| In cluster, optional | Your Prometheus | Reads usage history, when you set prometheus.url |
| Outbound, optional | api.levelfour.ai, port 443 (HTTPS) | With metrics.costs.enabled, the agent's ingest token also reads this cluster's cost once an hour for the cost metrics. A cluster token reads its own cluster only, and an install key only the clusters it registered |
| In cluster, optional | Each netflow pod, at its node's own address on netflow.port (9188) | Reads the bytes by destination with the netflow token, when netflow.enabled is on |
The image comes from public.ecr.aws/levelfour/k8s-agent, built for linux/amd64 and linux/arm64. Each release is signed, and Verify the signatures and SBOM shows how to check it.
What LevelFour reads from your AWS account
For an EKS cluster in an AWS account you connected, LevelFour also reads the cluster's configuration from AWS, every 6 hours, through the same role the account connected with. The agent plays no part in it.
LevelFour finds the cluster on your bill first. EKS bills each cluster's control plane every hour under the cluster's ARN, arn:aws:eks:<region>:<account>:cluster/<name>, so LevelFour matches a cluster by its name, or by the account its nodes' instances bill to.
It then reads, all read-only:
eks:DescribeCluster: status, version and platform version, creation time, endpoint, IAM role, OIDC issuer, authentication mode, upgrade policy, networking (VPC, subnets, cluster security group, public and private endpoint access, IP family, service CIDR), which control plane logs are on, tags and health issues.eks:DescribeClusterVersions: the version's standard and extended support dates, and the newest version.eks:ListAddons,eks:DescribeAddonandeks:DescribeAddonVersions: each add-on, its version and the newest one for the cluster's version.eks:ListInsights: the upgrade insights EKS raises.eks:ListAccessEntriesandeks:ListPodIdentityAssociations: who has access, and which service accounts take an IAM role.eks:ListNodegroupsandeks:ListFargateProfiles: the managed node groups and Fargate profiles.
AWS's ReadOnlyAccess policy grants every one of these (eks:Describe* and eks:List*), and LevelFour's onboarding role carries it. A call your role refuses leaves that part unread and names the IAM action to grant. While a cluster runs on extended support, LevelFour prices it from the extended support hours on your own bill, never from a list price.
Footprint
One replica with requests of 100m CPU and 256 MiB of memory, and limits of 500m CPU and 512 MiB. It runs as a non-root user with a read-only root filesystem and every Linux capability dropped. It exposes its own Prometheus metrics on port 9090 at /metrics, inside the cluster only. With metrics.costs.enabled, that port also serves this cluster's cost, to anyone in the cluster who can reach it.
The netflow component
With netflow.enabled, the chart adds a DaemonSet with its own service account. Each netflow pod reads its node's connection tracking table (conntrack) over netlink every 10 seconds, or every ten times as long as its last read took when that is longer, and turns each connection's byte counters into what each side sent since the last read. It watches only the pods on its own node, names the workload that sent each connection, and keeps per-minute totals for 3 hours for the agent to read.
A receiver with a public IPv4 address counts as internet, and the netflow pod drops the address at once. Every other receiver, a private IPv4 address or any IPv6 address that is not loopback or link-local, keeps its address only as far as the agent, inside the cluster. The agent names it from the pods and nodes it already watches: a pod becomes its workload and zone, a node becomes node, and an address it does not know becomes private inside a private range and internet outside one. No address reaches LevelFour. A node the agent cannot read is named in its status check with what went wrong, never with an address, and the agent's other status errors drop addresses the same way.
| Part | Privilege | Why |
|---|---|---|
| Pod | hostNetwork: true | The conntrack table belongs to the node's network namespace |
netflow container | Runs as root with NET_ADMIN only. Every other capability dropped, no privilege escalation, read-only root filesystem | Reading conntrack over netlink takes CAP_NET_ADMIN, and Kubernetes grants an added capability only to a process running as root |
enable-accounting init container | Privileged, runs once and exits | Conntrack keeps byte counters only when net.netfilter.nf_conntrack_acct is 1, and only a privileged container can write /proc/sys. It writes that one setting |
| Service account | get, list and watch on pods (it lists only its own node's); get on ReplicaSets and Jobs | To name the workload that sent each connection, and a pod's ReplicaSet or Job as its Deployment or CronJob |
nf_conntrack_acct is a node setting and stays on after you uninstall. A connection already open when the netflow pod starts reads zero until it reconnects. If a node turns it off again, or its reads start failing, the agent names that node in its status check.
Each netflow pod listens on its node's own address (status.hostIP) at netflow.port, not on every interface of the node. Its answers hold private addresses, so it answers only a request carrying a token: the chart generates one in a Secret of its own, or reads yours from netflow.existingSecret, and mounts it in the netflow pods and the agent. /healthz stays open for the kubelet's probes, and fails once three read intervals pass without a successful read.
Each netflow pod requests 50m CPU and 32 MiB of memory, with limits of 200m CPU and 256 MiB. It holds about 1 KiB per connection its node tracks, on top of about 30 MiB, and its GOMEMLIMIT follows the container's memory limit, so the default fits about 200,000 tracked connections.
Configure the agent
Chart values for the LevelFour agent, and how to read Prometheus history, publish cost metrics, measure network by destination, send through a proxy, pull from a private registry and verify the release signatures.
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.