<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Kubecost</title>
    <description>The latest articles on DEV Community by Kubecost (@kubecost).</description>
    <link>https://dev.to/kubecost</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F4034%2Fe9cb5c73-8782-49da-b297-bca05e808aa3.png</url>
      <title>DEV Community: Kubecost</title>
      <link>https://dev.to/kubecost</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kubecost"/>
    <language>en</language>
    <item>
      <title>How to monitor Kubernetes costs with Kubecost and the Lens IDE</title>
      <dc:creator>Stefano Maffulli</dc:creator>
      <pubDate>Wed, 23 Jun 2021 18:12:04 +0000</pubDate>
      <link>https://dev.to/kubecost/how-to-monitor-kubernetes-costs-with-kubecost-and-the-lens-ide-31j2</link>
      <guid>https://dev.to/kubecost/how-to-monitor-kubernetes-costs-with-kubecost-and-the-lens-ide-31j2</guid>
      <description>&lt;p&gt;&lt;a href="https://k8slens.dev/" rel="noopener noreferrer"&gt;Lens&lt;/a&gt; is the most powerful IDE for those who need to deal with Kubernetes clusters on a daily basis. It allows you to manage your cluster and view important health metrics. A &lt;a href="http://kubecost.com/" rel="noopener noreferrer"&gt;Kubecost&lt;/a&gt; and Lens integration allows you to also visualize Kubernetes costs directly in the Lens UI. With Lens and Kubecost you can view costs and spend efficiency by namespace, pod, deployment and more!&lt;/p&gt;

&lt;p&gt;For most teams, it’s really difficult to understand the cost of Kubernetes workloads, even in a somewhat static multi-tenant environment. When concepts like autoscaling are introduced, it becomes far more complex. This creates many challenges, including unintentional overspending, poor visibility for business planning, and missing costly bugs/mistakes. Despite the fact that over 32% of respondents to the &lt;a href="https://data.finops.org/" rel="noopener noreferrer"&gt;2021 FinOps survey&lt;/a&gt; collect and analyze cloud cost data using spreadsheets, those will only take you so far.&lt;/p&gt;

&lt;p&gt;To help engineering teams, we published an early version of a new &lt;a href="https://github.com/kubecost/kubecost-lens-extension" rel="noopener noreferrer"&gt;open source integration with Lens&lt;/a&gt;. It provides a direct view into Kubernetes costs so you can understand what is driving overall costs and how efficiently they are being spent. In this first release you can see cost trends for any workload aggregation, e.g. pod, deployment, statefulset, namespace. Future releases will be driven by the feedback we receive, so join Kubecost Slack community (link below!) and let us know what features you'd like to see.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgzxwkzuyf8oagovpn078.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgzxwkzuyf8oagovpn078.gif" alt="Kubernetes costs inside Lens IDE"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Install Kubecost in your Kubernetes cluster using Lens IDE
&lt;/h2&gt;

&lt;p&gt;Get started by installing the Kubecost stack in your cluster. Open Lens and connect to your Kubernetes cluster.  Go to the Apps directory and search for the &lt;em&gt;cost-analyzer&lt;/em&gt; chart.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fexa198rhv42mgvyq6a18.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fexa198rhv42mgvyq6a18.png" title="Install Kubecost from the Lens Apps directory" alt="Find Kubecost from the Lens Apps directory"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Create a namespace called “kubecost” and install Kubecost cost-analyzer in it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F226y77cfaig99c35sa8m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F226y77cfaig99c35sa8m.png" title="Install Kubecost in the kubecost namespace" alt="Install Kubecost in the kubecost namespace"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once Kubecost is installed, you can add the Kubecost extension:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Download the &lt;a href="https://github.com/kubecost/kubecost-lens-extension/releases" rel="noopener noreferrer"&gt;latest tar.gz file release from GitHub&lt;/a&gt;. Alternatively, just copy the download URL of the release artifact.&lt;/li&gt;
&lt;li&gt;  Open the Lens application and select Lens menu, and then click Extensions item, or press Shift + Command + E to open the Manage Lens Extensions page.&lt;/li&gt;
&lt;li&gt;  Specify the path (.tar, .tgz) or download URL to the extension package and click Install.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F71ngqz61h97ppdqo2uvy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F71ngqz61h97ppdqo2uvy.png" title="Install Kubecost Lens extension" alt="Install Kubecost Lens extension"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  View Kubernetes cost metrics
&lt;/h2&gt;

&lt;p&gt;To see the full Kubecost UI or to view cost metrics from the Lens terminal, setup a port forward to your Kubernetes cluster with kubectl:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl port-forward --namespace kubecost deployment/kubecost-cost-analyzer 9090
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will add a new panel in Lens UI showing costs of resources per namespace. &lt;/p&gt;

&lt;p&gt;&lt;a href="/assets/images/2021-06-10-lens-kubecost/image6.png" class="article-body-image-wrapper"&gt;&lt;img src="/assets/images/2021-06-10-lens-kubecost/image6.png" title="See the new Costs panel in the Lens UI" alt="See the new Costs panel in the Lens UI"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;These cost metrics account for all active workloads in the namespace. By default, pricing is pulled from public cloud providers, with AWS, Azure, and GCP being supported today. You can add a Kubecost cloud integration to reflect prices from Spot nodes, enterprise discounts, reserved instances, and more.&lt;br&gt;
Custom pricing sheets are supported for for on-prem clusters.&lt;/p&gt;

&lt;p&gt;You can also point your browser to &lt;a href="http://localhost:9090" rel="noopener noreferrer"&gt;http://localhost:9090&lt;/a&gt; to view more cost metrics.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpjdc5gzhkz5lh5vnuivu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpjdc5gzhkz5lh5vnuivu.png" title="The Kubecost GUI in the browser" alt="The Kubecost GUI in the browser"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This installs the community version of Kubecost which is good for monitoring one cluster with a default metric retention of 15 days. Other features are available in the &lt;a href="https://www.kubecost.com/pricing/" rel="noopener noreferrer"&gt;Business and Enterprise versions&lt;/a&gt; of the product. Join &lt;a href="https://join.slack.com/t/kubecost/shared_invite/enQtNTA2MjQ1NDUyODE5LWFjYzIzNWE4MDkzMmUyZGU4NjkwMzMyMjIyM2E0NGNmYjExZjBiNjk1YzY5ZDI0ZTNhZDg4NjlkMGRkYzFlZTU" rel="noopener noreferrer"&gt;Kubecost Slack community&lt;/a&gt; or &lt;a href="//mailto:team@kubecost.com"&gt;contact us&lt;/a&gt; if you want more! &lt;/p&gt;

