4 minute read

We’ve just released the newest generally available version of Kubecost (1.100.2)!

In this blog, I’ll highlight some of the new updates you can find after updating to 1.100.2. To see the full release notes, check out our GitHub Releases page for 1.100.

Kubecost Free Install - Helm

helm upgrade --install kubecost \
  --repo https://kubecost.github.io/cost-analyzer cost-analyzer \
  --namespace kubecost --create-namespace

Learn About Kubecost Enterprise | Contact Us

What’s new in Kubecost 1.100.2:

  • New Kubecost UI experience
  • Added ability to group and filter by node labels (nodegroup/nodepool/etc)
  • Added Microsoft Teams alerts
  • Ability to predict cost before deployment with Kubectl Cost Predict
  • Reduced overhead running NetworkCosts daemonset
  • Additional features and fixes

New Kubecost UI experience

The new Kubecost experience has become the default to provide a better overall experience.

2023-02-27_06-42-20

Charts including Cost Over Time and Proportional Cost now display values properly with a new accessible color scheme.

2023-02-27_06-43-03

Pages have been rebuilt and re-styled to provide a more modern user experience.

2023-02-27_06-44-16

Group and filter by nodegroup/nodepool

Many application teams have dedicated node pools for specific applications. While Kubecost had the ability to determine the cost of single application nodes, the method was not intuitive to all users.

With 1.100, Kubecost now collects certain node labels and these are available on the Allocations page using the aggregation and custom label filter.

node group aggregation node group filter
allocations-nodeGroup-aggregation allocations-nodeGroup-filter

The default labels collected:

	"cloud.google.com/gke-nodepool",
	"eks.amazonaws.com/nodegroup",
	"kubernetes.azure.com/agentpool",
	"node.kubernetes.io/instance-type",
	"topology.kubernetes.io/region",
	"topology.kubernetes.io/zone"

This can be customized using an includeList.

Note that this feature is go-forward from the time Kubecost is upgraded to 1.100. In multi-cluster environments, all secondary/agent clusters must also be upgraded in order to collect the new node labels.

Added Microsoft Teams alerts

Read the Microsoft Teams Alerts blog

Kubecost now supports alerts and recurring reports for Microsoft Teams users. Previously, alerts only supported email and Slack distribution, but we are excited to deliver spend monitoring and insights to those using Microsoft Teams.

Alerts are a way of obtaining real-time Kubernetes spend updates, such as when you’ve hit your weekly spending budget and need many people across a team to be aware. They also provide long-term and on-going spend monitoring. Alerts can be configured in minutes, providing long-term spend monitoring for your team.

2023-02-27_07-02-45

image

Ability to predict cost before deployment with Kubectl Cost Predict

kubectl-cost is a kubectl plugin that provides easy CLI access to Kubernetes cost information, like historical cost and predicted future cost, via Kubecost’s APIs. It allows developers, devops, and others to quickly determine the cost & efficiency of any Kubernetes workload.

Starting with Kubecost v1.100, kubectl cost can estimate the cost of undeployed changes! Try it now with kubectl cost predict -f your-deployment.yaml:

For example, if you wanted to predict the cost impact of a YAML spec based on its requests:

read -r -d '' DEF << EndOfMessage
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
  labels:
    app: nginx
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:1.14.2
        resources:
          requests:
            cpu: "3"
            memory: "2Gi"
EndOfMessage
echo "$DEF" | kubectl cost predict -f -

Example output:

+-------------------------------------+-----+-----+-----+------------+-----------+----------+-----------+-----------+------------+
| WORKLOAD                            | CPU | MEM | GPU | CPU/MO     | MEM/MO    | GPU/MO   | Δ CPU/MO  | Δ MEM/MO  | TOTAL/MO   |
+-------------------------------------+-----+-----+-----+------------+-----------+----------+-----------+-----------+------------+
| default/Deployment/nginx-deployment | 9   | 6Gi | 0   | 207.68 USD | 18.56 USD | 0.00 USD | 38.30 USD | 11.51 USD | 226.24 USD |
+-------------------------------------+-----+-----+-----+------------+-----------+----------+-----------+-----------+------------+

Or, predict the cost of the Deployment defined in k8s-deployment.yaml.

kubectl cost predict -f 'k8s-deployment.yaml' \
  --show-cost-per-resource-hr

For more information, follow our guide here

Reduced overhead running NetworkCosts daemonset

By limiting the networkCosts daemonset to monitor only local node pods and services, the CPU and memory needed to run the daemonset is significantly reduced.

The next release of Kubecost will now allow workloads to be classified as Internet network transfers. This will allow any pod, like ingress controllers, to be accounted for more accurately. Contact us if you are interested in early access.

As of version 1.100.2, only traffic that is obviously not local to the cluster is classified as Internet.

Additional features and fixes

  • Allocation Trends API introduced (/model/trends), adds Spend Change percentage to Allocations page:

2023-02-27_07-09-21

  • Download cluster sizing recommendation reports as PDF

2023-02-27_07-10-31

  • Default Allocations Page graph to ‘Cost Over Time’

  • Cluster node sizing recommendation now take region into consideration

  • Launched new more performant Network page: <your-kubecost-url>/network?window=7d&namespace=kubecost

2023-02-27_07-13-23

  • Request sizing Improvements, Request Sizing V2 now supports large scale clusters Request sizing columns sortable

  • Split the RAM/CPU Requests/Recommended into 4 total columns

2023-02-27_07-14-16

  • Added support for configurable recommendation query window in continuous request right-sizing via the requests.autoscaling.kubecost.com/recommendationQueryWindow annotation

  • Added “Continuous Request Right-Sizing” support for DaemonSets and CronJobs

Upgrade Today

If you installed Kubecost using helm, you can upgrade your existing environment to version v1.100.2 using the following commands:

export CURRENT_KUBECOST_VERSION=(`helm ls -n kubecost --output yaml| grep app_version|cut -d':' -f2|xargs`)
# Backup current values
helm get values kubecost -n kubecost >> kubecost-helm-values_$CURRENT_KUBECOST_VERSION.yaml
# Upgrade to version 1.100.2
helm upgrade \
  --repo https://kubecost.github.io/cost-analyzer/ cost-analyzer\
  --namespace kubecost --version 1.100.2

Final thoughts

That’s it for today’s highlights around Kubecost 1.100.2 - We release monthly, so check back for future updates!

We’re here to help!

Join us on Slack if you have questions or feedback, need help, or for general Kubernetes and cloud cost optimization conversation!