Zoorik cloud cost assessment
Zoorik's free cloud cost assessment. One command reads your AKS and EKS clusters and the VMs, disks, load balancers and other resources of your Azure and AWS accounts, and estimates how much you could reduce your cloud cost. It sends nothing anywhere: it writes one PDF report for you to email to founders@zoorik.com.
npx zoorik assess
Or with pip: pip install zoorik, then zoorik assess. Either way it needs Python 3.8 or later. It runs in your terminal on Linux, macOS or Windows (PowerShell or Command Prompt), or in Azure Cloud Shell or AWS CloudShell, which already have everything it calls.
What the assessment covers (PDF) lists every saving it counts.
- Where to run it
- What it counts
- What it reads
- What it costs to run
- What it changes
- What it sends
- What it writes
- Options
- Access it needs
- How the estimate works
- What is not in the saving
- Where the figures come from
- Next steps
The assessment is the zoorik Python package in this repo, and it uses only the standard library. The npm package installs this same package from PyPI and runs it. Every release of both is built from a release tag of this repo by its release workflow, so the code you read is the code that runs.
Where to run it
- Azure Cloud Shell (Bash) or AWS CloudShell: they have Python, the cloud's CLI, signed in, and
kubectl. - Any other terminal: it needs Python 3.8 or later, the
azorawsCLI, signed in, andkubectlfor the clusters. An AKS cluster that signs in with Entra ID also needskubelogin;az aks install-cliinstalls both.
It reads every cloud whose CLI is signed in:
- Azure: every enabled subscription in the Azure directory (tenant)
azis signed in to. The report names the subscriptions of other directories. To include one, runaz login --tenant <tenant-id>, then run the assessment again. - AWS: every enabled region of the account
awsis signed in to.
A cloud whose CLI isn't installed is skipped. A CLI that is installed but can't read, for example because it isn't signed in, is named with the reason. With neither CLI installed, the run says so and stops.
Where it finds clusters, a run takes a little over 5 minutes, because it samples their usage for 5 minutes. Many clusters, VMs or regions take longer, and so does the read inside VMs if you answer y to it. It runs at most 16 programs (az, aws and kubectl) at once.
Both Cloud Shells close a session after about 20 minutes without a key press, even while the run goes on. In a Cloud Shell, the run reminds you at the start: press Enter now and then until the report's path appears, and if the run asks about disks first, answer it y or N, since Enter alone answers N.
What it counts
The report has two parts, both in US dollars a month at public list prices. The second is worked out on what the first leaves and has a total of its own: the two are never added together. An assumption that a figure rests on stands beside it. How the estimate works has the rules.
What Zoorik's products save. Direct means that the product makes the change, and indirect that the cost goes with a change the product makes.
| Saving | What changes | How |
|---|---|---|
| Smaller pods, spare machines and one big pool | Each container asks for its peak use × 1.1, and the pods run on as few of the cluster's machines as hold them, whatever their pools (steps 1 to 3) | direct |
| Cheaper machine types | The machines become the cheapest mix of types that holds every app (step 4) | direct |
| Start-up containers | They ask for no more than their app needs once it runs (step 5) | direct |
| Pods that nothing recreates | They move too, so their machines can go (step 6) | indirect |
| Fewer copies at quiet times | An app with 3 or more copies and no autoscaler runs 2 for 12 hours a day (step 7) | direct |
| Autoscalers at quiet times | Those that nothing else sets go to a minimum of 2 for 12 hours a day (step 8) | direct |
| Machine disks on gp3 | An EKS machine's own gp2 volumes become gp3 ones, where that costs less (step 9) | indirect |
| Spot | 20% of the machines, rounded up, run on spot (step 10) | direct |
| VM data disks into one pool | A VM's data disks become a pool of the size that what they hold needs | direct |
What you can save with a few manual steps. The report lists every thing that a row counts, with its dollars.
| Saving | What you do |
|---|---|
| Broken pods, and jobs for the hours they run | Delete the apps whose every pod is broken, or scale them to 0, and run each scheduled job in a pool that scales to 0 between its runs |
| Autoscalers in Git, Helm or KEDA | Set each minimum to 2 in its own file |
| Spare Windows machines | Scale the Windows pools down |
| Cheaper GPU machines | Add a pool of a cheaper type and move the GPU apps to it |
| ARM machines | Build the images for arm64 too, and add an ARM pool |
| Non-production off at nights and weekends | Set a start and stop schedule |
| A 1-year commitment | Buy reservations (Azure; a savings plan for the sizes that have none) or a Savings Plan (AWS) for the machines that run all day |
| Cluster fees | Move a control plane to a cheaper tier |
| Support fees | Upgrade a cluster to a Kubernetes version in standard support |
| Shared load balancer (EKS) | Give the Ingresses that can share a load balancer one group |
| Fargate pods made smaller (EKS) | Lower each app's requests and limits in its file |
| Machines that never joined, clusters with no apps | Delete them |
| Disks attached to nothing | Delete them |
| Cheaper disk types | Change each disk's type, IOPS or MB/s |
| Cheaper disks with a 99% speed promise | Change each disk's type |
| Stopped VMs still billed (Azure) | Deallocate them |
| Cheaper VM types | Resize each VM |
| ARM VM types | Rebuild each VM from an arm64 image |
| Unused resources | Delete what nothing uses: IP addresses, load balancers, gateways, VPN connections, firewalls, App Service plans and reservations of machines |
What it reads
Clusters
Every AKS cluster in the subscriptions it reads, and every EKS cluster in the regions it reads. How a cluster is read is decided from its settings:
- AKS, from
az aks listin each subscription:- a cluster whose API server is private, or limited to authorized IP ranges, is read through
az aks command invoke(see What it changes); - every other cluster is read with kubectl, through the credentials
az aks get-credentialswrites to a temporary kubeconfig. For a cluster that signs in with Entra ID,kubelogin convert-kubeconfig -l azurecliconverts that kubeconfig first; - a stopped cluster, and one whose record can't be read, is named as not assessed.
- a cluster whose API server is private, or limited to authorized IP ranges, is read through
- EKS, from
aws eks list-clustersin each region:- an active cluster, or one being updated, is read with kubectl, through the kubeconfig
aws eks update-kubeconfigwrites to a temporary file; - a cluster in any other state is named as not assessed;
- a cluster whose API server doesn't answer is named as not assessed. When its endpoint is private only, the reason says to run the assessment from inside its VPC.
- an active cluster, or one being updated, is read with kubectl, through the kubeconfig
In each cluster it lists, 500 at a time: nodes, pods, ReplicaSets, Jobs, PersistentVolumeClaims, PersistentVolumes, CSINodes, LimitRanges, HorizontalPodAutoscalers, CronJobs and namespaces. It keeps only these fields:
- nodes: name, labels, provider id, taints, capacity, allocatable, kubelet version and when it was made;
- pods: name, namespace, controller, phase, node, overhead, node selector, required node affinity, required pod affinity and anti-affinity, tolerations, topology spread, volume claims (an ephemeral volume's by the volume's name), whether it has a device claim, the pod's requests and limits, and each container's and init container's name, requests, limits and host ports (and an init container's restart policy). Also when its machine took the pod on and, of each container and init container, how often it has restarted and, when it waits to run, the reason's name. Of the labels, only the keys that a required placement rule of any pod uses, and
addonmanager.kubernetes.io/mode. Of the annotations, onlyCapacityProvisioned, the size AWS Fargate gave the pod. Pods that have ended (Succeeded or Failed) are left out; - ReplicaSets and Jobs: name, namespace and controller. Of a Job, also when it started, and of each of its conditions the type, whether it holds and since when;
- volume claims and volumes: names, the claim's namespace and volume, the volume's id, zone and region labels, node affinity, CSI driver and disk type;
- CSINodes: each node's CSI drivers and their attach limits;
- LimitRanges: namespace, type, min, max and maxLimitRequestRatio;
- HorizontalPodAutoscalers: namespace, the kind and name of the object each one scales, its minimum, its metrics' types, its policy to scale down, the label
app.kubernetes.io/managed-by, and whether it has an owner, or a label or annotation of Argo CD, Flux, Helm orkubectl apply. Of each program that wrote it, the name, whether it updated or applied it, and whether the minimum is as it wrote it; - CronJobs: name, namespace, schedule and whether it is suspended;
- namespaces: name and labels.
A cluster whose nodes, pods, ReplicaSets or Jobs can't be read is named as not assessed. It is assessed without the other kinds, and the report gives the reason:
- without its volume claims, its volumes or its CSINodes, every pod with a volume claim stays on its machine;
- without its LimitRanges, its pods keep today's requests (no steps 1 and 5);
- without its HorizontalPodAutoscalers, no app runs fewer copies at quiet times (no steps 7 and 8);
- without its CronJobs, no scheduled job counts for the hours it runs, and each of your namespaces may have one;
- without its namespaces, every app on it is taken for production.
It never reads Secrets or ConfigMaps, and it never keeps env values, images, commands, pod IPs or what any other annotation says.
Usage, with kubectl top pods -A --containers: one sample at the start, then one every 30 seconds for the sample window (5 minutes, or --sample-minutes). It keeps each container's peak. A sample that fails or gives no answer in time is skipped, and so is a line that isn't a container's CPU and memory.
EKS nodes whose labels don't give their pool or how they are bought (self-managed nodes): aws ec2 describe-instances gives each one's Auto Scaling group and whether it runs on spot.
Machine types, for each region with a cluster whose machines can have a price, without those whose record can't be read: for AKS, the VM sizes Azure Compute offers your subscription there (name, the vCPUs each runs, memory, CPU architecture, premium disk, Ultra Disk and encryption-at-host support, room for an OS disk on local storage, data-disk slots, GPUs and zones); for EKS, aws ec2 describe-instance-types (vCPUs, memory, architectures, virtualization types, GPUs, network interfaces, instance store and EBS limits) and aws ec2 describe-instance-type-offerings (the zones that offer each type).
The machines' own disks:
- for AKS, Azure Resource Graph gives the OS disk of every VM and scale set instance in the subscriptions: its kind and size, whether it is local storage, and whether it is deleted with its VM;
- for EKS,
aws ec2 describe-instancesandaws ec2 describe-volumesof each region with a cluster give the volumes attached to each machine: their type, size, IOPS and throughput, and whether they are deleted with it. EC2 leaves the machines of EKS Auto Mode out of its lists, so those and their volumes are read by their ids.
What keeps a machine charged for while it doesn't run: for AKS, which pools are on reserved capacity or dedicated hosts, from the same az aks list; for EKS, each instance's tenancy and capacity reservation, from the same aws ec2 describe-instances.
The fees a machine pays:
- for AKS,
az restgives each subscription's plan of Microsoft Defender for Containers: whether it is on, and what is left of its trial. A cluster's record says whether it is of AKS Automatic; - for EKS, a node's labels say whether EKS Auto Mode runs it.
What a Windows machine pays for, in a cluster that has one:
- for AKS, the cluster's record gives the Windows licence its machines use, and Azure Resource Graph its subscription's offer;
- for EKS,
aws ec2 describe-instancesgives what is charged for each machine.
Whether an AKS cluster takes ARM machines: its record gives its Kubernetes version, and whether Defender for Containers's sensor is on.
Machine prices, each region's list, for today's machines and the types that step 4 and the rows of GPU and ARM machines compare, at the regular price and at spot: for AKS, the public Azure Retail Prices API (prices.azure.com); for EKS, the AWS Price List API and the region's EC2 spot price history, through aws. The machines' own disks are priced from the lists the disk part uses, and their fees from the same two price lists. Fargate's prices of a vCPU and of a GB of memory come from the AWS Price List API, for each region where a pod on Fargate would be smaller.
What each cluster pays for itself:
- AKS: the cluster's tags, pricing tier, support plan, the number of machines of its pools and whether each is a scale set, whether node auto-provisioning makes its machines, and whether a change is running on it, from the same
az aks list; the tags of its resource group and its subscription, and the subscription's offer, from Azure Resource Graph; - EKS: the cluster's tags, Kubernetes version, upgrade policy and control plane tier, from
aws eks describe-cluster; the support of each Kubernetes version, fromaws eks describe-cluster-versions; and, only for a cluster with a provisioned control plane, 14 days of the size of its database, from CloudWatch (etcd_mvcc_db_total_size_in_use_in_bytes, each hour's Maximum); - the list price of each fee in the cluster's region, from the same price lists.
The machines of each cluster's own pools, after its nodes:
- AKS: the VMs and scale-set instances of the cluster's node resource group that carry a pool's name, from Azure Resource Graph (id, size, power state, provisioning state, when each was created, priority and pool). The node resource group, and which pools are on spot or keep stopped machines, come from the same
az aks list; - EKS: the region's running instances that a node group, a NodePool or an Auto Scaling group started, from
aws ec2 describe-instances(id, type, how each is bought, when it was started, and tags); and, only when one of an Auto Scaling group has no node, which instances those groups have in service, fromaws autoscaling describe-auto-scaling-groups.
The load balancers of EKS clusters, in each region with an EKS cluster:
- the Application Load Balancers (state, scheme, network, zones, kind of addresses, security groups and when each was made) and their tags, from
aws elbv2; - only where two or more of a cluster could share one: each one's target groups, number of targets, listeners, certificates (their ARNs) and rules, and your account's quotas, from
aws elbv2; its web ACL's ARN, fromaws wafv2; the region's security groups (tags and inbound rules), fromaws ec2; its requests over 14 days, from CloudWatch (RequestCount, HTTP_Fixed_Response_Count and HTTPCode_ELB_3XX_Count, 4XX and 5XX, each day's Sum); and the list prices of an hour and of a capacity unit, from the AWS Price List API.
VMs and disks
Your VMs, and every managed disk and EBS volume, those of Kubernetes volume claims too. A VM that is an AKS or EKS node is counted with its cluster, and so are its own disks, so each cost is counted once.
Azure:
- Azure Resource Graph: your VMs, with their tags and how each is bought, placed and set up; your scale sets, with the same, and which of them Azure Monitor autoscales; your managed disks, with their tags and what holds each; your resource groups and subscriptions, with their tags, each subscription's offer and which groups another Azure service manages; and which disks were attached or detached, and which VMs and scale sets took another size, in the last 14 days. The VMs in a resource group that an AKS cluster manages are its nodes.
- Azure Compute:
- each VM size's data-disk slots;
- each VM size's uncached disk IOPS and throughput limits;
- which zones offer Premium SSD v2 to your subscription;
- each VM size's vCPUs, memory, processor, speeds and features, whether it retires, and which zones offer it to your subscription.
- Azure Monitor: 14 days of IOPS and throughput for the data disks the pool would replace, on each VM whose disk usage was read, and for every other attached disk that a cheaper type may replace, as each hour's busiest minute and its average. The metrics are the VM's Data Disk Read/Write Operations/Sec and Bytes/sec at each disk's LUN, and its OS Disk ones, with the Maximum and Average aggregations, 20 VMs at a time, through Azure Monitor's batch read. The disks' own metrics are not used, since they are averages of whole hours. For each VM that runs, also Percentage CPU, Available Memory Bytes, Network Out Total and the temporary disk's operations a second.
- prices.azure.com: the public list prices of managed disks and VMs.
AWS, in each enabled region:
- EC2: your instances and EBS volumes, and the EBS limits of each instance type with data volumes (volume slots, baseline IOPS and throughput, whether its volumes are NVMe devices). For the types of your VMs, also each type's vCPUs, memory, processor, speeds and features, and which zones offer it (
describe-instance-type-offerings). An instance taggedeks:cluster-name,eks:eks-cluster-nameoraws:eks:cluster-name, or taggedkubernetes.io/cluster/<name>for an EKS cluster of its region, is an EKS node, and so is one that a node the run read says it is on. - Systems Manager: which instances its agent manages.
- CloudWatch: 14 days of IOPS and throughput for the data volumes the pool would replace, on each instance whose disk usage was read, and for every other attached volume that a cheaper type may replace, as each hour's busiest minute. The metrics are VolumeReadOps, VolumeWriteOps, VolumeReadBytes and VolumeWriteBytes, with the Maximum statistic over AWS's 1-minute data points, 25 volumes at a time. For each instance that runs, also CPUUtilization, NetworkIn and NetworkOut, and the CloudWatch agent's mem_used_percent where the agent reports it.
- EC2 Auto Scaling: the groups of your instances.
- The AWS Price List API: EBS and EC2 list prices, through
aws pricing get-products. - Savings Plans: the 1-year EC2 Instance Savings Plan price of each type that runs all day and that the Price List has no Reserved Instance of, through
aws savingsplans describe-savings-plans-offering-rates.
Unused resources
What may be charged for though nothing uses it.
Azure:
- Azure Resource Graph: your public IPs, load balancers, NAT gateways, VPN gateways and their connections, application gateways, firewalls and their policies, App Service plans, deployment slots and App Service Environments, and reservations of machines (capacity reservations) and their groups; the load balancers, application gateways and reservation groups your scale sets use; whether each virtual network has DDoS protection; which resource groups another Azure service runs, and whether an AKS cluster locks its own; and each subscription's offer. Of each it keeps only what says whether something uses it, and what it is priced by.
- Azure Compute: how many machines each reservation is charged for, and which VMs are in it. Only their numbers are kept.
- prices.azure.com: the public list price of each.
AWS, in each enabled region:
- EC2: your Elastic IP addresses, NAT gateways, route tables, Site-to-Site VPN connections and capacity reservations. Of a VPN connection it reads only the id, the state, the concentrator and how large its tunnels are, so the keys of its tunnels never reach the run.
- Elastic Load Balancing: your load balancers, of every kind.
- CloudWatch: for each one that may be unused, 14 days of a metric or two, by the hour: ConsumedLCUs and NewConnectionCount or NewFlowCount of a load balancer, HealthyHostCount and UnHealthyHostCount of a Classic Load Balancer, TunnelState of a VPN connection, and AvailableInstanceCount of a capacity reservation.
- The AWS Price List API: the list price of each, through
aws pricing get-products.
What you pay today
For each subscription and account with a cluster, a VM or a disk, what its machines and disks used and cost over the 30 whole days that end 3 days before the run, since the last days aren't all on a bill yet. It is read for the line With your current discounts, and to leave out of the 1-year commitment what your commitments pay for already.
- Azure: Cost Management gives, for each meter of your virtual machines and storage, the quantity, the cost in USD and whether a reservation or a savings plan pays for it.
- AWS: Cost Explorer gives, for each usage type and operation of your EC2 instances and for each usage type of their disks and network, the quantity, the cost, and whether a Reserved Instance or a Savings Plan pays for it.
What it costs to run
The assessment is free. Of what it reads, your cloud charges only for these:
| Read | List price | What a run asks for |
|---|---|---|
| CloudWatch's metrics | $0.01 for each 1,000 | 4 for each attached volume, 3 for each instance that runs and 1 more where the CloudWatch agent reports its memory, 5 for each load balancer that could be shared, 1 or 2 for each other resource that may be unused, and 1 for each provisioned control plane |
| CloudWatch's list of metrics | $0.01 for each 1,000 requests, after the account's first million of a month | which instances the CloudWatch agent reports the memory of |
| Cost Explorer | $0.01 for each request | 3 for the account, and 1 for each further page of an answer |
| Azure Monitor's metrics | $0.01 for each 1,000 calls, after the subscription's first million of a month | a call for every 20 VMs, or fewer, of a subscription's region |
So a run costs about 9 cents in an AWS account with 1,000 attached volumes and 500 instances: 6 for up to 6,000 metrics, and 3 for Cost Explorer.
With 20 clusters, 300 VMs and 17 AWS regions, a run makes about 500 calls of az, aws and kubectl, and 10 more in each cluster while it samples its usage for 5 minutes. The read inside VMs makes about 450 more.
What it changes
Apart from the two steps below, the assessment only reads, and it writes only the files under What it writes.
One short-lived pod, only in AKS clusters read through command invoke
An AKS cluster whose API server is private, or limited to authorized IP ranges, is read through az aks command invoke, one call per cluster. Azure starts a short-lived pod of its own in the cluster's aks-command namespace. The reads and the usage samples run in that pod, and the pod sends back only the fields above, the cluster's time and each container's peak, compressed. Azure's CLI stops waiting after 5 minutes, so the run then reads the command's result until it ends.
- Azure documents this pod as requesting 200m CPU and 500 MiB of memory. The report leaves it out.
- Azure records each call in the activity log.
- Azure keeps at most 512 KB of each call's output. A cluster whose answer is larger is named as not assessed, with the reason.
- A cluster with command invoke turned off is named as not assessed.
--no-invoke turns this off: those clusters are named as not assessed, with the reason.
One command inside each VM, only if you answer y
The disk saving needs the used space on each data disk, and only the VM itself can report that.
The run first finds the Linux VMs that are running, or whose state Azure doesn't report, that have data disks and pass its first checks. If there are any, it lists them, prints the command below, says how long it will take, and asks once for each cloud, before it reads inside any VM:
Read disk usage inside 3 VMs with Azure Run Command? [y/N]
Read disk usage inside 2 instances with Systems Manager Run Command? [y/N]
If you answer y, the command runs in each of those VMs, 8 at a time in each cloud. It reads:
- the kernel version;
- whether btrfs is available;
- which mounts sit on each data disk;
- used space, from
df.
On Azure, it runs through Azure Run Command (RunShellScript). On its side, Azure:
- adds its Run Command extension (RunCommandLinux) to any VM that doesn't have it yet;
- keeps a copy of the command and its output under
/var/lib/waagenton the VM; - records each run in the activity log.
On AWS, it runs through AWS Systems Manager Run Command (AWS-RunShellScript), only in instances Systems Manager manages. On its side:
- Systems Manager keeps the command and its output in its Run Command history;
- its agent keeps a copy under
/var/lib/amazon/ssmon the instance; - CloudTrail records each call.
If you answer anything else, or there is no terminal to ask on: nothing runs inside any VM. The report lists those VMs under Not in the saving yet, with the reason.
This is the command. The two clouds differ only in the fourth line, which finds the data disks:
echo S
echo "K $(uname -r)"
if grep -qw btrfs /proc/filesystems; then echo "B loaded"; elif modinfo -n btrfs >/dev/null 2>&1; then echo "B module"; else echo "B absent"; fi
for l in /dev/disk/azure/scsi1/lun* /dev/disk/azure/data/by-lun/*; do n=${l##*/}; n=${n#lun}; case $n in ''|*[!0-9]*) continue;; esac; echo "L $n $(lsblk -nro MOUNTPOINT "$l" | tr '\n' ' ')"; done | sort -u
timeout 30 df -P -B1 -l | awk '$1 ~ /^\/dev\// && $1 !~ /^\/dev\/loop/ {m=$6; for (i=7; i<=NF; i++) m=m" "$i; print "D", $3, m}'
echo E
On AWS the fourth line is:
for l in /dev/disk/by-id/nvme-Amazon_Elastic_Block_Store_vol*; do case $l in *-part*) continue;; esac; [ -e "$l" ] || continue; v=${l##*_vol}; echo "V vol-${v%%[-_]*} $(lsblk -nro MOUNTPOINT "$l" | tr '\n' ' ')"; done
Stopping a run
Ctrl-C stops the run at once, and nothing new starts after it. A command invoke or Run Command call already started finishes in the cloud. The run's last line says in how many clusters and VMs they had started, and where they show (the activity log, or the Run Command history).
What it sends
Nothing. There is no upload and no telemetry, and you send the report yourself. It switches off the Azure CLI's own usage telemetry for its calls, without changing your az settings. Its only calls go to:
- your clusters;
- your Azure and AWS APIs, through
azandaws; - the public Azure price list, which receives a region, and whether the run looks up machines, 1-year reservations, savings plans, managed disks or another service there;
- the AWS Price List API, through
aws, which receives a region code for each lookup, and the Savings Plans API, which receives a machine type and its region.
Cost Management and Cost Explorer, which are among your cloud's APIs, receive the days, the subscription or account and which lines of the bill the run asks for.
What it writes
One PDF report, zoorik-assessment-YYYYMMDD-HHMM.pdf (UTC).
- It goes in the current folder, or in the folder
--outnames, made if it is missing. The run checks that it can write there before it reads anything. - It never overwrites an earlier report: a second report in the same minute gets
-2,-3and so on. - Page 1 shows the saving, what it is worth with your current discounts where you have any, the monthly cost today, the cost after and the saving's share of the Kubernetes and disk cost, and one table with a line for each saving: which product makes it, whether it makes the change itself (direct) or the cost goes with a change it makes (indirect), and the assumption the figure rests on.
- A second table has a line for each thing you can save yourself with a few manual steps: what to do for it, the assumption it rests on, and its dollars a month. It has a total of its own, which is not added to the saving. After the Kubernetes and Disks pages, every cluster and other thing it counts is listed, with its dollars.
- The Kubernetes pages show each cluster's steps that save something, its node pools, its workloads and the apps that run fewer copies at quiet times; the Disks pages show each account's VMs. Then Not in the saving yet lists everything the run couldn't read or count, with the reason. What couldn't be read for a saving is listed there once, with each saving that lacks it.
- It names your subscriptions, AWS account ids, clusters, node pools, namespaces, workloads, VMs, disks and other resources, and in some reasons a mount point.
--anonymizehides them. - When the run finds no cluster machine or VM data disk with a list price, and nothing you could save yourself, it writes no report, and it prints why.
Working files: the temporary kubeconfigs, kubectl's cache, and on Windows any az argument that cmd.exe would change (az is a batch file there). They go in a temporary folder that is removed when the run ends, also when you stop it. Your own kubeconfig is left as it is.
Options
npx zoorik assess --anonymize
| Option | Effect |
|---|---|
--out PATH |
Write the report in this folder, made if it is missing (default: the current folder). |
--sample-minutes N |
Sample the clusters' usage for N minutes (default 5; 0 takes one sample). |
--no-invoke |
Never use az aks command invoke. The AKS clusters only it can read are named as not assessed. |
--anonymize |
Hide every name the report shows (subscriptions, accounts, clusters, node pools, namespaces, workloads, VMs, disks, other resources such as load balancers and IP addresses, and mount points) behind short hashes, salted for this run; in a reason, also what a failing command printed. Machine types, disk types and regions stay. The terminal still shows the real names. |
zoorik assess --help lists them, with what the run counts, and zoorik --version prints the version.
Access it needs
Without a permission the run goes on without what rests on it, and so it does when a cluster, a subscription, a region or a VM can't be read. The report lists each under Not in the saving yet, with the reason.
Azure:
- Reader on the subscriptions. It also covers Azure Monitor's batch read, the plan of Microsoft Defender for Containers (
Microsoft.Security/pricings/read) and the bill (Cost Management Reader covers that too). On an Enterprise Agreement the bill is read only where view charges is on. - The Azure Kubernetes Service Cluster User Role on each cluster read with kubectl.
- For
command invoke, alsoMicrosoft.ContainerService/managedClusters/runcommand/actionandMicrosoft.ContainerService/managedClusters/commandResults/read. - For the read inside VMs,
Microsoft.Compute/virtualMachines/runCommand/action. Virtual Machine Contributor has it.
AWS:
| What for | Permissions |
|---|---|
| the regions the account can use | ec2:DescribeRegions |
| the clusters and what they pay for themselves | eks:ListClusters, eks:DescribeCluster, eks:DescribeClusterVersions |
| machines, VMs, disks and their groups | ec2:DescribeInstances, ec2:DescribeVolumes, autoscaling:DescribeAutoScalingGroups |
| the types machines, VMs and disks may become | ec2:DescribeInstanceTypes, ec2:DescribeInstanceTypeOfferings |
| list prices and spot prices | pricing:GetProducts, ec2:DescribeSpotPriceHistory |
| what VMs, disks and other resources did in the last 14 days | cloudwatch:GetMetricData, cloudwatch:ListMetrics |
| load balancers | elasticloadbalancing:DescribeLoadBalancers |
| the load balancers that a cluster's Ingresses could share | elasticloadbalancing:DescribeTags, elasticloadbalancing:DescribeAccountLimits, elasticloadbalancing:DescribeTargetGroups, elasticloadbalancing:DescribeTargetHealth, elasticloadbalancing:DescribeListeners, elasticloadbalancing:DescribeListenerCertificates, elasticloadbalancing:DescribeRules, elasticloadbalancing:GetLoadBalancerWebACL, wafv2:GetWebACLForResource, wafv2:GetWebACL, ec2:DescribeSecurityGroups |
| unused resources | ec2:DescribeAddresses, ec2:DescribeNatGateways, ec2:DescribeRouteTables, ec2:DescribeVpnConnections, ec2:DescribeCapacityReservations |
| the bill (ReadOnlyAccess has it, ViewOnlyAccess doesn't) | ce:GetCostAndUsage |
| the Savings Plan price of a type that is sold as no Reserved Instance, as the newest are (ReadOnlyAccess has it, ViewOnlyAccess doesn't) | savingsplans:DescribeSavingsPlansOfferingRates |
| which instances can be read inside | ssm:DescribeInstanceInformation |
| the read inside instances, only if you answer y | ssm:SendCommand (on the instances and the AWS-RunShellScript document), ssm:GetCommandInvocation |
An instance that is read inside also needs the Systems Manager agent, registered with Systems Manager.
EKS clusters: an access entry on each cluster. The identity that created an EKS cluster usually has one already. For any other identity, choose one of these:
- Associate
AmazonEKSAdminViewPolicyat cluster scope. This policy can also read Secrets, but the run never asks for them. - Put a Kubernetes group in the access entry, and bind that group to the role below, which allows only
getandlist.
AmazonEKSViewPolicy is not enough: it can't list nodes or read metrics.
Inside each cluster: the identity needs get and list, cluster-wide, on what the run reads. If it doesn't have them, a cluster admin can create this role and bind it. Replace GROUP with the Kubernetes group from the EKS access entry, or with the Entra ID group's object ID on AKS:
kubectl create clusterrole zoorik-assess-read --verb=get,list --resource=nodes,pods,replicasets.apps,jobs.batch,persistentvolumeclaims,persistentvolumes,csinodes.storage.k8s.io,limitranges,horizontalpodautoscalers.autoscaling,cronjobs.batch,namespaces,pods.metrics.k8s.io
kubectl create clusterrolebinding zoorik-assess-read --clusterrole=zoorik-assess-read --group=GROUP
How the estimate works
Every figure is a month's, at list prices, and each dollar counts once. The first part comes first, and what it leaves is what the second part goes by:
- a cluster's machines count with their cluster, and are in no row of VMs;
- a data disk that a pool takes is in no row of disks, and a VM with such a pool keeps the speed of its disks;
- a machine that never joined its cluster, and a cluster with no apps, are in no other row;
- a load balancer that is to be shared isn't an unused one;
- a VM counts for a cheaper type first, then for an ARM type, then for the schedule and then for the commitment, each on what the one before leaves. One that gets a schedule is in no commitment.
Kubernetes
Each cluster's saving is worked out in steps. Each step works on what the step before left.
Machines and pools. Each node belongs to the pool that provisions it: its Karpenter NodePool, its AKS node pool, its EKS managed node group, or else its Auto Scaling group. Its machine type, zone, CPU architecture and operating system come from its labels, and whether it runs on spot from its labels or, for an EKS node whose labels don't say, from its EC2 instance. An AKS pool is a system pool when any of its nodes' labels says so. Fargate nodes, virtual nodes and the nodes AKS hosts in a subscription of its own (the managed system nodes of AKS Automatic) are not machines, and neither is a node that gives pods no CPU, no memory or no pod slots: they are counted, and their pods are left out. The pods on Fargate have a row of their own.
One big pool. A cluster is one pool of machines: an app may run on any of them. A node selector or required node affinity on a pool's name, or on a label that only its pools' machines carry, ties no app to a pool, and neither does a taint that all of a pool's machines carry. The report states this assumption beside the figure.
- What holds is the machine's own: its architecture, operating system and zone, its machine type's labels, how it is bought, the platform's own taints (a cordoned machine, spot on AKS, a GPU) and the cluster autoscaler's, and a label or taint that only some of a pool's machines carry. So do a pod's zonal and local volumes, disk tiers, host ports, spread, affinity and anti-affinity, and the machines' attach limits. A pod that must stay off every pool of a kind, as Karpenter's own pods must off its NodePools, stays off them.
- A machine with GPUs, a Windows machine and a machine with no list price stay as they are: they keep their pods and take no other.
- A machine on reserved capacity or a dedicated host is charged for without running too, so it stays, opens first and takes every app. It keeps its type and how it is bought. That holds for the rows that you can change yourself too. One that the run can't tell that of is like any other machine, but at nights and weekends.
- An AKS cluster with System node pools keeps at least one of their machines, which opens first and takes every app. Every other System machine is like any other machine. A pool may reach 0 machines, whatever its autoscaler's minimum.
Pods that stay where they are. DaemonSet and static pods count as each machine's overhead, with the attach slots of their volumes. These pods keep their machines in every step:
- a pod with a device claim, such as one for a GPU;
- a pod whose volume is bound to its node;
- a pod whose volume claim is not bound to a volume the run read, which is every pod with a volume claim where the cluster's volumes can't be read. Its machine takes no more volumes than the run knows on it today, since the slots the unknown one takes can't be known;
- a pod whose required pod affinity selects namespaces by label.
Step 1, smaller pods.
- Each container's request becomes its peak use × 1.1, at least 10m CPU and 32 MiB of memory.
- One rule both ways: a container that uses more than it asks for is raised, so the machines hold what the pods really use.
- Every replica of a workload gets one request per container, which holds its busiest replica.
- A raise has to fit the machines the pods run on today. Where the raised requests on a machine, with its DaemonSets', come to more than its allocatable, the workloads raised there keep today's requests. The workload table shows them as no room, and Not in the saving yet counts them.
- A request stays within the container's limit and its namespace's Container LimitRanges (min, max and maxLimitRequestRatio). A pod whose new total would break a Pod LimitRange keeps today's requests.
- Pod-level requests follow the pod's summed peaks, within its pod-level limits, and never go below what its containers then ask in all, which Kubernetes refuses. A pod whose containers would come to more than its pod-level limit keeps today's requests.
- Sidecars (init containers with
restartPolicy: Always) are sized like the other containers. Other init containers, the start-up containers, are step 5's. - A container with no usage reading keeps its request, and so do static pods and pods the platform puts back as they were (
addonmanager.kubernetes.io/mode: Reconcile). - The machines don't change in this step, so it saves nothing on its own: its saving shows in step 2.
Step 2, spare machines. Each pool's pods are packed onto as few of its machines as hold them, the machines that give the most room for their cost first. A machine's room counts up to what all the pods ask for.
- A pod goes only where Kubernetes would let it run: every resource it requests, its volumes' CSI drivers, their attach limits and their kinds of Azure disk (premium disks, Ultra Disk), its node selector and required node affinity, taints with the NoSchedule and NoExecute effects against its tolerations, topology spread with DoNotSchedule, required pod affinity and anti-affinity in both directions, host ports, the machine's operating system, CPU architecture and type labels, and its volumes' node affinity and zone and region labels.
- The pods that other pods limit (by required anti-affinity, or topology spread with DoNotSchedule) are placed first, then the largest, and a pod with required affinity after the pods it selects. Spread over machines counts the machines that stay, not those that go. A packing that would break the spread of a pod that an earlier one moved, and that it doesn't move again, is left out.
- A pod's spread, affinity and anti-affinity count the pods of DaemonSets too, on the machines that run them. A new machine (step 4) counts as running every DaemonSet, but a pod that needs one beside it goes there only when that one surely runs there.
- A pod that finds no machine stays on its own, which stays too, and the rest is packed again. So does a pod that the required affinity of a pod that stays needs beside it.
- The pods are packed again with the dearest machine as the last to open, type by type, for as long as that costs less. On a very large cluster that stops at a bound.
- A packing that doesn't cost less is not applied.
Step 3, one big pool. The same, over every machine of the cluster that isn't left as it is, whatever its pool, before and after step 4. A machine of today's that an earlier step removed may come back.
Step 4, cheaper machine types. The cluster's machines of one CPU architecture that are bought one way, regular or on spot, are a part, whatever their pools. Each part moves to the cheapest mix of machine types that the search below finds, when that costs less than the part after step 3. The packing follows step 2's rules, on new machines of each type in the part's zones.
- A candidate type has the part's CPU architecture, doesn't burst (Azure's B-series, AWS's burstable types), has no GPU (on Azure, isn't of the N-series), and is offered to your subscription or account in at least one zone the part uses. Its new machines go only there. A pod that spreads over zones takes a type only where it is offered in all those the pod may run in.
- A candidate is one that the cloud takes for the part's nodes, whatever their pools' settings, which the run doesn't read. On AKS it has at least 2 vCPUs and 4 GiB, has encryption at host, and isn't a confidential size (the DC-series and EC-series); where node auto-provisioning made one of the part's machines, it is no constrained or isolated size either. On EKS it boots hardware virtual machines (HVM) and isn't an a1; where EKS Auto Mode made one of the part's machines, it is one that Auto Mode makes.
- A new machine has the labels that all of the part's machines carry, but for those that hold a machine's name, its zone's own, the taints that all of the part's machines carry, and the cluster's DaemonSets, every one of them. The report shows the new machines as a node pool of their own, named one big pool.
- A pod that a type can't take stays on its machine, which stays too, and may move to another type. So does one that selects the machine's type (
node.kubernetes.io/instance-type) or a label that comes with it, one that requests a resource that comes with it, such as hugepages, one whose Azure disks need premium disks or Ultra Disk that the type doesn't take in its zone, and one whose rules read a label that a new machine may have or not. - What a new machine gives pods comes from your nodes: the least that any of the part's pools would leave on it. CPU is the type's vCPUs (on Azure, those the size runs, fewer than its parent's on a constrained size), less what your nodes have turned off. Memory is its listed memory, less what your nodes lack of theirs. Where each of a pool's nodes keeps exactly what the platform documents (AKS's reservation, Node Hardening's, or the EKS node images'; memory may be 1 MiB off, and on AKS before Kubernetes 1.29 1%), a new machine keeps what that says for its type. Where one doesn't, a new machine keeps the most any of the pool's nodes shows, scaled up with its size (an amount that a pool sets by a formula of vCPUs or in steps can't be followed). Pods are the fewest your nodes show, or on EKS the VPC CNI's figure for the type where your nodes follow it, at most 110 unless nodes of that size (below 30 vCPUs, or from there) show more. Ephemeral storage is the least your nodes show, at most 100 GiB on AKS, and 16 GiB on EKS where one of the types has instance store. A CSI driver's attach limit is the type's slots less the most your nodes hold back, and on EKS at most the smallest limit they show; a driver that one of a pool's nodes lacks isn't on its new machines. A part gets no step 4 only when that can't be told from any of its pools, because the region lists none of their machine types or none of their nodes gives its capacity, and the report says which.
- The search: each candidate gets a lower bound, what the machines that stay cost and its price × the machines the other pods need on their scarcest resource. Single types are packed in lower-bound order until the next lower bound reaches the cheapest cost found. A type that another covers (at least as much of every resource and disk slot, the same kinds of disk, in all its zones, for no more) is skipped, so types that give the same room at the same price count once. Then, from the cheaper of the part as it is and the cheapest single type, for each k the pods of its k least-full machines move to new machines of a type, packed in the same order and with the same stop, while its other machines keep their pods; and again from each mix it finds, until none costs less. A part's search makes at most 10 million checks of a pod against a machine. It doesn't try every mix, so a cheaper one may exist.
- A part on spot today is compared at spot prices, and its new machines are on spot.
- In an AKS cluster with System node pools, a new regular machine may be the System machine that stays, where the cluster has a System machine of its architecture today.
- The run doesn't read your vCPU quotas and the subnets' free addresses: a cheaper type may need a quota increase first.
Step 5, start-up containers. A pod reserves the larger of what it starts with and what it runs with, for as long as it runs. So a start-up container (an init container that isn't a sidecar) asks for no more CPU and memory than the pod's containers and sidecars do in all, less the sidecars that run beside it already. The machines are then packed, searched and packed again (steps 3 and 4).
- Its limit stays. Its request never goes up, and it stays within its namespace's Container LimitRanges. Where the pod's other containers ask for no CPU, or for no memory, nothing says how much of it is needed, so that request stays. A pod whose new total would break a Pod LimitRange stays as it is.
- The start-up containers of DaemonSets come down too, so a machine has more room for the other pods.
- A pod that step 1 didn't size stays as it is, since it may use as much as its start-up containers ask for: one with a container that has no usage reading, one whose raise has no room, one whose new size Kubernetes would refuse, a static pod, and one the platform puts back.
- It is done when a pod is created anyway, so nothing restarts for it. A pod that nothing recreates keeps its start-up containers' requests until step 6 has it created again.
- The report states the assumption beside the figure: a start-up step needs no more reserved than its app's running containers do; its limit stays.
Step 6, pods that nothing recreates. A pod with no controller keeps its machine in the steps before, since nothing would recreate it. Here it moves too, once: you create it again, its start-up containers come down (step 5), and the machines are packed, searched and packed again (steps 3 and 4). A pod that something else keeps on its machine, such as a volume bound to its node, stays. The report states the assumption beside the figure: you create these pods again once, and they then run on other machines.
Step 7, fewer copies at quiet times. Apps with copies to spare and no autoscaler run fewer of them for half of the hours, 12 a day, and today's count for the other half.
- An app is a Deployment or an Argo Rollout, and its copies are its pods the run read. StatefulSets, DaemonSets and Jobs stay as they are, and so does an app the platform puts back as it was (
addonmanager.kubernetes.io/mode: Reconcile). - An app with 3 or more copies and no HorizontalPodAutoscaler (one whose scale target is the app) runs 2 at quiet times. The copies kept are its first by name. Disruption budgets don't count.
- At quiet times the pods are packed onto as few of step 6's machines as hold them, by step 2's rules. A pod that stays on its machine needs no new spread when other copies stop.
- A cluster whose HorizontalPodAutoscalers couldn't be read gets no steps 7 and 8, and the report says why.
- The report states the assumption beside the figure: 2 copies hold each app for 12 hours a day.
Step 8, autoscalers at quiet times. The minimum of an autoscaler that only a person sets, by hand, becomes 2 for those 12 hours.
- The app runs as many copies fewer as the minimum is above 2: of 10 copies with a minimum of 4, 2 fewer. The copies above the minimum go on their own when it is quiet, so they are in no saving.
- An autoscaler that something else sets, or may set again, stays as it is: one with an owner (KEDA owns those it makes), with a tool's
app.kubernetes.io/managed-bylabel, or with a label or annotation of Argo CD, Flux, Helm orkubectl apply; one that a program wrote other than a console or akubectlcommand that changes an object once (kubectl applyandkubectl replacewrite what a file says); and one whose record doesn't say who set its minimum. So does one with a metric that Kubernetes doesn't take from the pods, one told never to scale down, and each of two on one app. - The report states the assumption beside the figure: a minimum of 2 holds each app for 12 hours a day.
Step 9, machine disks on gp3. On EKS, a machine's own gp2 volume becomes a gp3 one that does as much, where that costs less: one with the IOPS gp2 gives its size (3 a GB, at least the 3,000 it bursts to and at most 16,000) and its throughput (128 MB/s up to 170 GB, 250 above). A volume that EC2 keeps when its machine goes isn't in the machine's cost, so it isn't in this step either. The own volumes of a machine that a step adds cost on gp3 the most that those of a machine it can stand for do.
Step 10, spot. Of the cluster's machines, 20%, rounded up, run on spot all month: of 4 machines 1, of 10 machines 2, of 11 machines 3.
- All of the cluster's machines count, and those on spot today are among the 20%. The others are those where spot saves the most: the difference of a machine's two prices, for the hours it runs. Its disk and its fee stay.
- The last regular machine of an AKS cluster's System pools stays regular, at quiet times too. So does a machine left as it is, and one with no spot price below its own.
- Another machine takes the place of one that moves, so a machine with a pod that couldn't go there stays: one that asks for a machine that isn't on spot or for its own by name, one with a local volume or anything else that keeps it there, and one whose required pod affinity no pod meets where it is. Where an app has to spread, join or keep apart by how machines are bought, no machine of the cluster moves.
- When fewer than 20% run on spot because their types have no spot price, the report gives the reason.
- The report states the assumption beside the figure: 20% of the machines, rounded up, run on spot, the ones where it saves the most.
Costs.
- What a machine costs. Its hourly list price and its fees × 730 hours, and its own disks at their list price, before and after, so a fee and a disk go when the machine goes. On AKS that is its OS disk; on EKS, the volumes attached to it that aren't a PersistentVolume's. A disk that is local storage costs nothing. One that the cloud keeps when its machine is deleted is no saving.
- On AKS, a machine that a step adds has its pool's kind of disk, at the size of the pool's largest or, when it has more vCPUs than the pool's machines, at the size AKS makes a disk that nobody sized (128 GB below 8 vCPUs, 256 below 16, 512 below 64, else 1,024) if that is larger. Where all of a pool's disks are local storage, the new machine's is too if its type has room for it, and else it is a Premium SSD. A type whose own disk has no list price is no candidate.
- On EKS, a machine that a step adds has as much as the machine of its pool whose own volumes cost most, since EKS makes a pool's machines from one template.
- Where the new machine can belong to several pools, it has the dearest of their disks.
- A disk that the run can't read, or that has no list price, counts $0, and so do the volumes of a machine with a magnetic one, which also costs something for each request. Where none of a pool's disks is known, a new machine of AKS has the disk AKS makes by default, and no step leaves a cluster with more machines whose disk isn't known.
- The fees on AKS: Microsoft Defender for Containers, where the subscription's plan is on and its trial is over: its price for each of the machine's vCPUs. AKS Automatic's fee on a machine isn't counted, so no step leaves its clusters with more vCPUs; nor does one where the plan of Defender can't be read, or where its price can't.
- The fee on EKS: EKS Auto Mode's for the machine's type, on spot too. A type with no fee is no candidate where one of the part's pools is run by EKS Auto Mode. A machine whose fee the run can't read counts without it, and no step leaves a cluster with more vCPUs of such machines.
- A line (a pool's machines of one type, regular or spot) costs what its machines do, rounded to whole dollars. From step 7, half of those hours are the quiet hours, with the line's machines then. A line with no list price counts in no total, and the report names it with the reason.
- A step that would cost more than the state before it is not applied. So no step is negative, and the steps add up exactly to the cost today less the cost after.
- The workload table splits the saving of smaller pods, spare machines and one big pool (steps 1 to 3), by the CPU and memory each workload frees in step 1. A raised workload frees nothing, and neither do pods on a machine left as it is. The shares add up to that saving exactly, and are never added on top of it.
Prices are USD list prices:
- Azure: for each machine type in its region, the cheapest pay-as-you-go price above zero, and its Spot price, for a pool on Spot today and for step 10. A size whose record says that it has no Spot machines has no Spot price, though the price list has one for some. An item of the list that can't be read prices nothing, and neither does an old price that the list still holds beside the new one;
- AWS: on-demand, with shared tenancy and no preinstalled software, from the Price List; for a pool on spot today and for step 10, the average over the region's zones of each zone's latest spot price. A type with a spot price that can't be read has none;
- Windows: a Windows machine has the price of Windows, whose licence is in it. On Azure it has the price of Linux where its cluster uses a licence of your own (Azure Hybrid Benefit), or its subscription's offer includes Windows, as Dev/Test and Visual Studio ones do, or isn't known; and Defender for Containers' fee counts nothing on it. On AWS it is priced only where Windows alone is charged for it: with another licence, such as SQL Server's or one of your own, it isn't.
A machine of a cluster that runs neither Linux nor Windows is not priced. A machine whose labels don't give its type, or that doesn't say whether it runs on spot, is not priced, with the reason; nor is one of an EC2 Capacity Block, of an interruptible capacity reservation or of a scheduled instance.
Usage:
- Five minutes of samples can miss peaks. Use
--sample-minutesfor a longer window. - Without metrics-server there is no usage. The cluster's pods then keep today's requests, and the report says why.
What you can change on a cluster yourself
No step above changes these. Each is its own row, at list prices over 730 hours a month.
Broken pods, and jobs for the hours they run. An app whose every pod is broken does no work, so you can delete it or scale it to 0. A scheduled job (a CronJob) needs its machines only while it runs, so you can run it in a pool that scales to 0 between its runs. The report states the assumption beside the figure: the broken apps aren't needed, and each scheduled job takes as long as its longest kept run and an hour.
- A pod is broken when its machine took it on an hour or more ago, and one of its containers or init containers crashes again and again, or can't start. It crashes when it waits in CrashLoopBackOff and has restarted at least once for every ten minutes since then. It can't start when it has never run, and waits in ImagePullBackOff, ErrImagePull, InvalidImageName, ErrImageNeverPull, CreateContainerConfigError or CreateContainerError.
- A Job's pod, one with no controller and one that an operator runs may end, and a machine that came for it goes then and costs no more today. So it counts only on a machine that was made a day or more ago.
- An app is broken when every pod of it that the run read is, so one that is broken in part isn't counted. Neither are the platform's own pods (those of
kube-system, of the clouds' add-ons, and with the labeladdonmanager.kubernetes.io/mode) and static pods. - The broken apps leave the cluster as steps 1 to 6 leave it, and it is packed and searched again (steps 3 and 4) until that saves nothing more, each time only where the cluster costs no more after step 10. That is first done with them too, and what it saves then is in no row. A machine with a GPU, or on Windows, goes when only they were on it, unless it has no price or is of an AKS System pool. The saving is what the cluster costs after step 10 with them, less what it costs after step 10 without them.
- A CronJob counts when its pods are on the cluster's machines while it is read, since they count all month in the steps above. Its machines then run for part of the week: as many runs as its schedule starts, each as long as the longest run that the cluster keeps, and an hour more for a machine to come and go. Days of the month and months that the schedule leaves out aren't taken off.
- Its pods have the machines they are on to themselves for those hours, at those machines' prices, and the other apps are packed and searched again without them (steps 3 and 4). Step 10 doesn't count these machines among those that 20% of run on spot. A CronJob that saves nothing so, after step 10, stays as it is.
- These stay as they are too: a CronJob with a machine that was made less than a day before its run, since that may have come for it and cost no more today; one that is suspended, that has no run that completed, whose schedule can't be read, or whose machines would run all week; one with a run that goes on for longer than any that ended, since nobody knows how long it takes; and the platform's own. So does a pod that has to stay on its machine or be beside another pod, that asks for its machine by name, or that shares a volume with another app.
Autoscalers in Git, Helm or KEDA. Step 8 leaves an autoscaler whose minimum something else sets, since that would set it again. Where that minimum is kept, you can set it to 2. The report states the assumption beside the figure: 2 copies hold each app for 12 hours a day.
- It counts each autoscaler that step 8 leaves and whose minimum is above 2, by step 8's rule: at quiet times its app runs as many copies fewer as the minimum is above 2, beside the copies that steps 7 and 8 stop. What step 7 leaves as it is, such as a StatefulSet, stays so here.
- An autoscaler that is told never to scale down keeps its copies until you let it, and of two on one app you have to leave one: Kubernetes scales no app that two of them hold.
- The saving is what the cluster costs after step 10 as the row above leaves it, less what it costs after step 10 with these autoscalers at 2. A cluster whose HorizontalPodAutoscalers couldn't be read isn't in this row.
Spare Windows machines. The steps above leave a Windows machine as it is, so a Windows pool may have more machines than its apps need. You can scale it down.
- Each pool's pods are packed onto as few of its Windows machines as hold them, and then those of all the pools onto as few of them all, as in steps 2 and 3. A pod runs on its own build of Windows only. One that may not move keeps its machine, and so does one that nothing recreates.
- No Windows machine moves to another type or to spot, and none that has a GPU, or no price, is packed. One whose licence isn't priced is named.
- The saving is what the cluster costs after step 10 as the row above leaves it, less what it costs after step 10 with fewer Windows machines. Each pool's share goes by the CPU and memory of its machines that go.
Cheaper GPU machines. The steps above leave a machine with GPUs as it is, so its type may have far more CPU and memory than its apps need beside the GPU. You can add a pool of a cheaper type with the same GPUs and move the apps there.
- Each machine becomes the cheapest type that has the same GPUs, whole and as many of them, and the same CPU architecture, is offered where the machine is, and holds the machine's pods and DaemonSets. It stays in its pool, is bought as it is today, and keeps its pods and no others. On AKS, which GPUs a size has whole is as Microsoft's pages say it.
- A machine keeps its type when a pod on it may not move, has a volume or a rule that the new type doesn't meet, has no measured usage and asks for no CPU or no memory, or uses more than it asks for. No machine of a cluster changes where a pod spreads, joins others or keeps apart by a label that comes with the machine's type.
- A machine that gives pods another number of GPUs than its type has, because they are shared or split, keeps its type. One whose GPUs aren't known to be whole is named.
- The saving is what the cluster costs after step 10 as the row above leaves it, less what it costs after step 10 with the cheaper machines. Each pool's share goes by what its machines cost less.
ARM machines. An ARM machine (arm64) costs less than one on x86 (amd64) with the same CPU and memory. An app runs on it only where its images are built for arm64, which a cluster doesn't say. The report states the assumption beside the figure: every app's images have an arm64 build.
- The apps on the amd64 machines that steps 3 and 4 work on may then run on either. Each part of step 4 that is on amd64 may move to ARM types, by step 4's rules and bought as it is today, and the cluster is packed and searched again (steps 3 and 4) until that saves nothing more.
- An app keeps to the architecture that it asks for, and one that asks for its machine's type, or reads a label that comes with it, stays on that type. Where the part moves to one ARM type, such apps are also tried together, on as few of its machines as hold them, and other apps fill these up. A DaemonSet takes its room on an ARM machine as on any.
- A new ARM machine gives pods what step 4 says of its type, less 192 MiB and a 64th of its memory, since an arm64 system keeps more of it than an amd64 one.
- An ARM machine that the cluster has today may take such apps too, and its own keep to ARM. A machine with a GPU, on Windows or with no price stays as it is. No new ARM machine is the System machine that an AKS cluster keeps, unless it has an ARM one today.
- AKS takes no ARM machines on a cluster with Defender for Containers's sensor whose Kubernetes version is 1.29.0 or lower. Such a cluster is named.
- The saving is what the cluster costs after step 10 as the row above leaves it, less what it costs after step 10 with ARM machines.
Non-production off at nights and weekends. A cluster that isn't production, or the apps on it that aren't, with a start and stop schedule of 12 hours from Monday to Friday, is on for 60 of the week's 168 hours. The report states the assumption beside the figure: nobody uses them outside 12 hours on weekdays. The VMs that aren't production count in the same row.
- An app is production or not as its namespace's labels say; where they say nothing, its namespace's name; and then as its cluster does, by the words and the rule under Cluster fees. Of a label's key, the domain it starts with says nothing.
- An app goes off when a schedule can set its copies to 0: a Deployment, StatefulSet, ReplicaSet, ReplicationController or Rollout. One with a volume on its machine's own disk, where it would be lost, stays, and so do the platform's own pods. The other pods are packed onto as few of the machines as hold them for those hours (step 3), and a machine with a GPU goes when only these apps were on it.
- A whole cluster goes off when neither it nor any app or CronJob on it is production, no volume would be lost, and each of your pods has a controller that makes it again. One on which no app runs goes off when it says itself that it isn't production.
- AKS: it is stopped, and its machines' own disks are still charged for. Azure stops a cluster only when all its pools are scale sets and it has no node auto-provisioning. On any other, the apps go off.
- EKS: its pools are scaled to no machines. A machine in no pool is stopped, and keeps its volumes; one on spot in no pool stays on.
- A machine on reserved capacity or a dedicated host stays charged for, and so does one that the run can't tell that of. A scheduled job's machine keeps the hours it has in the row above, and what the cluster pays for itself isn't counted.
- What has run for less than a day may be off at nights already, so it isn't counted, and the report says so. That is a namespace's apps when no pod of theirs has run longer, and then the cluster doesn't go off whole, only its other apps do. It is a cluster when no pod of any app has.
- The saving is what the cluster costs after step 10 as the row above leaves it, less what it costs after step 10 with these hours off. So what it already saves at quiet times or on spot isn't counted again.
Cluster fees. The report states the assumption beside the figure: the standard or Free control plane is enough.
- AKS: a non-production cluster on the Standard tier could be on the Free tier, once the cost analysis add-on, if it is on, is turned off. An Automatic cluster can't be on the Free tier, and neither can one of more than 1,000 machines. A cluster on the Premium tier is under support fees instead.
- EKS: a cluster with a provisioned control plane could have the standard one, which its own hourly fee includes. EKS takes it back only while its database (etcd) holds at most 8 GB, so a cluster whose database was larger in the last 14 days is left out. So is one whose database's size wasn't read, and the report says why.
- A cluster is non-production when its tags or name say so, or else those of its resource group, or else those of its subscription, the nearest first, or else when its subscription has a Dev/Test offer. One that says nothing is production, and so is one that says both at the same level. A cluster on the Standard tier that says nothing itself is left out when the tags of its resource group or its subscription can't be read, and the report says why.
Support fees.
- EKS: a cluster whose Kubernetes version is in extended support, as EKS lists its versions on the day of the run, and whose upgrade policy keeps it there, pays the extended support fee. Upgrading to a version in standard support ends it. A cluster on such a version whose policy EKS doesn't give is left out, and the report says why.
- AKS: a cluster on the Premium tier with long-term support pays the Premium tier's price less the Standard tier's, whatever its version. On a version in community support, it can leave long-term support and move to the Standard tier.
A cluster pays these fees whether or not the run could read what is in it, so each one whose record was read counts. Left out are those the cloud takes no change of: an AKS cluster that is stopped or being deleted, and an EKS cluster that isn't active or being updated.
Machines that never joined, clusters with no apps. The report states the assumption beside the figure: nobody plans to use these clusters.
- A machine that never joined is a running machine of one of the cluster's own pools, node groups or Auto Scaling groups that started an hour or more ago and has no node. It counts at its own list price, without its disk. A machine in a warm pool, in the middle of a change, or on reserved capacity or a dedicated host isn't counted. Left out, and the report says why: the machines of a cluster with a change running on it, or with a node that doesn't say which machine it is, and those of an AKS pool that keeps stopped machines, which may be starting.
- A cluster with no apps runs only the platform's own pods (those of
kube-systemand of the clouds' add-ons), DaemonSets' pods and static pods. Outside the platform's namespaces it keeps no ReplicaSet or Job of a controller's, no CronJob, no volume claim and no HorizontalPodAutoscaler, so a Deployment at zero copies isn't taken for none. A StatefulSet at zero copies with no volume claim leaves nothing to see. It counts whole: its machines as the steps above leave them, less what reserved capacity and dedicated hosts cost without them, and what it pays for itself. No other row of this section counts it. A cluster whose volume claims, HorizontalPodAutoscalers or CronJobs couldn't be read is left out, and the report says why.
Shared load balancer (EKS). The AWS Load Balancer Controller, or EKS Auto Mode, makes an Application Load Balancer for each Ingress that is in no group. Those of a cluster that one load balancer can serve are put together on one, first fit, the one with the most rules first. That saves the hourly fee of each one that goes. The report states the assumption beside the figure: one set of load balancer settings does for all of them, each host name leads to one load balancer, and you move its DNS.
- Those that share one have the same scheme, network, kind of addresses and web ACL, and all are in the region's zones, in one Local Zone or on one Outpost. On a port several listen on, they have the same protocol, check of the client's certificate and sources let in, whichever security groups let them in. The other settings a load balancer has once, such as its name, tags, subnets, idle timeout, access logs and TLS policy, are taken to do for all of them: the controller refuses a group whose Ingresses say different things, so you give them one set.
- Every request gets the answer it gets today. Two that answer the same host on a port stay apart, where a wildcard, and one that takes any host, answers every host it fits. The exception is a host one of them names, with a rule for every path, and the other doesn't: they share when an order of the group puts the one that names it first. Two that redirect every request of a port to the same place go together. A redirect the controller makes with no rule takes every plain HTTP port of the group, so it needs the same redirect on each.
- The shared one keeps to your account's quotas of listeners, rules, certificates, target groups and targets, and to 2 listeners that check clients' certificates. A security group the controller makes for it holds 60 inbound rules, or as many as one of today's holds.
- Capacity units follow the traffic, except that each request may be tried on more rules, the first 10 of them free. Every request of the last 14 days is taken as tried on every rule of its port, and what that adds is taken off. For a load balancer made in those days, the whole days since are counted. One with none yet, or whose requests couldn't be read, shares only where no request of its own is tried on more than the free rules.
- An Ingress that is in a group shares already. The controller's and Auto Mode's don't share with each other. In Auto Mode, a group is set in IngressClassParams. Network Load Balancers can't be shared this way. Nothing is put together in a cluster that isn't active or being updated, since nobody can change its Ingresses.
Fargate pods made smaller (EKS). Fargate runs each pod at the first of its sizes that holds the pod's CPU, and its memory and 256 MiB more, and bills that size, whatever the pod uses. A pod's CPU or memory is the larger of what its containers ask for in all and the most that a start-up container asks for.
- The size today is the one Fargate gave the pod. The size after is the one for the requests that steps 1 and 5 would give it, and no pod is held back for room. An app that runs on machines too gets one request for all its pods, which holds the busiest one. The limits follow the requests. A pod whose use wasn't read keeps its size.
- A size costs its vCPUs and its memory at the region's list prices. A pod's storage isn't priced. An app saves what its pods cost less, and a pod of it that would be larger counts against that.
- An app keeps its number of copies. An autoscaler that follows its CPU or memory would add some once it asks for less, so its target is raised too.
- A pod counts when a ReplicaSet, a StatefulSet or a ReplicationController keeps it running. Left out, and the report says why: a Job's pod, one with no controller and one that an operator runs, because their hours a month aren't known, and a pod whose requests today lead to no size, or to one with less CPU or memory than it has, because its size after isn't known.
VM data disks into one pool
The run estimates a saving for each Linux VM whose disk usage was read: the data disks it can move to a pool of new disks that costs less.
- Used space is the space used on the data-disk mounts the pool takes. A shared disk (an Azure disk attached to several VMs, or an AWS Multi-Attach volume) is never pooled; it stays as it is.
- Mounts that share a data disk, directly or through others (several file systems on one disk, or one over several disks), move together, as one group.
- A group stays on its disks when one of its mounts is
/or a Kubernetes volume, or has no used space reported, or when one of its disks is shared, another AWS service's, or has no details, list price or metrics. An Azure disk that was detached from a VM in the last 14 days counts as one without metrics: they don't follow it to its new place. The pool takes the other groups. If no group is left, the VM is not estimated.
- Pool size:
- Azure: used + 20% of used (at least 50 GB), rounded up. Each mount is first rounded up to a whole GB.
- AWS: used × 1.03 (btrfs's own space), held at most 90% full and with at least 10 GB free, rounded up to whole GB. One reading has no growth or burst to add.
- Disk type:
- Azure: the pool goes on Premium SSD v2 where the VM's region and zone offer it, as Azure lists it for your subscription. A VM without a zone also needs a region where Microsoft supports nonzonal Premium SSD v2, and can't be in an availability set. Otherwise the pool goes on Premium SSD. Pool disks are locally redundant (LRS).
- AWS: the pool goes on gp3.
- Layout:
- Azure:
- The pool has 3 to 6 equal elastic disks. Pools of 512 GB and over also have 2 anchor disks.
- On a VM with few free data-disk slots, the pool has 1 anchor and up to 3 elastics.
- The pool is built beside today's disks, so it must fit the free slots, with one slot kept spare.
- A Premium SSD v2 pool adds one 8 GB disk.
- In a Premium SSD pool, each disk is a Premium SSD size, and elastics are at least 128 GB.
- AWS:
- The pool is 2 or more equal gp3 volumes, built beside today's volumes in the free volume slots, with one slot kept spare.
- It has as few volumes as the slots allow, each no larger than the instance can empty in 2 hours when it is 80% full, reading and writing that data at 30% of the instance's EBS throughput, unless the slots need larger ones.
- An instance's volume slots are its type's EBS attachment limit, less the root volume and, where the limit is shared, its network interfaces after the first, within the device names
/dev/sdfto/dev/sdz. A type that lists no limit has 28, less its first network interface and its NVMe instance-store disks too.
- Azure:
- Performance:
- The measured peak is the highest hourly figure of the last 14 days. Each hour's figure is its busiest minute (the Maximum), with reads and writes added and summed over the disks the pool replaces.
- Each Premium SSD v2 disk and each gp3 volume includes 3,000 IOPS and 125 MB/s.
- Azure: more is priced in only when the measured peak × 1.3, shared across the pool's disks, needs it. Even then it is never more than the VM itself can drive. A Premium SSD pool has the fixed IOPS and MB/s of its disk sizes, without bursting. If those together can't carry the measured peak × 1.3 (or what the VM can drive, if less), the next rule applies.
- AWS: each gp3 volume gets the measured peak × 1.3 shared across the pool's volumes, and at least the write peak × 1.3. It stays within what a gp3 volume of its size takes (500 IOPS per GB, up to 80,000; 0.25 MB/s per IOPS, up to 2,000) and within its share of what the instance can drive. If the volumes can't carry that, the next rule applies.
- Where the pool can't carry the load, the group of mounts with the highest peak IOPS (then MB/s) stays on its disks, and the pool is sized again for the other groups. Its disks count on neither side of the saving. If no group is left, the VM is not estimated.
- Saving per month = today's list price of the disks the pool replaces − the pool's list price. Where the pool costs no less, the VM is not in the saving.
- The disks' cost today covers every priced data disk of the VMs read, each disk counted once. A disk that stays as it is costs the same today and after.
Prices:
- Azure: the public Azure Retail Prices API, using pay-as-you-go USD list prices for each disk's region, read at run time. An old price that the list still holds beside the new one prices nothing.
- Premium SSD, Standard SSD and Standard HDD: priced by size tier. A Premium SSD set to a higher performance tier is priced at that tier.
- Premium SSD v2 and Ultra Disk: priced by provisioned GB, IOPS and MB/s, over a 730-hour month.
- AWS: the AWS Price List API, using on-demand USD list prices for each volume's region, read at run time. EBS charges by the month:
- gp3: its GB, the IOPS above 3,000 and the MB/s above 125;
- io1 and io2: their GB and every provisioned IOPS (io2 in bands);
- gp2, st1, sc1 and magnetic (standard): their GB.
btrfs is read from each VM's running kernel, not from its distribution. The stock kernels of Ubuntu, Amazon Linux 2023, Fedora and Oracle Linux's UEK carry it; those of RHEL, Rocky Linux and AlmaLinux 9, and Oracle Linux's Red Hat compatible kernel, do not.
Data disks without a mounted file system stay as they are.
A VM that needs a fix first, such as a kernel below 5.14 or Azure Disk Encryption, stays in the saving.
Units: GB means GiB (2^30 bytes), the unit both clouds size disks in. On Azure, MB/s means 10^6 bytes per second. On AWS, MB/s means MiB/s (2^20 bytes per second), the unit gp3 throughput is set in.
Disks attached to nothing
A disk that nothing holds saves its whole list price, with the tier, IOPS and MB/s set on it. The report states the assumption beside the figure: nobody needs what is on them.
- Azure: a managed disk whose state is Unattached. A deallocated VM's disk (Reserved), one that is uploaded to or exported, one that Site Recovery or Azure Backup writes to, and one in a resource group that another Azure service manages, are not counted.
- AWS: a volume whose state is available, unless an AWS service manages it.
- A disk made for a Kubernetes volume claim counts like any other. Its line names the claim, so you can look there first.
Cheaper disk types
Every attached disk that no pool replaces, OS disks, root volumes and the volumes of clusters too, is compared with what its cloud lets it become in its own size and redundancy. It saves its list price less the cheapest one's. The report states the assumption beside the figure: the next 14 days are like the last 14. A cluster machine's own disk, and a disk that another service of the cloud manages, are not yours to change.
- What a disk must go on doing is its busiest minute of the last 14 days × 1.3, in IOPS and in MB/s, with reads and writes added, and no more than its type can do today.
- A disk without those metrics must go on doing all that its type can do, its bursts too. That is a disk made, attached or moved in the last 14 days, one that several VMs share, one with no activity, or on AWS one that isn't on a Nitro instance.
- The metrics of an Azure disk with host caching hold what the cache answered too, which the new disk must do itself. Premium SSD v2 has no such cache, so what all the VM's disks need together, a pool's and a cluster machine's own too, must be within its size's uncached limits too. Without metrics such a disk stays, and is named.
- What it may become answers as soon as today's type and keeps its speed as much of the time, as the cloud publishes both, and has the fewest IOPS and MB/s that do the work.
| Today | May become | When the cloud allows it | What it takes |
|---|---|---|---|
| Premium SSD or Standard SSD, locally redundant | Premium SSD v2 | a data disk with 512-byte sectors, not made from a gallery image, without Azure Disk Encryption or double encryption, on a VM whose size takes premium disks, where Premium SSD v2 is offered | the VM stopped and deallocated; first host caching, Write Accelerator and bursting off, Site Recovery off, and Azure Backup on its Enhanced policy. A shared disk is detached from its VMs. A cluster's volume is made anew from a snapshot |
| Premium SSD on a higher performance tier than its size's | the same on a lower tier that does the work without bursts | always | nothing is stopped (a shared disk's VMs are); once in 12 hours |
| Ultra Disk | Premium SSD v2 | as above, with sectors of either size, when it isn't shared | a new disk from a snapshot |
| Premium SSD v2, Ultra Disk | the same with fewer IOPS and MB/s | always | nothing is stopped |
| gp2 | gp3 | always | nothing is stopped |
| gp3, io1, io2 | the same with fewer IOPS and MB/s | always | nothing is stopped |
| io1 | io2 | on a Nitro instance | nothing is stopped |
| st1, magnetic (standard) | sc1, st1 | a data volume of 125 GB or more, whose IOPS and MB/s are no more than the MB/s the new type has without bursts | nothing is stopped |
Cheaper disks with a 99% speed promise
The same disks, with a type that does the same work and answers as soon, but that its cloud promises to keep at its speed 99% of the time instead of 99.9%. The line is only what that saves beyond Cheaper disk types. The report states the assumption beside the figure: a disk may be slower 1% of the time instead of 0.1%, and on Azure a VM on its own has a 99.5% uptime promise instead of 99.9%.
- Azure: a Premium SSD without Write Accelerator, whose work a Standard SSD of its size and redundancy does without bursts. The VM is stopped and deallocated for the change, and bursting turned off first; a cluster's volume needs its app stopped. A Standard SSD's operations cost extra, which is taken off the saving: the last 14 days' average a second, plus one for each 256 KiB, at the region's dearest list price for them. A disk without 14 days of metrics stays.
- AWS: an io1 volume becomes gp3 with the IOPS and MB/s that do the work, unless several instances share it. Nothing is stopped.
Stopped VMs still billed
An Azure VM that was shut down from the inside (its state is Stopped) is charged for like one that runs, until it is deallocated. It saves its list price, with Windows where it pays for that, for a 730-hour month.
Not counted: a VM on a dedicated host or reserved capacity, which are charged for all the same, one whose OS disk is its host's, which can't be deallocated, and one that another Azure service manages.
Cheaper VM types
Every VM that runs and isn't a cluster's machine is compared with the types its cloud offers it where it is. It saves its list price less the cheapest one's, for the share of a 730-hour month that it ran in the last 14 days. The report states the assumption beside the figure: the next 14 days are like the last 14, and 30% is kept on top of the busiest minute. On AWS, an instance without detailed monitoring has its busiest 5 minutes.
- What a VM must go on having is its busiest minute of the last 14 days × 1.3, and no more than its type gives today: CPU, memory, what it sends, and the IOPS and MB/s of all its disks together; on Azure, also those of the host's cache and the temporary disk. It keeps room for its disks and network interfaces.
- What isn't known of a VM stays as it is today. Memory on AWS is known where the CloudWatch agent reports it for every hour the VM ran. A VM made, resized or (on AWS) started in the last 14 days keeps everything.
- A VM whose size an autoscaler or a scheduler goes by (one in a group that grows and shrinks, a Kubernetes or Amazon ECS machine) keeps all but what it sends. One whose disks a pool replaces keeps its disks' speed.
- What it may become has today's architecture, no more vCPUs, and a processor as new, whose vCPU is as fast as the cloud publishes today's. It has all that the VM has or uses, such as premium disks, trusted launch, its disk controller, boot mode, hypervisor and accelerated networking, and on Windows a temporary disk or none. Its zone offers it to you, and it has a list price and no retirement date.
- A type that may run above what it runs all day (Azure's B series, AWS's T family and flex types) must hold the busiest minute × 1.3 without that, unless today's type can't either.
- The VMs of a scale set or an Auto Scaling group take one type together, which holds what each of them needs.
- These keep their type: a VM on spot, a dedicated host or reserved capacity, or on capacity with a price of its own (an EC2 Capacity Block, an interruptible capacity reservation or a scheduled instance); one in a placement group or a group of several types; one with a local disk, its OS disk on its host, hibernation, an enclave, a confidential VM's protection, a processor feature or network interface that few types have, or an image that not every type takes; and one that another service of the cloud manages.
Each VM is restarted for the change. A scale set's or a group's machines are replaced.
ARM VM types
The same for a Linux VM that is rebuilt from an arm64 image, on an ARM type. The line is only what that saves beyond Cheaper VM types. The report states the assumption beside the figure: everything on the VM has an arm64 build. An ARM vCPU is a whole core, so a VM goes there only from a type whose vCPUs are threads of a core, and to a processor as new.
Non-production off at nights and weekends
A VM that isn't production, with a start and stop schedule of 12 hours from Monday to Friday, runs 60 of a week's 168 hours: 261 of a month's 730. It saves its list price, as the rows above leave it, for the hours it runs beyond those. The report states the assumption beside the figure: nobody uses them outside 12 hours on weekdays.
The clusters that aren't production, and their apps, count in the same row: see What you can change on a cluster yourself.
A VM isn't production when its tags say so; where they say nothing, its name; on Azure, then its resource group and its subscription, by their tags and names, or a Dev/Test subscription. The words are dev, test, qa, uat, stage, staging, sandbox, demo, nonprod and preprod, whole. The words prod, production, prd and live say production, and where nothing is said a VM is production.
Not counted: a VM that is charged for while it is off (a dedicated host, reserved capacity), one that can't be stopped or may end with it (an OS disk on its host, a one-time spot request), and one that another service of the cloud manages.
A 1-year commitment
The machines that run all day at their regular price, as every row above and every Kubernetes step leaves them, cost less with a 1-year commitment and nothing paid upfront. The report states the assumption beside the figure: these machines run all year, and have no commitment where the bill of the last 30 days shows none. A commitment bought in those days is only partly on the bill.
- A VM runs all day when it ran at least 333 of the last 336 hours. One that was made or resized in them isn't counted, nor is one on spot, on a dedicated host or on capacity with a price of its own, one that a schedule turns off, or one that another service of the cloud manages.
- A cluster's machines that run all day are counted by type: as many as run in the hours of the week that have the fewest of them, once the steps and the rows of What you can change on a cluster yourself are taken. One on spot, for a scheduled job, on a dedicated host or dedicated hardware, or of a cluster with no apps isn't counted. Nor is one that may be on a dedicated host, and the report says so.
- The price is, on Azure, the 1-year reservation's, or the 1-year savings plan's for a size that has none; neither pays for Windows. On AWS it is the 1-year EC2 Instance Savings Plan's with nothing upfront, which is also the standard Reserved Instance's where there is one, and it pays for Windows too.
- Today's commitments come first. What each cloud's bills show that they pay for, at regular prices, is taken off before anything is counted, from the machines that a commitment saves the largest share of. A bill that can't be read counts as no commitments, and is named.
Commitments are bought for a number of machines of a type and region, so the report lists them that way.
Unused resources
A resource that is charged for by the hour though nothing uses it saves its list price over a month of 730 hours. The report states the assumption beside the figure: nobody has kept it for later use. Only what it costs by the hour counts, at the lowest price the list has for it in its region.
-
Azure:
- a static public IPv4 address that is attached to nothing and part of no prefix;
- a load balancer with rules, no member in any backend pool, no scale set behind it and no NAT rule to a machine;
- a NAT gateway that no subnet uses;
- a VPN gateway with no connection and no addresses for point-to-site clients;
- a running application gateway with no member in any backend pool, no scale set behind it and no redirect: its fixed price and, on v2, ten capacity units for each instance it keeps. WAF v2 costs less in a network with DDoS protection, and it counts at that price unless its network has none;
- a running firewall with no rules, neither its own nor those of its policy and the policies that one inherits from, and no DNS proxy;
- an App Service plan that runs no app and no deployment slot, at the Dev/Test price in a subscription that pays it, where the list has one. The list doesn't name the rate of a plan in an App Service Environment on hosts of its own, so it isn't counted;
- the machines a reservation is charged for and no VM is in, at the machine's list price. A reservation shared with other subscriptions, paid for in advance, scheduled, or used by VMs that don't name it isn't counted, nor is one whose group a scale set uses.
Nothing counts in a resource group that another Azure service runs, such as Databricks, or that an AKS cluster locks (node resource group lockdown): Azure denies changes there.
-
AWS:
- an Elastic IP address that is attached to nothing. The account's own addresses are free;
- an Application, Network or Gateway Load Balancer that used no capacity and got no new connection or flow in any hour of 14 days. AWS charges a Gateway Load Balancer for each zone it is in;
- a Classic Load Balancer with no instances in any hour of 14 days, made before them;
- a NAT gateway that no route of its region leads to and no appliance is attached to;
- a Site-to-Site VPN connection whose tunnels were down in every hour of 14 days;
- the machines of a capacity reservation that no instance was in at any time of 14 days, at the machine's list price for its platform and tenancy. A reservation that another account owns or pays for, is paid for in advance, on an Outpost, interruptible, committed for longer, or ends by itself within 730 hours isn't counted.
With your current discounts
Every figure is at list prices. Where your bill is below them, a line under the headline says what the saving is worth with the discounts you have: the dollars each cluster and each VM saves × what its bill pays for a dollar of list price. The percentage stays the same, and what you can save with manual steps has no such line.
- Each subscription and account has a figure for its machines and one for its disks: what the bill of the 30 days says was paid, over what the same would cost at list prices. It is never above 1.
- Its machines are Linux ones at their regular price, or that a reservation or a savings plan pays for. Spot machines aren't among them. The machine disks on gp3 and the VMs' data disks are worth the disks' figure, and the rest the machines'.
- The line rests on an assumption, which the report states under it: the discount stays the same on what is left.
- A bill that can't be read, or that has nothing with a list price on it, counts with no discount, and the report says so.
What is not in the saving
Not counted:
- credits;
- Kubernetes clusters other than AKS and EKS;
- in clusters: storage other than the machines' own disks, network, the load balancers and control-plane fees that stay, licences other than Windows, AKS Automatic's fee on machines, and pods not yet placed on a machine;
- for VMs: charges for software other than Windows, data transfer and requests;
- for disks: what today's disks are charged for transactions, I/O requests and bursting; snapshots; instance store; unmanaged (VHD) disks; scale-set (uniform) instances;
- for unused resources: what they cost for traffic, data and requests.
Named in the report, under Not in the saving yet, with the reason:
- a cloud whose CLI can't read, the subscriptions of other Azure directories, and each subscription or region whose clusters or VMs couldn't be listed;
- each cluster not assessed, such as a stopped cluster, one whose API server the run can't reach, one it has no access to, or one whose record can't be read;
- in an assessed cluster: machines with no list price, machines left as they are because they have a GPU or run Windows, machines' own disks that couldn't be read or have no list price, fees of machines that couldn't be read or aren't counted, machine disks on gp3 where it has no list price, usage or LimitRanges that couldn't be read, volumes that couldn't be read, workloads kept at today's requests because their machines have no room to raise them, nodes that are not machines, why cheaper machine types couldn't be counted (machine types the run couldn't read, or machines whose type the region doesn't list or that don't give their capacity), why fewer copies and autoscalers at quiet times couldn't be counted (HorizontalPodAutoscalers the run couldn't read), why scheduled jobs couldn't be counted for the hours they run (CronJobs the run couldn't read), why non-production clusters or apps couldn't be counted as off (namespaces, tags, volumes or CronJobs the run couldn't read, or pods that have run for less than a day), why fewer than 20% of the machines run on spot (types with no spot price or no spot machines), and how many machines that may be on a dedicated host aren't in the 1-year commitment;
- in an EKS cluster with Fargate: the pods whose hours or size after aren't known, usage that couldn't be read, and Fargate prices that couldn't be read or aren't listed;
- in a region with EKS clusters: load balancers, or their requests, that couldn't be read;
- each VM whose record can't be read, and each VM with data disks that is not in the saving, such as:
- Windows; a Linux kernel without btrfs; or no mounted data disk other than shared disks;
- on Azure, a VM in a resource group another Azure service manages, such as Azure Databricks, or a VM size that takes no premium disks or has fewer than 8 data-disk slots;
- on AWS, an instance that another service runs, such as Amazon EMR, one in a Local or Wavelength Zone or on an Outpost, whose volumes have other prices than the region's, one whose record doesn't name its root volume, or an instance type that isn't Nitro, because each volume must be an NVMe device named by its volume id;
- disk usage not read, for example because you answered no, the VM is not running, or Systems Manager doesn't manage the instance;
- not enough free data-disk slots to build the pool beside today's disks;
- a pool that would cost no less;
- no group of mounts that can move: each one holds
/or a Kubernetes volume, has a mount with no used space reported, or has a disk that another AWS service manages, or one with no details, list price or metrics;
- in a VM that is in the saving: each group of mounts that stays on its disks for one of those last reasons;
- how many disks, attached and attached to nothing, have no list price, and how many a cluster or another service may manage;
- how many attached disks have no metrics the run could read, host caching and no metrics, or no list price for a type they could become or for its operations;
- how many stopped VMs have no list price;
- how many machines have no price on a 1-year commitment, and how many bills couldn't be read or show nothing with a list price;
- how many VMs that run have no CPU metrics, no list price or a type their cloud doesn't list, and how many keep today's memory, disk speed or all of today's figures, with the reason;
- each kind of unused resource that couldn't be listed in a region;
- how many unused resources of each kind have no list price, or have a record, metrics or something that may use them that can't be read; how many are in a resource group that another Azure service runs or an AKS cluster locks; and how many reservations of machines are in a group that a scale set uses, or in a capacity reservation fleet, whose reservations AWS lets nobody change one by one.
Where the figures come from
Every figure in the report is one of these:
- read from your clouds, your clusters or your bill;
- read from the public price lists;
- computed from those by the method above.
Some figures also rest on an assumption, which the report states beside each of them.
When a figure can't be known, the report gives the reason instead of a number: a node pool with no list price shows Not priced and why, and a cluster or VM with no estimate is listed under Not in the saving yet, with the reason. Nothing is guessed or filled in.
The figures are estimates at public list prices, not a quote.
Next steps
When the run ends, it prints the cost today, the saving, what that is worth with your current discounts where you have any, what a few manual steps save, and the report's full path.
- Azure Cloud Shell: on the toolbar, choose Manage files > Download, then enter that path.
- AWS CloudShell: choose Actions > Download file, then enter that path. This works only from the full CloudShell page. If Actions is missing, open CloudShell in a new browser tab.
Then:
- Email the report to founders@zoorik.com.
- Book 30 minutes to go through it: cal.com/zoorik/talk.
Coral rebalances pods and machines. Amoeba rightsizes disks.
Contributing
Contributions are welcome. CONTRIBUTING.md explains how the package is laid out, how to run the checks and replay tests, and how to add a step or a cloud. Issues labelled good first issue are a good place to start.
This repo is public, so please don't paste a report or your account's names into an issue. To report a security problem, use Report a vulnerability on the Security tab, or email founders@zoorik.com.
License
Apache-2.0, see LICENSE. Copyright 2026 Zoorik Private Limited.
zoorik.com · Docs · Security · Zoorik on GitHub
The Zoorik, Coral and Amoeba names and logos belong to Zoorik Private Limited.
Metadata
Release files for zoorik 2.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| zoorik-2.1.0.tar.gz | 408.6 kB | With provenance | Details for zoorik-2.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| zoorik-2.1.0-py3-none-any.whl | Python 3 | none | any | Details for zoorik-2.1.0-py3-none-any.whl |
Total release size: 867.7 kB
Release files / zoorik-2.1.0.tar.gz
| Download URL | zoorik-2.1.0.tar.gz |
|---|---|
| Size | 408.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b0a5407687e9090efd8176510d1d97dc8aa10e67cd376e178151bed550536f70
|
|
BLAKE2b-256 checksum How to use checksums |
aebf3aeb1526e097a4259431330f20a3264197af1cc3713413c06620025730a0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logRelease files / zoorik-2.1.0-py3-none-any.whl
| Download URL | zoorik-2.1.0-py3-none-any.whl |
|---|---|
| Size | 459.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
61db001c71d5e57d3c97618579c22609e398e5d937534fca1ce387bab84aa4c1
|
|
BLAKE2b-256 checksum How to use checksums |
bffc314d50d3e0065c03d180dd98ad43d2170e7a46649280bdd16d8298a6f282
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logSecurity for zoorik 2.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for zoorik-2.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.