</description>
      <category>devops</category>
      <category>finops</category>
      <category>kubernetes</category>
      <category>monitoring</category>
    </item>
    <item>
      <title>How to set real-time cost alerts in Kubernetes</title>
      <dc:creator>Stefano Maffulli</dc:creator>
      <pubDate>Wed, 12 May 2021 22:59:07 +0000</pubDate>
      <link>https://dev.to/kubecost/how-to-set-real-time-cost-alerts-in-kubernetes-3jco</link>
      <guid>https://dev.to/kubecost/how-to-set-real-time-cost-alerts-in-kubernetes-3jco</guid>
      <description>&lt;p&gt;Kubernetes gave the great power to engineering to scale applications infrastructure without much fuss. Sadly, budgets don't scale as easily. DevOps and finance team can rely on the open source Kubecost project for real-time alerting of cost overruns.&lt;br&gt;
In corporate environments it’s crucial to give all stakeholders the ability to track resource usage and cost to each service within a shared cluster. This clear ownership improves budget-based resource planning, identifies resource bottlenecks, and even helps manage security risks. Once your ecosystem is properly organized, the next step towards clarity is to set up cost alerts.&lt;/p&gt;
&lt;h2&gt;
  
  
  How Kubecost Adds Clarity
&lt;/h2&gt;

&lt;p&gt;Two of the key features of Kubecost are its cost allocation views for granular insights and its notifications triggered by cost alerts. &lt;/p&gt;
&lt;h3&gt;
  
  
  1. Granular Insights
&lt;/h3&gt;

&lt;p&gt;Kubecost can break costs down to any Kubernetes component level (according to usage), down to individual workloads. The cost allocation model supports all native Kubernetes concepts, including cluster, namespace, controller, deployment, service, label, pod, and container.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq6bo0795y9o8i3c8ghiy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq6bo0795y9o8i3c8ghiy.png" title="Bird's eye view of overall cluster cost usage" alt="Bird's eye view of overall cluster cost usage"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The view below shows a deployment along with its allocated costs and its resource efficiency score (by comparing idle to used resources), as well as its health score (calculated based on checks conveniently pre-configured based on industry best practices).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9jdwt6u1b906p8wdyu7v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9jdwt6u1b906p8wdyu7v.png" title="Cost attribution, efficiency and health report for a particular workload" alt="Cost attribution, efficiency and health report for a particular workload"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;These historical cost measurements can serve as benchmarks for setting initial alerting or budget thresholds.&lt;/p&gt;
&lt;h3&gt;
  
  
  2. Notifications
&lt;/h3&gt;

&lt;p&gt;Kubecost supports the following types of cost &lt;a href="http://docs.kubecost.com/alerts.html" rel="noopener noreferrer"&gt;alert&lt;/a&gt; notifications: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Recurring Update&lt;/strong&gt;: Great for creating scheduled cost reports allocated by namespace. &lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Budget&lt;/strong&gt;: Great for surfacing a budget overrun relative to a defined threshold.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Spend Change&lt;/strong&gt;: Great for detecting a jump in your spending habits (based on a historical &lt;a href="https://en.wikipedia.org/wiki/Moving_average" rel="noopener noreferrer"&gt;moving average&lt;/a&gt;). &lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Efficiency&lt;/strong&gt;: Great for detecting over-provisioned CPU, memory, or storage according to a defined efficiency ratio threshold between 0 and 1. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let us expand some more on these alerting use cases.&lt;/p&gt;
&lt;h4&gt;
  
  
  Recurring Update Alert
&lt;/h4&gt;

&lt;p&gt;This mode of alerting is better thought of as a scheduled report. Suppose an engineering manager responsible for a Kubernetes cluster has created multiple namespaces to delegate self-administration to various application teams. The engineering manager can schedule a “recurring update” alert to receive a regular report of usage and cost allocated by namespace to ensure that each group uses a fair portion of the shared cluster.&lt;/p&gt;
&lt;h4&gt;
  
  
  Budget Alert
&lt;/h4&gt;

&lt;p&gt;The budget alert compares daily spending to a preset threshold (that can be typed in the Kubecost user interface) and alerts only if the threshold is exceeded. Once you combine this alert with the cost allocation feature of Kubecost, you achieve the fastest mechanism to notify the right person who is capable of rectifying a cost over-run on the very first day that the excess occurs, thus avoiding an end-of-month surprise. &lt;/p&gt;
&lt;h4&gt;
  
  
  Spend Change Alert
&lt;/h4&gt;

&lt;p&gt;This type of alert is most helpful if you don't have a preset budget or would like to avoid setting thresholds altogether. Instead, you would simply like to know if your spending experiences a sudden unexpected increase.  By comparing your current spending to a historical trend line, you will receive an alert as soon as your spending breaks from a typical daily pattern.&lt;/p&gt;
&lt;h4&gt;
  
  
  Efficiency Alert
&lt;/h4&gt;

&lt;p&gt;An increase in spending is not always bad as it may be directly related to increased workload or increased business activity. The efficiency index identifies waste in your Kubernetes cluster, but it also detects bottlenecks. The efficiency alert notifies administrators of over and under-provisioning of resources that often go undetected for long periods. &lt;/p&gt;

&lt;p&gt;To set the scope of an alert, simply add criteria to the aggregation (as defined in the &lt;a href="https://docs.kubecost.com/allocation-api.html#aggregated-cost-model-api" rel="noopener noreferrer"&gt;aggregated cost model API&lt;/a&gt;) and filter settings. Aggregation supports dimensions such as cluster, namespace, controller, deployment, service, label, pod, and container. Filters let you choose which aggregations (such as a specific namespace) to include in the notification.&lt;/p&gt;

&lt;p&gt;When you &lt;a href="http://docs.kubecost.com/alerts.html" rel="noopener noreferrer"&gt;set up alerts&lt;/a&gt; based on usage per namespace (or per cluster), you can conveniently define daily budget thresholds in the UI unique to each project or team and direct notifications to relevant parties and collaborative tools. In this way, you not only cut out the noise, but you also deliver valuable information directly to the stakeholders who can act on it. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuvwx426xkos4na80yofz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuvwx426xkos4na80yofz.png" title="Notifications Menu in Kubecost" alt="Notifications Menu in Kubecost"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  Via Email
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzzbbb1if0izaackn5h4z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzzbbb1if0izaackn5h4z.png" title="Kubecost Email Notification" alt="Kubecost Email Notification"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  Via Slack
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpealvvn7pidwwtufhbe6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpealvvn7pidwwtufhbe6.png" title="Kubecost Slack Notification " alt="Kubecost Slack Notification "&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  Via Webhook
&lt;/h4&gt;

&lt;p&gt;A third option is to simply use a generic webhook to integrate with just about any third-party tool such as PagerDuty or OpsGenie.&lt;/p&gt;
&lt;h2&gt;
  
  
  How to Get Started with Kubecost Alerts
&lt;/h2&gt;
&lt;h3&gt;
  
  
  1. Install Kubecost
&lt;/h3&gt;

&lt;p&gt;Installing Kubecost in your Kubernetes cluster only takes a few minutes using Helm. Follow the &lt;a href="https://www.kubecost.com/install" rel="noopener noreferrer"&gt;installation guide&lt;/a&gt; and can configure all of the alerts in the Helm values section as shown below.&lt;/p&gt;
&lt;h3&gt;
  
  
  2. Set up Cost Alerts
&lt;/h3&gt;

&lt;p&gt;You can configure your cost alerts from the &lt;a href="https://github.com/kubecost/cost-analyzer-helm-chart/blob/master/cost-analyzer/values.yaml" rel="noopener noreferrer"&gt;Kubecost Helm values file&lt;/a&gt;. For each alert you complete the following: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Define your thresholds based on your budgetary goals&lt;/li&gt;
&lt;li&gt;  Filter namespaces unrelated to a given project or team&lt;/li&gt;
&lt;li&gt;  Add notifications for stakeholder awareness&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The following is an example of a Helm values block.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  notifications:
    # Kubecost alerting configuration
    # Ref: http://docs.kubecost.com/alerts
    alertConfigs:
      enabled: false # the example values below are never read unless enabled is set to true
      frontendUrl: http://localhost:9090 # optional, used for linkbacks
      globalSlackWebhookUrl: "https://hooks.slack.com/services/&amp;lt;REDACTED&amp;gt;" # optional, used for Slack alerts
      kubecostHealth: true # Alerts generated for kubecost uptime. Uses the globalSlackWebhookUrl to deliver the alert
      globalAlertEmails:
        - user1@example.com
      alerts: # Alerts generated by kubecost, about cluster data
          # Daily namespace budget alert on namespace `kubecost`
        - type: budget # supported: budget, recurringUpdate
          threshold: 0.50 # optional, required for budget alerts
          window: daily # or 1d
          aggregation: namespace
          filter: elasticsearch
          ownerContact: # optional, overrides globalAlertEmails default
            - user1@example.com
            - user2@example.com
          slackWebhookUrl: "https://hooks.slack.com/services/T069Z9TFF/&amp;lt;REDACTED&amp;gt;" # optional, used for alert-specific Slack alerts
          # Daily cluster budget alert (clusterCosts alert) on cluster `cluster-one`
        - type: budget
          threshold: 1.0 # optional, required for budget alerts
          window: daily # or 1d
          aggregation: cluster
          filter: prod-cluster # does not accept csv
          # Recurring weekly update (weeklyUpdate alert)
        - type: recurringUpdate
          window: weekly # or 7d
          aggregation: namespace
          filter: '*'
          # Recurring weekly namespace update on kubecost namespace
        - type: recurringUpdate
          window: weekly # or 7d
          aggregation: namespace
          filter: kubecost
          # Spend Change Alert
        - type: spendChange  # change relative to moving avg
          relativeThreshold: 0.20  # Proportional change relative to baseline. Must be greater than -1 (can be negative)
          window: 1d                # accepts 'd', 'h'
          baselineWindow: 30d       # previous window, offset by window
          aggregation: namespace
          filter: kubecost, default # accepts csv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Scale Across Clusters
&lt;/h3&gt;

&lt;p&gt;For production deployment, we recommend that you configure the system using the Helm values file (instead of using the UI). This enables you to reference your Helm values file for configuration across multiple clusters; to reuse your Helm values file, simply provide the path of the Helm chart and values file to your continuous delivery (CD) system (such as &lt;a href="https://argoproj.github.io/argo-cd/" rel="noopener noreferrer"&gt;ArgoCD&lt;/a&gt;) and wait for the product to be deployed. &lt;/p&gt;

&lt;p&gt;Once deployed, you'll see the following workloads in your cluster:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdcw9t3z20e76crsmne67.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdcw9t3z20e76crsmne67.png" title="Kubecost Deployment Example" alt="Kubecost Deployment Example"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  4. View
&lt;/h3&gt;

&lt;p&gt;If you would just like to quickly explore the product:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Run the following command:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl port-forward --namespace kubecost deployment/kubecost-cost-analyzer 9090
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Navigate to &lt;a href="http://localhost:9090" rel="noopener noreferrer"&gt;http://localhost:9090&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Explore. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Let Kubecost run for a couple of hours before taking a full tour so that there is enough data in the system to populate all fields.  &lt;/p&gt;

&lt;p&gt;When moving to production, you can expose Kubecost via &lt;a href="https://docs.kubecost.com/getting-started#basic-auth" rel="noopener noreferrer"&gt;ingress&lt;/a&gt;, SAML, or other mechanism that meets your security requirements. This is similar to how you might give access to other resources, such as a Jenkins UI. &lt;/p&gt;

&lt;h2&gt;
  
  
  Setup Tips
&lt;/h2&gt;

&lt;p&gt;Kubecost integrates with most Identity providers (such as Google Auth) and also supports SAML-based authentication. All of this can be configured in the Helm values file. &lt;br&gt;
Kubecost uses Prometheus &lt;a href="https://prometheus.io/docs/alerting/alertmanager/" rel="noopener noreferrer"&gt;alertmanager&lt;/a&gt; for alert delivery. If you already have an instance of &lt;em&gt;alertmanager&lt;/em&gt; running, you can configure its endpoint in the Helm values file and Kubecost can use that for alert notifications.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  notifications:
    # Kubecost alerting configuration
    # Ref: http://docs.kubecost.com/alerts
    alertConfigs:
  ...

    alertmanager: # Supply an alertmanager FQDN to receive notifications from the app.
      enabled: true # If true, allow kubecost to write to your alertmanager
      fqdn: http://kubecost-prometheus-alertmanager #example fqdn. Ignored if prometheus.enabled: true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;See the &lt;a href="https://github.com/kubecost/docs/blob/master/alerts.md#troubleshooting" rel="noopener noreferrer"&gt;Kubecost Alerts troubleshooting guide&lt;/a&gt; or join the Kubecost &lt;a href="https://join.slack.com/t/kubecost/shared_invite/enQtNTA2MjQ1NDUyODE5LWFjYzIzNWE4MDkzMmUyZGU4NjkwMzMyMjIyM2E0NGNmYjExZjBiNjk1YzY5ZDI0ZTNhZDg4NjlkMGRkYzFlZTU" rel="noopener noreferrer"&gt;Slack group&lt;/a&gt; for community advice and support.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Kubecost provides a holistic view of infrastructure cost by collating both in-cluster and out-of-cluster resources with support for all leading public cloud providers. It takes this a step further by generating timely alerts and actionable scheduled reports for your stakeholders, allowing them to better control overspending on cloud resources. &lt;/p&gt;

&lt;p&gt;From an operational standpoint, setup is quick and painless. Kubecost integrates with all leading identity providers and you can also use an existing alertmanager or Prometheus installation to integrate with, which is a huge plus, especially when most teams already have a Prometheus deployment running in their clusters. &lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>devops</category>
    </item>
    <item>
      <title>AKS Cost Monitoring and Governance With Kubecost</title>
      <dc:creator>Stefano Maffulli</dc:creator>
      <pubDate>Wed, 28 Apr 2021 22:57:02 +0000</pubDate>
      <link>https://dev.to/kubecost/aks-cost-monitoring-and-governance-with-kubecost-3i14</link>
      <guid>https://dev.to/kubecost/aks-cost-monitoring-and-governance-with-kubecost-3i14</guid>
      <description>&lt;p&gt;When running Azure Kubernetes Service (AKS), it can be hard to understand and allocate costs in environments with multiple teams, projects, or even departments. With &lt;a href="https://www.kubecost.com/" rel="noopener noreferrer"&gt;Kubecost&lt;/a&gt;, you gain full transparency into your Kubernetes usage and cost within minutes of installation. Officially launched in 2019 and built on open source, Kubecost now monitors over one billion dollars in Kubernetes spend, and enables startups and global enterprises alike to understand their spend and identify cost savings ranging from 30% to over 50%. Kubecost supports a wide range of self-managed and hosted Kubernetes environments, including Azure Kubernetes Service, which we’ll cover today in this article.&lt;/p&gt;

&lt;p&gt;The Microsoft &lt;a href="https://azure.microsoft.com/en-us/services/kubernetes-service/" rel="noopener noreferrer"&gt;Azure Kubernetes Service&lt;/a&gt; (AKS) is a &lt;a href="https://security.stackrox.com/rs/219-UEH-533/images/State_of_Container_and_Kubernetes_Report.pdf" rel="noopener noreferrer"&gt;popular&lt;/a&gt; fully managed Kubernetes service that offers embedded continuous integration and continuous delivery as well as enterprise-grade security and governance— powerful tools for teams adopting Kubernetes. As with any complex infrastructure, AKS requires proper governance and financial transparency for successful organizational adoption. Kubecost, an open source tool that provides teams with visibility into Kubernetes spend and supports environments hosted in Azure, is a widely recommended solution for engineers and finance teams facing this problem. &lt;em&gt;Note: This &lt;a href="https://docs.microsoft.com/en-us/azure/cloud-adoption-framework/scenarios/aks/eslz-security-governance-and-compliance#cost-governance" rel="noopener noreferrer"&gt;documentation page&lt;/a&gt; for AKS provides helpful context for using Kubecost to implement a cost governance strategy.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Cost Allocation Challenge
&lt;/h2&gt;

&lt;p&gt;Kubernetes clusters are often shared across teams, microservices, projects, applications, departments, and cost centers to save on infrastructure and administrative overhead. The most popular methods for organizing this shared platform is by simply using labels (similar to tags) or by creating &lt;a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/" rel="noopener noreferrer"&gt;namespaces&lt;/a&gt;. A Kubernetes namespace is a logical separation inside a Kubernetes cluster which could be assigned to a particular team, application, or even a business unit.&lt;/p&gt;

&lt;p&gt;Most organizations map a namespace to a specific workload type or purpose. For example, a typical cluster might have one namespace for monitoring and one namespace for logging for use by the DevOps teams who maintain the cluster. A customer-facing application hosted in that same cluster might have one namespace for its front-end components and a separate namespace for its back-end services. &lt;/p&gt;

&lt;p&gt;Creating these logical divisions inside a cluster is administratively convenient, but adds complexity when trying to accurately measure resource usage and allocate costs to each tenant based on detailed billing data.&lt;/p&gt;

&lt;h3&gt;
  
  
  Sharing a Kubernetes Cluster in Azure
&lt;/h3&gt;

&lt;p&gt;There are three models for sharing Azure Kubernetes Service (AKS) clusters across cost centers:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Dedicated AKS cluster&lt;/strong&gt;: Each team or project gets its own dedicated AKS cluster to easily track its billing. This approach does not benefit from resource sharing. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Dedicated AKS node&lt;/strong&gt;: Each team or project gets its &lt;a href="https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/" rel="noopener noreferrer"&gt;pods assigned to a specific node&lt;/a&gt; in a shared AKS cluster using labels and a configuration constraint known as nodeSelector. Each team can then isolate its spending in the Azure bill according to the cost of its assigned nodes. Resource sharing is not efficient in this model. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Dedicated AKS Namespace&lt;/strong&gt;: Each team or project gets its own dedicated namespace along with more flexibility and administrative freedom. This model, as we have mentioned, can be challenging for cost allocation. However, this is where Kubecost comes in.  &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpcyldhgy1t9rb100szi1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpcyldhgy1t9rb100szi1.png" title="With Kubecost, you can share AKS clusters and still clearly allocate shared costs." alt="With Kubecost, you can share AKS clusters and still clearly allocate shared costs."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  The Measurement Challenge
&lt;/h3&gt;

&lt;p&gt;Suppose you have chosen to support multiple projects and teams on your AKS cluster using a few dozen namespaces. In this example, each team has its own namespace and autonomous administrative control over provisioning pods and containers. After a couple of months, the cluster costs are higher than expected, and you would like to identify the cause of the spending jump. It’s a simple question, but complicated to answer, because you must measure resource usage by workloads in each namespace over multiple weeks to come to a conclusion. &lt;/p&gt;

&lt;p&gt;This means that you must allocate the following by namespace:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The actual usage of CPU, GPU, memory, network, and persistent storage.&lt;/li&gt;
&lt;li&gt;The excessive requests for CPU and memory leaving resources unused.
&lt;/li&gt;
&lt;li&gt;The usage of shared resources such as databases or blob storage.&lt;/li&gt;
&lt;li&gt;The proportionate use of cloud instance reservations and support services.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F74crj5xtqc21j0jw7b6r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F74crj5xtqc21j0jw7b6r.png" title="An accurate cost allocation by project, team, or cost center must consider all factors." alt="An accurate cost allocation by project, team, or cost center must consider all factors."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you take just network usage as one example, you are required to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Measure the egress traffic generated by containers belonging to each namespace across regions, availability zones, and out to the internet.&lt;/li&gt;
&lt;li&gt;Determine the data transfer rates that may be negotiated with your cloud provider. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Only then can you measure the networking costs associated with each namespace. &lt;/p&gt;

&lt;p&gt;This process is daunting, especially when you consider the fact that it requires:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Specialized telemetry for collecting relevant data in real-time&lt;/li&gt;
&lt;li&gt;  Storage of time-series data over time&lt;/li&gt;
&lt;li&gt;  Collection and analysis of cloud provider’s detailed billing logs &lt;/li&gt;
&lt;li&gt;  Analysis of usage and cost data to calculate the accurate costs&lt;/li&gt;
&lt;li&gt;  Presentation of the results in the form of reports or dashboards&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Don’t Sidestep the Challenge
&lt;/h3&gt;

&lt;p&gt;Leaving this challenge unresolved leads to organizational frustration in the long run as you struggle to identify the root cause of a spending jump or struggle to respond to a management request for what seems a simple report of cost allocation by application, team, or project. A sudden increase in spending due to misconfiguration would be a routine operational matter if noticed within hours or days, but when left lurking in the shadows for weeks or months, it can fester into an end-of-quarter budgeting drama. &lt;/p&gt;

&lt;p&gt;Although Kubernetes delivers on the promise of economies of scale and auto-scaling, it requires proper governance and financial transparency for sustained, successful organizational adoption. &lt;/p&gt;

&lt;h2&gt;
  
  
  One Comprehensive View
&lt;/h2&gt;

&lt;p&gt;Having a high-level summary view of your resource usage and spend while also being able to drill down into the details is a universal ideal applicable to just about any domain. In the case of Kubernetes hosted in Azure, there are two types of comprehensive summarized views:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Azure resources directly or indirectly related to Azure Kubernetes Service &lt;/li&gt;
&lt;li&gt;Azure services unrelated to AKS, e.g. other Azure Virtual Machines&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Having both views in a single tool avoids the need to switch between consoles and reconcile billing information.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff3iurhopdtqf79ewcl9c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff3iurhopdtqf79ewcl9c.png" title="A comprehensive view should include AKS-related and non-AKS-related costs" alt="A comprehensive view should include AKS-related and non-AKS-related costs"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Azure Costs Related to Kubernetes
&lt;/h3&gt;

&lt;p&gt;The costs directly associated with Kubernetes in Azure are the costs of the nodes that form the Kubernetes cluster, including the network and persistent storage volumes that support the nodes. Costs can be broken down into charges associated with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  CPU&lt;/li&gt;
&lt;li&gt;  Memory&lt;/li&gt;
&lt;li&gt;  GPU&lt;/li&gt;
&lt;li&gt;  Network&lt;/li&gt;
&lt;li&gt;  Storage Volumes &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are also external costs associated with a Kubernetes cluster or namespace. These charges may be dedicated to each namespace or Kubernetes resource, or they may be shared across multiple namespaces. For example, a proxy server may be accessed by all containers regardless of the namespace, and therefore its cost would be shared across all namespaces. &lt;/p&gt;

&lt;p&gt;The table below summarizes the types of costs that you must account for to have an accurate view of your spending by namespace:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
  &lt;tr&gt;
   &lt;th&gt;Kubernetes Cost Type&lt;/th&gt;
   &lt;th&gt;Kubernetes Cost Description&lt;/th&gt;
   &lt;th&gt;Examples&lt;/th&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;In-Cluster
   &lt;/td&gt;
   &lt;td&gt;The cost of the nodes that make up the cluster 
   &lt;/td&gt;
   &lt;td&gt;CPU, memory, storage, network, and GPU 
   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;External
   &lt;/td&gt;
   &lt;td&gt;The cost of Azure services dedicated to an individual namespace
   &lt;/td&gt;
   &lt;td&gt;Azure SQL, Azure Blob, Azure Synapse Analytics 
   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;Shared
   &lt;/td&gt;
   &lt;td&gt;The cost of services shared by all namespaces
   &lt;/td&gt;
   &lt;td&gt;kube-system namespace, common labor costs
   &lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  The Kubecost Approach
&lt;/h2&gt;

&lt;p&gt;Kubecost is popular because of its rich set of functionality, ease of implementation, and its attentive support team. As pioneers in Kubernetes FinOps, Kubecost and its early adopters helped define many of the modern concepts behind financial reporting on shared Kubernetes resources in a hosted cloud environment. &lt;/p&gt;

&lt;h3&gt;
  
  
  Azure Integration
&lt;/h3&gt;

&lt;p&gt;Later in this article, we’ll go over how to install Kubecost in a Kubernetes cluster using Helm and integrate it with Azure. But first, it’s important to know that Kubecost is installed within the Kubernetes cluster and does not transmit any data outside of your cluster, meaning you won’t have to worry about sensitive data leaving your environment.&lt;/p&gt;

&lt;p&gt;Kubecost collects data from the Azure Billing Rate Card API (using a role definition that you create) to provide accurate cost information based on your detailed billing records. Kubecost’s Azure integration collects your exact pricing data to account for any special pricing, such as Azure reservations, in its analyses. Additionally with integration to your Azure Storage Account, Kubecost is able to reconcile exact costs of your in-cluster usage and display them alongside out-of-cluster costs for an accurate and holistic view of your cloud spend. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq6hqwatpsddi9d31nzfa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq6hqwatpsddi9d31nzfa.png" title="Kubecost uses the Microsoft Azure Billing Rate Card API to gather accurate and detailed cost information" alt="Kubecost uses the Microsoft Azure Billing Rate Card API to gather accurate and detailed cost information"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Main Dashboard
&lt;/h3&gt;

&lt;p&gt;Once the installation process is completed, you can then access the main dashboard, where each cluster also has its own dedicated view, which includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Total monthly spending &lt;/li&gt;
&lt;li&gt;  Efficiency (the ratio of utilized to idle resources over time) &lt;/li&gt;
&lt;li&gt;  Cost allocation by Kubernetes controller, service, namespace&lt;/li&gt;
&lt;li&gt;  Cluster health (based on preset rules of reliability and risk best practices)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9yt83jlr6n8twdeqc530.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9yt83jlr6n8twdeqc530.png" title="Kubecost’s main dashboard summarizes costs, health, and efficiency" alt="Kubecost’s main dashboard summarizes costs, health, and efficiency"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Navigation Options
&lt;/h3&gt;

&lt;p&gt;As you might have noticed, the navigation menu visible on the left side of the previous screenshot presents a number of other reports and dashboards available to Kubecost users. These tools include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Cost Allocation:&lt;/strong&gt; Group costs by Kubernetes meta-data and Azure tags&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Assets:&lt;/strong&gt; View all of your Azure spending beyond AKS&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Savings:&lt;/strong&gt; Get recommendations for cost savings based on preset best practices&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Health&lt;/strong&gt;: See your cluster’s health score based on preset best practices &lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Reports:&lt;/strong&gt; Group, filter, sort detailed cost information and store for later&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Notifications:&lt;/strong&gt; Configure cost alerts based on cluster or namespace budgets&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We won’t cover all of the functionalities offered by these tools in this article; we will highlight the primary ones related to Azure billing and Kubernetes cost allocation. &lt;/p&gt;

&lt;h3&gt;
  
  
  Cost Allocation
&lt;/h3&gt;

&lt;p&gt;As referenced earlier in this article, costs associated with a Kubernetes cluster fall into the following categories:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;In-cluster&lt;/strong&gt;: AKS costs of Memory, CPU, network, storage, and GPU &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;External&lt;/strong&gt;: Azure costs dedicated to each Kubernetes component&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Shared&lt;/strong&gt;: Azure services or fixed costs shared across Kubernetes components&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The diagram below uses a grouping by namespace to illustrate these concepts including the option to allocate the cost of a shared cluster namespace across other namespaces:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8y0irt0k6sqx06a8ca93.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8y0irt0k6sqx06a8ca93.png" title="AKS costs in Kubecost include in-cluster costs, out-of-cluster or external costs, and shared costs." alt="AKS costs in Kubecost include in-cluster costs, out-of-cluster or external costs, and shared costs."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The user interface displays the cost categories highlighted in this screenshot:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp9ih80459658z2e74f7r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp9ih80459658z2e74f7r.png" title="Kubecost cost allocation report for Azure AKS" alt="Kubecost cost allocation report for Azure AKS"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This functionality requires you to export your Azure cost report into an Azure storage by following &lt;a href="https://docs.microsoft.com/en-us/azure/cost-management-billing/costs/tutorial-export-acm-data?tabs=azure-portal" rel="noopener noreferrer"&gt;these instructions&lt;/a&gt; (select the daily month-to-date option for the export and wait a few hours to populate) and allowing Kubecost to securely access it via the Azure storage API by creating a JSON file named &lt;strong&gt;&lt;em&gt;azure-storage-config.json&lt;/em&gt;&lt;/strong&gt; with your secret information formatted as below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    "azureStorageAccount": "&amp;lt;STORAGE_ACCOUNT_NAME&amp;gt;",
    "azureStorageAccessKey": "&amp;lt;STORE_ACCESS_KEY&amp;gt;",
    "azureStorageContainer": &amp;lt;REPORT_CONTAINER_NAME&amp;gt;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can then use this command to create the secret:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl create secret generic &amp;lt;SECRET_NAME&amp;gt; --from-file=azure-storage-config.json -n kubecost
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the secret is created, set &lt;code&gt;.Values.kubecostProductConfigs.azureStorageSecretName&lt;/code&gt; to &lt;code&gt;&amp;lt;SECRET_NAME&amp;gt;&lt;/code&gt; and upgrade Kubecost via helm. You can also follow the more &lt;a href="https://github.com/kubecost/docs/blob/master/azure-out-of-cluster.md" rel="noopener noreferrer"&gt;detailed instructions&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Later in this article, we provide instructions for using helm to install Kubecost and share links to relevant instructions pages. &lt;/p&gt;

&lt;h3&gt;
  
  
  Cost Breakdown
&lt;/h3&gt;

&lt;p&gt;One of the nice features of Kubecost is that you can select just about any line item on the screen and drill down to see more information. For example, in the case of external costs highlighted in the previous screenshot, selecting a specific value would present  a breakdown of the charges:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftipl0gs81d9ipd7dus6x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftipl0gs81d9ipd7dus6x.png" title="Kubecost’s Detailed Azure Cost View" alt="Kubecost’s Detailed Azure Cost View"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Allocating External Azure Costs Using Tags
&lt;/h3&gt;

&lt;p&gt;Now that you have learned about the concepts of in-cluster, external, and shared Azure costs in Kubecost, it may be helpful to know how you can control the allocations. Kubecost uses tags and labels to allocate Azure spending outside of the Kubernetes cluster to specific Kubernetes components, such as pods and namespaces. &lt;/p&gt;

&lt;p&gt;For example, you could take the costs related to a SQL instance and associate them with a specific pod. Suppose you have a namespace called “app-backend” containing microservices with their own dedicated Azure SQL database. This database is provisioned under the &lt;a href="https://docs.microsoft.com/en-us/azure/azure-sql/managed-instance/sql-managed-instance-paas-overview" rel="noopener noreferrer"&gt;Managed Instance&lt;/a&gt; model, and you would like all of its costs to be attributed to this one specific namespace in the form of external costs. In this scenario, you would apply a tag to the SQL database instance with the tag key “kubernetes_namespace” and the tag-value “app-backend.”  That’s it -- the next time you visit Kubecost and use the Cost Allocation view (grouped by namespace), the costs of the SQL instance will be shown in the appropriate row, under the column titled “external costs''. The table below shows the various tags available in Kubecost to accomplish this type of mapping: &lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
  &lt;tr&gt;
   &lt;th&gt;Kubernetes Component
   &lt;/th&gt;
   &lt;th&gt;Azure Key
   &lt;/th&gt;
   &lt;th&gt;Azure Value
   &lt;/th&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;Cluster
   &lt;/td&gt;
   &lt;td&gt;kubernetes_cluster   
   &lt;/td&gt;
   &lt;td&gt;&amp;lt;cluster-name&amp;gt;
   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;Namespace
   &lt;/td&gt;
   &lt;td&gt;kubernetes_namespace
   &lt;/td&gt;
   &lt;td&gt;&amp;lt;namespace-name&amp;gt;
   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;Deployment
   &lt;/td&gt;
   &lt;td&gt;kubernetes_deployment
   &lt;/td&gt;
   &lt;td&gt;&amp;lt;deployment-name&amp;gt;
   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;Label
   &lt;/td&gt;
   &lt;td&gt;kubernetes_label_NAME
   &lt;/td&gt;
   &lt;td&gt;&amp;lt;label-value&amp;gt;
   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;DaemonSet
   &lt;/td&gt;
   &lt;td&gt;kubernetes_daemonset
   &lt;/td&gt;
   &lt;td&gt;&amp;lt;daemonset-name&amp;gt;
   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;Pod
   &lt;/td&gt;
   &lt;td&gt;kubernetes_pod   
   &lt;/td&gt;
   &lt;td&gt;&amp;lt;pod-name&amp;gt;
   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;Container
   &lt;/td&gt;
   &lt;td&gt;kubernetes_container
   &lt;/td&gt;
   &lt;td&gt;&amp;lt;container-name&amp;gt;
   &lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;You can learn more about tagging using the Azure portal on &lt;a href="https://docs.microsoft.com/en-us/azure/virtual-machines/tag-portal" rel="noopener noreferrer"&gt;this page&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Next, we’ll show you how to use tags to control the allocation of shared resources in the Kubecost Settings user interface.&lt;/p&gt;

&lt;h3&gt;
  
  
  Cost Allocation Configuration
&lt;/h3&gt;

&lt;p&gt;Kubecost makes it easy to configure the allocation of shared costs to Kubernetes components. Shared resources may be in the form of:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Fixed dollar value:&lt;/strong&gt;  For example, $1,000 may be shared across all namespaces&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Shared namespace:&lt;/strong&gt; For example, the cost of the default “kube-system” namespace may be spread out. The configuration field accepts a list of common-separated namespaces. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Share by label:&lt;/strong&gt; For example, the cost of pods with a label of app=splunk may be distributed. Note that in the screenshot below, the tag key named “app” is repeated and separated by a comma to capture both the “datadog” value for the key named “app” and the value “splunk” for the same key named “app.”&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm9p97p81ahox41v3bpi6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm9p97p81ahox41v3bpi6.png" title="Allocation of shared costs are controlled in the Kubecost Settings page" alt="Allocation of shared costs are controlled in the Kubecost Settings page"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The fixed dollar value is a simple and elegant solution for allocating costs of any type. For example, you may attribute the proportional maintenance labor cost of the cluster to each namespace so that your financial report reflects a fully-loaded cost. &lt;/p&gt;

&lt;p&gt;The namespace sharing feature allows you to take the costs associated with multiple namespaces and distribute them among all of the other namespaces. A namespace dedicated to hosting security software intended to protect the entire cluster is a great candidate for this feature; kube-system is another great candidate, which is created by the Kubernetes system to host common utilities such as kube-dns and kube-proxy. &lt;/p&gt;

&lt;p&gt;The third sharing feature uses labels to select just about any Kubernetes component and distribute costs proportionally among them. For example, you may have pods running your user acceptance testing (UAT) environment -- with labels, you could take all of your UAT costs and spread them across your production namespaces so that the cost of testing your software is included in your application costs. &lt;/p&gt;

&lt;p&gt;The shared costs are allocated proportionally to the percentage of in-cluster resource costs the namespaces are consuming (CPU, memory, network, storage, and GPU) so a namespace that uses more of the cluster resources would get a higher allocation of shared expenses. However, you can also instruct Kubecost to distribute the costs equally (independent of usage) across all of the namespaces for a uniform distribution.&lt;/p&gt;

&lt;h3&gt;
  
  
  Azure Cloud Assets
&lt;/h3&gt;

&lt;p&gt;So far, we focused on Kubernetes components; however, one of the exciting features introduced by Kubecost as part of its support for Azure is the ability to extend the comprehensive view to include all of your Azure spending (even if not related to AKS). &lt;/p&gt;

&lt;p&gt;This view is accessible on the navigation menu, under the section titled Assets, and it supports a full set of controls to filter, group, and sort your Azure bill in every dimension.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft4vbb5joycxzoghvnvit.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft4vbb5joycxzoghvnvit.png" title="The Assets view shows all Azure spending, not just AKS" alt="The Assets view shows all Azure spending, not just AKS"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can drill down into specific billing record details simply by selecting them. For example, the following screenshot drills into the networking charges and shows itemized charges for load balancers or specific spot instances:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2usw0j1ifc8pdsxffsf9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2usw0j1ifc8pdsxffsf9.png" title="Click to drill down into a detailed itemized view of costs" alt="Click to drill down into a detailed itemized view of costs"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Getting Started With Installation
&lt;/h3&gt;

&lt;p&gt;There are 3 steps to install Kubecost in Azure and enable access to billing data:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install Kubecost using a Helm chart. &lt;/li&gt;
&lt;li&gt;Create an Azure role definition for Kubecost in your Azure account.&lt;/li&gt;
&lt;li&gt;Enter your account information on the Kubecost Settings page.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Kubecost is available for download as a Helm chart at this link: &lt;a href="https://www.kubecost.com/install.html" rel="noopener noreferrer"&gt;https://www.kubecost.com/install.html&lt;/a&gt; and should take less than 5 minutes to install in AKS. &lt;/p&gt;

&lt;p&gt;Once you have installed Kubecost in an Azure account, you must then create an Azure role definition to provide access privileges to Kubecost in the form of JSON files. This is required for accessing accurate billing data via the Billing Rate Card API. Detailed instructions for creating an Azure role definition and sharing it with Kubecost are provided on this Kubecost documentation page: &lt;a href="http://docs.kubecost.com/azure-config.html" rel="noopener noreferrer"&gt;http://docs.kubecost.com/azure-config&lt;/a&gt; while Microsoft Azure’s own &lt;a href="https://docs.microsoft.com/en-us/azure/cloud-adoption-framework/scenarios/aks/eslz-security-governance-and-compliance#cost-governance" rel="noopener noreferrer"&gt;instruction page&lt;/a&gt; for integrating with Kubecost also documents the installation steps. &lt;/p&gt;

&lt;p&gt;The last step is to enter your Azure Subscription, Tenant, Client ID, and Client Secret in the Kubecost’s Settings user interface. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi62f9q88knv1powae8nz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi62f9q88knv1powae8nz.png" title="Azure integration information is entered in the Kubecost Settings page" alt="Azure integration information is entered in the Kubecost Settings page"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;You don’t have to accept an AKS cluster as a financial black box. With Kubecost, you can share your AKS cluster with other teams and still generate a cost allocation report within minutes of installation. Kubecost also monitors your cluster’s health and efficiency -- it’s even able to send &lt;a href="http://docs.kubecost.com/alerts.html" rel="noopener noreferrer"&gt;cost notification alerts&lt;/a&gt; when your namespace experiences an unexpected jump in spending. Look for other Kubecost articles and &lt;a href="http://docs.kubecost.com/" rel="noopener noreferrer"&gt;documentation pages&lt;/a&gt; to learn more about its growing list of functionalities. &lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>devops</category>
      <category>azure</category>
      <category>monitoring</category>
    </item>
    <item>
      <title>Hello kubectl cost: monitoring Kubernetes spend from the command line!</title>
      <dc:creator>Stefano Maffulli</dc:creator>
      <pubDate>Tue, 20 Apr 2021 23:19:10 +0000</pubDate>
      <link>https://dev.to/kubecost/hello-kubectl-cost-monitoring-kubernetes-spend-from-the-command-line-3d1m</link>
      <guid>https://dev.to/kubecost/hello-kubectl-cost-monitoring-kubernetes-spend-from-the-command-line-3d1m</guid>
      <description>&lt;p&gt;If you're terminal-loving engineers using Kubernetes like us, kubectl is your constant companion. That's why the Kubecost team built a new CLI for interacting with Kubernetes cost data. Today, we’re announcing &lt;a href="https://github.com/kubecost/kubectl-cost"&gt;kubectl cost&lt;/a&gt;, an open-source extension that fits directly into your workflow.&lt;/p&gt;

&lt;p&gt;Here’s an example of it in action: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ORzQvhD7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tmoedo6vmkv5xtmo4u5r.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ORzQvhD7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tmoedo6vmkv5xtmo4u5r.gif" alt="GIF of usage"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For teams running Kubernetes, gaining visibility into the cost of resources can be hard, especially in dynamic multi-tenant environments. &lt;a href="https://www.kubecost.com/"&gt;Kubecost&lt;/a&gt; helps teams—developers, managers, executives, and everyone in-between—running Kubernetes understand their cluster spend precisely, all the way down to the pod level. One of our primary goals is to provide cost visibility into tools that teams are already using. &lt;/p&gt;

&lt;p&gt;Kubectl cost is a &lt;a href="https://kubernetes.io/docs/tasks/extend-kubectl/kubectl-plugins/"&gt;kubectl plugin&lt;/a&gt;, a CLI tool designed for application and infrastructure engineers who interact directly with Kubernetes on a regular basis. They would benefit from understanding the costs of their various deployments and other in-cluster resources. With reporting a few keystrokes away on the familiar interface of &lt;code&gt;kubectl&lt;/code&gt;, the &lt;code&gt;cost&lt;/code&gt; plugin gives engineers quick and easy access to cost and spend efficiency information. At Kubecost, we believe that by making cost metrics more accessible we can help our users build more cost-efficient software systems. Let’s check it out.&lt;/p&gt;

&lt;h1&gt;
  
  
  How to use &lt;code&gt;kubectl cost&lt;/code&gt;
&lt;/h1&gt;

&lt;p&gt;The basic structure of &lt;code&gt;kubectl cost&lt;/code&gt; is built around various aggregations that map to Kubernetes concepts, e.g. namespace, label, deployment, statefulset, etc. It leverages Kubecost APIs which provide users with programmatic access to useful data about workloads and assets in your clusters. &lt;/p&gt;

&lt;p&gt;Let’s have a look at a few samples:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bBs20rEB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lyt6ui5ywyewbcdi9wmb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bBs20rEB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lyt6ui5ywyewbcdi9wmb.png" alt="Namespace aggregation example"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;One of the simplest queries, showing a monthly cost projection for each namespace in your cluster based on the past day of activity. This accounts for all workloads and their resources in each label. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--sOSalOuR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e7dzikpq9bn484mmob54.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sOSalOuR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e7dzikpq9bn484mmob54.png" alt="Label aggregation example"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Total cost, over the past day, broken down by the value of the &lt;code&gt;app&lt;/code&gt; label. This accounts for labels applied at both the namespace and workload-level. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7BMyuHuJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xbmqbsnltza0jsh02gz0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7BMyuHuJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xbmqbsnltza0jsh02gz0.png" alt="Deployment aggregation example"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Monthly rate projection broken down by deployment, including a more detailed look at CPU cost and CPU cost efficiency.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--g8-eHJq4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w3oslxlphcrtwc6lum78.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--g8-eHJq4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w3oslxlphcrtwc6lum78.png" alt="Namespace historical"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;How much each namespace cost last month, including CPU cost and efficiency.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Tjt_zGql--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ki29tdmabuuwxjwm6um4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Tjt_zGql--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ki29tdmabuuwxjwm6um4.png" alt="Namespace historical all metrics"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;How much each namespace cost yesterday, with all resource-specific costs and efficiencies displayed. This highlights the granular detail at which Kubecost collects cost metrics. &lt;/p&gt;

&lt;h1&gt;
  
  
  How it works
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;By default, Kubecost integrates with cloud provider billing APIs with support for AWS/EKS, Azure/AKS, GCP/GKE, and on-prem clusters via custom pricing sheets.&lt;/li&gt;
&lt;li&gt;Kubecost can integrate with your cloud provider billing data directly to accurately reflect enterprise discounts, spot prices, reserved instances, savings plans, and more.&lt;/li&gt;
&lt;li&gt;Compute and memory costs are calculated using the max of resource usage and resource requests.&lt;/li&gt;
&lt;li&gt;Network costs are optional and are enabled via the &lt;a href="https://github.com/kubecost/docs/blob/master/network-allocation.md"&gt;network-costs daemonset&lt;/a&gt;. &lt;/li&gt;
&lt;li&gt;Monthly rate projections are based on average run rate for each individual workload over the measured window. &lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Learning more
&lt;/h1&gt;

&lt;p&gt;There’s tons more to discover, check out the &lt;a href="https://github.com/kubecost/kubectl-cost/blob/main/README.md"&gt;documentation&lt;/a&gt; and &lt;code&gt;kubectl cost --help&lt;/code&gt; to keep going. We’re also going to be adding more functionality in the coming weeks. So &lt;a href="https://join.slack.com/t/kubecost/shared_invite/enQtNTA2MjQ1NDUyODE5LWFjYzIzNWE4MDkzMmUyZGU4NjkwMzMyMjIyM2E0NGNmYjExZjBiNjk1YzY5ZDI0ZTNhZDg4NjlkMGRkYzFlZTU"&gt;join our Slack community&lt;/a&gt; or reach out to &lt;a href="mailto:team@kubecost.com"&gt;team@kubecost.com&lt;/a&gt; if you have questions or additional features you’d like to see!&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>devops</category>
      <category>azure</category>
      <category>aws</category>
    </item>
  </channel>
</rss>
