SlideShare a Scribd company logo
1 of 34
Download to read offline
Kubernetes Cloud Cost
Monitoring with OpenCost &
Optimization Strategies
Matt Ray
Senior Community Manager for OpenCost
mattray@kubecost.com
SCaLE 20x
Who am I?
Matt Ray
• Senior Community Manager for OpenCost at Kubecost.
• Co-host of the Software Defined Talk podcast for 8+ years.
• Living in Sydney, Australia for 6+ years after relocating from
Austin, Texas.
• Active in Open Source for much, much longer.
• mattray@kubecost.com
• https://www.linkedin.com/in/mhray/
• @mattray on GitHub, Mastodon, too many Slacks
The complexity of operating Kubernetes
efficiently is real
3
Technical
COMPLEXITY
Metal
VMs
K8s
Higher-level abstractions, more shared
resources, and increasingly dynamic
Behavioral
COMPLEXITY
Decentralized releases means any
engineer can increase spend quickly
Abstraction
Any engineer Any org Any time
$
$
$
$
$
$
OpenCost
Specification and Implementation
Cloud Native Computing Foundation Sandbox Project
FinOps Certified Solution
• https://opencost.io
• https://github.com/opencost
• https://www.cncf.io/projects/opencost/
Open source Kubernetes cost monitoring
OpenCost Specification
• Adobe
• Armory
• AWS
• D2IQ
• Google Cloud
• Kubecost
• Mindcurv
• New Relic
• Pixie
• Red Hat
• SUSE
Created by a community of Kubernetes practitioners
https://github.com/opencost/opencost/blob/develop/spec/opencost-specv01.md
OpenCost Specification
https://github.com/opencost/opencost/blob/develop/spec/opencost-specv01.md
Kubernetes workloads are often transient and vary in the resources they consume.
How do we measure who is responsible for what and how much?
• Management fees
• Expenses from nodes
• Persistent volumes
• Attached disks
• Load balancers
• Network ingress/egress
Total Cluster Costs
=
Total Cluster Costs = Cluster Asset Costs + Cluster Overhead Costs
Total Cluster Costs
Cluster Asset Costs
Cluster Overhead Costs
Cluster Asset Costs
Cluster Asset Costs = Resource Allocation Costs + Resource Usage Costs
=
Total Cluster Costs
Cluster Asset Costs
Cluster Overhead Costs
Resource
Allocation
Costs
Resource
Usage
Costs
Cluster Overhead Costs
Cluster Asset Costs: Node Costs
Cluster Asset Costs = Resource Allocation Costs + Resource Usage Costs
=
Total Cluster Costs
Resource
Allocation
Costs
Resource
Usage
Costs
Cluster Overhead Costs
Network
Egress
Cluster Management Fees
Persistent
Volume
Load
Balancer
Node (CPU,
RAM, GPU)
We've got the cost of our
Kubernetes assets
Now let's distribute them across Workloads
Workload Costs
Inside the Kubernetes Cluster
What is Measured
• CPU
• Memory
• GPU
• Storage Volume
• Load Balancer
Aggregations
• Container
• Pod
• Deployment
• StatefulSet
• Job
• Controller Name
• Controller Kind
• Label
• Annotation
• Namespace
• Node
• Cluster
Workload Costs + Cluster Idle Costs
Total Cluster Costs = Workloads + Cluster Idle Costs + Cluster Overhead Costs
=
Total Cluster Costs
Resource
Allocation
Costs
Resource
Usage
Costs
Cluster Overhead Costs
Total Cluster Costs
Workload Costs
Cluster Overhead Costs
Cluster
Idle
Costs
Workload Costs + Cluster Idle Costs
Total Cluster Costs = Workloads + Cluster Idle Costs + Cluster Overhead Costs
=
Total Cluster Costs
Resource
Allocation
Costs
Resource
Usage
Costs
Cluster Overhead Costs
Workload Costs
Cluster Overhead Costs
Cluster
Idle
Costs
Workload Costs + Cluster Idle Costs
Total Cluster Costs = Workloads + Cluster Idle Costs + Cluster Overhead Costs
=
Total Cluster Costs
Resource
Allocation
Costs
Resource
Usage
Costs
Cluster Overhead Costs
Cluster
Idle
Costs
Allocated
Costs
Cluster Overhead Costs
Usage
Costs
Cluster Idle Cost
Idle costs can be calculated at the Asset/Resource and at the Workload level.
Cluster Idle Cost = Cluster Asset Costs – Workload Costs
Allocated Idle
Total CPU Capacity
I understand what we're
measuring
How do I get at the metrics?
OpenCost Architecture
OpenCost
Deploying OpenCost
https://www.opencost.io/docs/install
Prometheus
• Prom community Helm chart the default
OpenCost Manifest
• kubectl apply --namespace opencost -f
https://raw.githubusercontent.com/opencost/opencost/develop/kubernetes/opencost.yaml
OpenCost Helm Chart
• https://github.com/opencost/opencost-helm-chart/
• Configurable settings (Prometheus, namespaces, etc.)
Accessing OpenCost
• API
• Web UI
• kubectl cost
• Prometheus
What's the Future of
OpenCost?
What's the Future of
OpenCost?
What do you want it to be?
Near-Term Roadmap
• External Asset Costs
• Backstage integration
• More Clouds
• More Documentation
• More Integrations
Get Involved with OpenCost
https://www.opencost.io
Slack
• https://slack.cncf.io/ #opencost
GitHub
• https://github.com/opencost/opencost
• https://github.com/opencost/opencost-helm-chart
• https://github.com/opencost/opencost-website
OpenCost Working Group
• https://bit.ly/opencost-calendar
• https://bit.ly/opencost-meeting
LinkedIn
• https://www.linkedin.com/showcase/opencost/
Kubernetes Optimization
Strategies
We've got the numbers, now what do we do?
FinOps
https://finops.org
The FinOps Foundation provides guidance on
cloud financial management through best
practices, education, and standards.
Establish a FinOps practice within your
organization.
27
Domains
Personas
FinOps Practitioner
Executive
Business/Product Owner
Finance/Procurement
Engineering/Operations
Principles
▸ Teams need to collaborate
▸ Everyone takes ownership for their
cloud usage
▸ A centralized team drives FinOps
▸ Reports should be accessible
and timely
▸ Decisions are driven by business
value of cloud
▸ Take advantage of the variable cost
model of the cloud
Understanding
Cloud Usage
and Cost
Performance
Tracking &
Benchmarking
Real-Time
Decision Making
Cloud Rate
Optimization
Cloud Usage
Optimization
Organizational
Alignment
FinOps
Framework
Maturity
Phases
Rates
& Usage
FinOps is an evolving cloud financial management discipline
and cultural practice that enables organizations to get
maximum business value by helping engineering, finance &
business teams to collaborate on data-driven spending decision
Crawl Walk Run
Slide provided by the FinOps Foundation under the CC BY 4.0
Optimization Strategy
Start at the top
Efficiencies and cost savings compound
Coordinate your savings across the org
This is an iterative process
Abandoned Workloads
• Deleting abandoned pods, controllers, or even entire namespaces
Right Sizing Containers
• Updating pod manifests to reflect observed usage
• Providing requests and possibly LimitRanges for default resource allocations
• Always provide CPU requests, probably do not use CPU limits
• Always use memory requests and make limits equivalent
Managing Unclaimed Volumes
• Delete volumes that are unused by any pods or move them to a cheaper storage tier
Workload Strategies
Applications Running on Kubernetes
Kubernetes Strategies
Cluster Configurations
Right Sizing Cluster Nodes
• Adjust the number and size of your cluster's nodes to stop overspending on unused
capacity
• AMD CPUs may be less expensive than Intel for some workloads
Underutilized Nodes
• Adjust the number and type of your cluster's nodes to stop overspending on unused
capacity
• Check CPU, memory, storage class, and network requirements
Managing Unclaimed Volumes
• Delete volumes that are unused by any pods or move them to a cheaper storage tier
Operating System Optimizations
Under the Kubernetes Clusters
Delete Unassigned Resources
• Disks and IP addresses that are not being used by any clusters may continue to incur
charges
Resize Local Disks
• Resize local disks with low utilization
Switch to Arm architecture
• Arm CPUs are generally less expensive than Intel across cloud providers for similar
performance
Cloud Infrastructure Optimizations
Cloud FinOps
Reserved Instances
• Consider purchasing reserved instances based on historical resource usage patterns
Spot Instances
• Identify workloads ready for spot (preemptible) nodes and resize your cluster to realize
the savings of migrating workloads to spot
Savings Plans
• Talk to your cloud vendor about all your options
This is why you have a FinOps team.
Optimization Strategy
Start at the top
Efficiencies and cost savings compound
Coordinate your savings across the org
This is an iterative process
Thanks!
opencost@kubecost.com

More Related Content

Similar to SCaLE 20X: Kubernetes Cloud Cost Monitoring with OpenCost & Optimization Strategies

Building a Just-in-Time Application Stack for Analysts
Building a Just-in-Time Application Stack for AnalystsBuilding a Just-in-Time Application Stack for Analysts
Building a Just-in-Time Application Stack for AnalystsAvere Systems
 
Monitoring kubernetes across data center and cloud
Monitoring kubernetes across data center and cloudMonitoring kubernetes across data center and cloud
Monitoring kubernetes across data center and cloudDatadog
 
Private Cloud with Open Stack, Docker
Private Cloud with Open Stack, DockerPrivate Cloud with Open Stack, Docker
Private Cloud with Open Stack, DockerDavinder Kohli
 
AWS re:Invent 2016: Netflix: Container Scheduling, Execution, and Integration...
AWS re:Invent 2016: Netflix: Container Scheduling, Execution, and Integration...AWS re:Invent 2016: Netflix: Container Scheduling, Execution, and Integration...
AWS re:Invent 2016: Netflix: Container Scheduling, Execution, and Integration...Amazon Web Services
 
AWS Sydney Summit 2013 - Big Data Analytics
AWS Sydney Summit 2013 - Big Data AnalyticsAWS Sydney Summit 2013 - Big Data Analytics
AWS Sydney Summit 2013 - Big Data AnalyticsAmazon Web Services
 
Latest (storage IO) patterns for cloud-native applications
Latest (storage IO) patterns for cloud-native applications Latest (storage IO) patterns for cloud-native applications
Latest (storage IO) patterns for cloud-native applications OpenEBS
 
High Performance Computing with AWS
High Performance Computing with AWSHigh Performance Computing with AWS
High Performance Computing with AWSAmazon Web Services
 
Centralizing Kubernetes and Container Operations
Centralizing Kubernetes and Container OperationsCentralizing Kubernetes and Container Operations
Centralizing Kubernetes and Container OperationsKublr
 
Lc3 beijing-june262018-sahdev zala-guangya
Lc3 beijing-june262018-sahdev zala-guangyaLc3 beijing-june262018-sahdev zala-guangya
Lc3 beijing-june262018-sahdev zala-guangyaSahdev Zala
 
Save 60% of Kubernetes storage costs on AWS & others with OpenEBS
Save 60% of Kubernetes storage costs on AWS & others with OpenEBSSave 60% of Kubernetes storage costs on AWS & others with OpenEBS
Save 60% of Kubernetes storage costs on AWS & others with OpenEBSMayaData Inc
 
Burst workloads Cutting costs with Kubernetes and Virtual Kubelet
Burst workloads Cutting costs with Kubernetes and Virtual KubeletBurst workloads Cutting costs with Kubernetes and Virtual Kubelet
Burst workloads Cutting costs with Kubernetes and Virtual KubeletAdi Polak
 
Containerized architectures for deep learning
Containerized architectures for deep learningContainerized architectures for deep learning
Containerized architectures for deep learningAntje Barth
 
HPC and cloud distributed computing, as a journey
HPC and cloud distributed computing, as a journeyHPC and cloud distributed computing, as a journey
HPC and cloud distributed computing, as a journeyPeter Clapham
 
Webcast: DevOps in AWS is different! How can containers help?
Webcast: DevOps in AWS is different! How can containers help? Webcast: DevOps in AWS is different! How can containers help?
Webcast: DevOps in AWS is different! How can containers help? Applatix
 
Kubernetes Internals
Kubernetes InternalsKubernetes Internals
Kubernetes InternalsShimi Bandiel
 
Project Gardener - EclipseCon Europe - 2018-10-23
Project Gardener - EclipseCon Europe - 2018-10-23Project Gardener - EclipseCon Europe - 2018-10-23
Project Gardener - EclipseCon Europe - 2018-10-23msohn
 
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMwareVMUG IT
 
Breaking the Monolith Road to Containers
Breaking the Monolith Road to ContainersBreaking the Monolith Road to Containers
Breaking the Monolith Road to ContainersAmazon Web Services
 
Designing OpenStack Architectures
Designing OpenStack ArchitecturesDesigning OpenStack Architectures
Designing OpenStack ArchitecturesKamesh Pemmaraju
 

Similar to SCaLE 20X: Kubernetes Cloud Cost Monitoring with OpenCost & Optimization Strategies (20)

Building a Just-in-Time Application Stack for Analysts
Building a Just-in-Time Application Stack for AnalystsBuilding a Just-in-Time Application Stack for Analysts
Building a Just-in-Time Application Stack for Analysts
 
Monitoring kubernetes across data center and cloud
Monitoring kubernetes across data center and cloudMonitoring kubernetes across data center and cloud
Monitoring kubernetes across data center and cloud
 
Private Cloud with Open Stack, Docker
Private Cloud with Open Stack, DockerPrivate Cloud with Open Stack, Docker
Private Cloud with Open Stack, Docker
 
AWS re:Invent 2016: Netflix: Container Scheduling, Execution, and Integration...
AWS re:Invent 2016: Netflix: Container Scheduling, Execution, and Integration...AWS re:Invent 2016: Netflix: Container Scheduling, Execution, and Integration...
AWS re:Invent 2016: Netflix: Container Scheduling, Execution, and Integration...
 
AWS Sydney Summit 2013 - Big Data Analytics
AWS Sydney Summit 2013 - Big Data AnalyticsAWS Sydney Summit 2013 - Big Data Analytics
AWS Sydney Summit 2013 - Big Data Analytics
 
Latest (storage IO) patterns for cloud-native applications
Latest (storage IO) patterns for cloud-native applications Latest (storage IO) patterns for cloud-native applications
Latest (storage IO) patterns for cloud-native applications
 
High Performance Computing with AWS
High Performance Computing with AWSHigh Performance Computing with AWS
High Performance Computing with AWS
 
Centralizing Kubernetes and Container Operations
Centralizing Kubernetes and Container OperationsCentralizing Kubernetes and Container Operations
Centralizing Kubernetes and Container Operations
 
Lc3 beijing-june262018-sahdev zala-guangya
Lc3 beijing-june262018-sahdev zala-guangyaLc3 beijing-june262018-sahdev zala-guangya
Lc3 beijing-june262018-sahdev zala-guangya
 
Save 60% of Kubernetes storage costs on AWS & others with OpenEBS
Save 60% of Kubernetes storage costs on AWS & others with OpenEBSSave 60% of Kubernetes storage costs on AWS & others with OpenEBS
Save 60% of Kubernetes storage costs on AWS & others with OpenEBS
 
Burst workloads Cutting costs with Kubernetes and Virtual Kubelet
Burst workloads Cutting costs with Kubernetes and Virtual KubeletBurst workloads Cutting costs with Kubernetes and Virtual Kubelet
Burst workloads Cutting costs with Kubernetes and Virtual Kubelet
 
Containerized architectures for deep learning
Containerized architectures for deep learningContainerized architectures for deep learning
Containerized architectures for deep learning
 
Intro to kubernetes
Intro to kubernetesIntro to kubernetes
Intro to kubernetes
 
HPC and cloud distributed computing, as a journey
HPC and cloud distributed computing, as a journeyHPC and cloud distributed computing, as a journey
HPC and cloud distributed computing, as a journey
 
Webcast: DevOps in AWS is different! How can containers help?
Webcast: DevOps in AWS is different! How can containers help? Webcast: DevOps in AWS is different! How can containers help?
Webcast: DevOps in AWS is different! How can containers help?
 
Kubernetes Internals
Kubernetes InternalsKubernetes Internals
Kubernetes Internals
 
Project Gardener - EclipseCon Europe - 2018-10-23
Project Gardener - EclipseCon Europe - 2018-10-23Project Gardener - EclipseCon Europe - 2018-10-23
Project Gardener - EclipseCon Europe - 2018-10-23
 
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
 
Breaking the Monolith Road to Containers
Breaking the Monolith Road to ContainersBreaking the Monolith Road to Containers
Breaking the Monolith Road to Containers
 
Designing OpenStack Architectures
Designing OpenStack ArchitecturesDesigning OpenStack Architectures
Designing OpenStack Architectures
 

More from Matt Ray

Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostMatt Ray
 
HashiTalks 2020 - Chef Tools & Terraform: Better Together
HashiTalks 2020 - Chef Tools & Terraform: Better TogetherHashiTalks 2020 - Chef Tools & Terraform: Better Together
HashiTalks 2020 - Chef Tools & Terraform: Better TogetherMatt Ray
 
EmacsConf 2019: Interactive Remote Debugging and Development with TRAMP Mode
EmacsConf 2019: Interactive Remote Debugging and Development with TRAMP ModeEmacsConf 2019: Interactive Remote Debugging and Development with TRAMP Mode
EmacsConf 2019: Interactive Remote Debugging and Development with TRAMP ModeMatt Ray
 
Wellington DevOps: Bringing Your Applications into the Future with Habitat
Wellington DevOps: Bringing Your Applications into the Future with HabitatWellington DevOps: Bringing Your Applications into the Future with Habitat
Wellington DevOps: Bringing Your Applications into the Future with HabitatMatt Ray
 
DevOps Days Singapore 2018 Ignite - Bringing Your Applications into the Futur...
DevOps Days Singapore 2018 Ignite - Bringing Your Applications into the Futur...DevOps Days Singapore 2018 Ignite - Bringing Your Applications into the Futur...
DevOps Days Singapore 2018 Ignite - Bringing Your Applications into the Futur...Matt Ray
 
Cloud Expo Asia 20181010 - Bringing Your Applications into the Future with Ha...
Cloud Expo Asia 20181010 - Bringing Your Applications into the Future with Ha...Cloud Expo Asia 20181010 - Bringing Your Applications into the Future with Ha...
Cloud Expo Asia 20181010 - Bringing Your Applications into the Future with Ha...Matt Ray
 
Compliance as Code Everywhere
Compliance as Code EverywhereCompliance as Code Everywhere
Compliance as Code EverywhereMatt Ray
 
DevOpsDays Jakarta: State of DevOps 2018
DevOpsDays Jakarta: State of DevOps 2018DevOpsDays Jakarta: State of DevOps 2018
DevOpsDays Jakarta: State of DevOps 2018Matt Ray
 
DevOps Talks Melbourne 2018: Whales, Cats and Kubernetes
DevOps Talks Melbourne 2018: Whales, Cats and KubernetesDevOps Talks Melbourne 2018: Whales, Cats and Kubernetes
DevOps Talks Melbourne 2018: Whales, Cats and KubernetesMatt Ray
 
Infrastructure and Compliance Delight with Chef Automate
Infrastructure and Compliance Delight with Chef AutomateInfrastructure and Compliance Delight with Chef Automate
Infrastructure and Compliance Delight with Chef AutomateMatt Ray
 
Cooking Up Windows with Chef Automate
Cooking Up Windows with Chef AutomateCooking Up Windows with Chef Automate
Cooking Up Windows with Chef AutomateMatt Ray
 
DevOpsDays Singapore - Continuous Auditing with Compliance as Code
DevOpsDays Singapore - Continuous Auditing with Compliance as CodeDevOpsDays Singapore - Continuous Auditing with Compliance as Code
DevOpsDays Singapore - Continuous Auditing with Compliance as CodeMatt Ray
 
DevOpsDays Singapore Habitat Ignite
DevOpsDays Singapore Habitat IgniteDevOpsDays Singapore Habitat Ignite
DevOpsDays Singapore Habitat IgniteMatt Ray
 
Chef Automate - Azure Sydney User Group
Chef Automate - Azure Sydney User GroupChef Automate - Azure Sydney User Group
Chef Automate - Azure Sydney User GroupMatt Ray
 
Automating Compliance with InSpec - AWS North Sydney
Automating Compliance with InSpec - AWS North SydneyAutomating Compliance with InSpec - AWS North Sydney
Automating Compliance with InSpec - AWS North SydneyMatt Ray
 
Automating Applications with Habitat - Sydney Cloud Native Meetup
Automating Applications with Habitat - Sydney Cloud Native MeetupAutomating Applications with Habitat - Sydney Cloud Native Meetup
Automating Applications with Habitat - Sydney Cloud Native MeetupMatt Ray
 
Automating AWS Compliance with InSpec
Automating AWS Compliance with InSpec Automating AWS Compliance with InSpec
Automating AWS Compliance with InSpec Matt Ray
 
Chef Automate - Infracoders Canberra August 8, 2017
Chef Automate - Infracoders Canberra August 8, 2017Chef Automate - Infracoders Canberra August 8, 2017
Chef Automate - Infracoders Canberra August 8, 2017Matt Ray
 
OpsWorks for Chef Automate - Auckland AWS
OpsWorks for Chef Automate - Auckland AWS OpsWorks for Chef Automate - Auckland AWS
OpsWorks for Chef Automate - Auckland AWS Matt Ray
 

More from Matt Ray (20)

Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
 
HashiTalks 2020 - Chef Tools & Terraform: Better Together
HashiTalks 2020 - Chef Tools & Terraform: Better TogetherHashiTalks 2020 - Chef Tools & Terraform: Better Together
HashiTalks 2020 - Chef Tools & Terraform: Better Together
 
EmacsConf 2019: Interactive Remote Debugging and Development with TRAMP Mode
EmacsConf 2019: Interactive Remote Debugging and Development with TRAMP ModeEmacsConf 2019: Interactive Remote Debugging and Development with TRAMP Mode
EmacsConf 2019: Interactive Remote Debugging and Development with TRAMP Mode
 
Wellington DevOps: Bringing Your Applications into the Future with Habitat
Wellington DevOps: Bringing Your Applications into the Future with HabitatWellington DevOps: Bringing Your Applications into the Future with Habitat
Wellington DevOps: Bringing Your Applications into the Future with Habitat
 
DevOps Days Singapore 2018 Ignite - Bringing Your Applications into the Futur...
DevOps Days Singapore 2018 Ignite - Bringing Your Applications into the Futur...DevOps Days Singapore 2018 Ignite - Bringing Your Applications into the Futur...
DevOps Days Singapore 2018 Ignite - Bringing Your Applications into the Futur...
 
Cloud Expo Asia 20181010 - Bringing Your Applications into the Future with Ha...
Cloud Expo Asia 20181010 - Bringing Your Applications into the Future with Ha...Cloud Expo Asia 20181010 - Bringing Your Applications into the Future with Ha...
Cloud Expo Asia 20181010 - Bringing Your Applications into the Future with Ha...
 
Compliance as Code Everywhere
Compliance as Code EverywhereCompliance as Code Everywhere
Compliance as Code Everywhere
 
DevOpsDays Jakarta: State of DevOps 2018
DevOpsDays Jakarta: State of DevOps 2018DevOpsDays Jakarta: State of DevOps 2018
DevOpsDays Jakarta: State of DevOps 2018
 
DevOps Talks Melbourne 2018: Whales, Cats and Kubernetes
DevOps Talks Melbourne 2018: Whales, Cats and KubernetesDevOps Talks Melbourne 2018: Whales, Cats and Kubernetes
DevOps Talks Melbourne 2018: Whales, Cats and Kubernetes
 
Infrastructure and Compliance Delight with Chef Automate
Infrastructure and Compliance Delight with Chef AutomateInfrastructure and Compliance Delight with Chef Automate
Infrastructure and Compliance Delight with Chef Automate
 
Cooking Up Windows with Chef Automate
Cooking Up Windows with Chef AutomateCooking Up Windows with Chef Automate
Cooking Up Windows with Chef Automate
 
DevOpsDays Singapore - Continuous Auditing with Compliance as Code
DevOpsDays Singapore - Continuous Auditing with Compliance as CodeDevOpsDays Singapore - Continuous Auditing with Compliance as Code
DevOpsDays Singapore - Continuous Auditing with Compliance as Code
 
DevOpsDays Singapore Habitat Ignite
DevOpsDays Singapore Habitat IgniteDevOpsDays Singapore Habitat Ignite
DevOpsDays Singapore Habitat Ignite
 
Chef Automate - Azure Sydney User Group
Chef Automate - Azure Sydney User GroupChef Automate - Azure Sydney User Group
Chef Automate - Azure Sydney User Group
 
Automating Compliance with InSpec - AWS North Sydney
Automating Compliance with InSpec - AWS North SydneyAutomating Compliance with InSpec - AWS North Sydney
Automating Compliance with InSpec - AWS North Sydney
 
Automating Applications with Habitat - Sydney Cloud Native Meetup
Automating Applications with Habitat - Sydney Cloud Native MeetupAutomating Applications with Habitat - Sydney Cloud Native Meetup
Automating Applications with Habitat - Sydney Cloud Native Meetup
 
Automating AWS Compliance with InSpec
Automating AWS Compliance with InSpec Automating AWS Compliance with InSpec
Automating AWS Compliance with InSpec
 
Chef Automate - Infracoders Canberra August 8, 2017
Chef Automate - Infracoders Canberra August 8, 2017Chef Automate - Infracoders Canberra August 8, 2017
Chef Automate - Infracoders Canberra August 8, 2017
 
OpsWorks for Chef Automate - Auckland AWS
OpsWorks for Chef Automate - Auckland AWS OpsWorks for Chef Automate - Auckland AWS
OpsWorks for Chef Automate - Auckland AWS
 

Recently uploaded

APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 

Recently uploaded (20)

E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 

SCaLE 20X: Kubernetes Cloud Cost Monitoring with OpenCost & Optimization Strategies

  • 1. Kubernetes Cloud Cost Monitoring with OpenCost & Optimization Strategies Matt Ray Senior Community Manager for OpenCost mattray@kubecost.com SCaLE 20x
  • 2. Who am I? Matt Ray • Senior Community Manager for OpenCost at Kubecost. • Co-host of the Software Defined Talk podcast for 8+ years. • Living in Sydney, Australia for 6+ years after relocating from Austin, Texas. • Active in Open Source for much, much longer. • mattray@kubecost.com • https://www.linkedin.com/in/mhray/ • @mattray on GitHub, Mastodon, too many Slacks
  • 3. The complexity of operating Kubernetes efficiently is real 3 Technical COMPLEXITY Metal VMs K8s Higher-level abstractions, more shared resources, and increasingly dynamic Behavioral COMPLEXITY Decentralized releases means any engineer can increase spend quickly Abstraction Any engineer Any org Any time $ $ $ $ $ $
  • 4. OpenCost Specification and Implementation Cloud Native Computing Foundation Sandbox Project FinOps Certified Solution • https://opencost.io • https://github.com/opencost • https://www.cncf.io/projects/opencost/ Open source Kubernetes cost monitoring
  • 5. OpenCost Specification • Adobe • Armory • AWS • D2IQ • Google Cloud • Kubecost • Mindcurv • New Relic • Pixie • Red Hat • SUSE Created by a community of Kubernetes practitioners https://github.com/opencost/opencost/blob/develop/spec/opencost-specv01.md
  • 6. OpenCost Specification https://github.com/opencost/opencost/blob/develop/spec/opencost-specv01.md Kubernetes workloads are often transient and vary in the resources they consume. How do we measure who is responsible for what and how much? • Management fees • Expenses from nodes • Persistent volumes • Attached disks • Load balancers • Network ingress/egress
  • 7. Total Cluster Costs = Total Cluster Costs = Cluster Asset Costs + Cluster Overhead Costs Total Cluster Costs Cluster Asset Costs Cluster Overhead Costs
  • 8. Cluster Asset Costs Cluster Asset Costs = Resource Allocation Costs + Resource Usage Costs = Total Cluster Costs Cluster Asset Costs Cluster Overhead Costs Resource Allocation Costs Resource Usage Costs Cluster Overhead Costs
  • 9. Cluster Asset Costs: Node Costs Cluster Asset Costs = Resource Allocation Costs + Resource Usage Costs = Total Cluster Costs Resource Allocation Costs Resource Usage Costs Cluster Overhead Costs Network Egress Cluster Management Fees Persistent Volume Load Balancer Node (CPU, RAM, GPU)
  • 10. We've got the cost of our Kubernetes assets Now let's distribute them across Workloads
  • 11. Workload Costs Inside the Kubernetes Cluster What is Measured • CPU • Memory • GPU • Storage Volume • Load Balancer Aggregations • Container • Pod • Deployment • StatefulSet • Job • Controller Name • Controller Kind • Label • Annotation • Namespace • Node • Cluster
  • 12. Workload Costs + Cluster Idle Costs Total Cluster Costs = Workloads + Cluster Idle Costs + Cluster Overhead Costs = Total Cluster Costs Resource Allocation Costs Resource Usage Costs Cluster Overhead Costs Total Cluster Costs Workload Costs Cluster Overhead Costs Cluster Idle Costs
  • 13. Workload Costs + Cluster Idle Costs Total Cluster Costs = Workloads + Cluster Idle Costs + Cluster Overhead Costs = Total Cluster Costs Resource Allocation Costs Resource Usage Costs Cluster Overhead Costs Workload Costs Cluster Overhead Costs Cluster Idle Costs
  • 14. Workload Costs + Cluster Idle Costs Total Cluster Costs = Workloads + Cluster Idle Costs + Cluster Overhead Costs = Total Cluster Costs Resource Allocation Costs Resource Usage Costs Cluster Overhead Costs Cluster Idle Costs Allocated Costs Cluster Overhead Costs Usage Costs
  • 15. Cluster Idle Cost Idle costs can be calculated at the Asset/Resource and at the Workload level. Cluster Idle Cost = Cluster Asset Costs – Workload Costs Allocated Idle Total CPU Capacity
  • 16. I understand what we're measuring How do I get at the metrics?
  • 18. Deploying OpenCost https://www.opencost.io/docs/install Prometheus • Prom community Helm chart the default OpenCost Manifest • kubectl apply --namespace opencost -f https://raw.githubusercontent.com/opencost/opencost/develop/kubernetes/opencost.yaml OpenCost Helm Chart • https://github.com/opencost/opencost-helm-chart/ • Configurable settings (Prometheus, namespaces, etc.)
  • 19. Accessing OpenCost • API • Web UI • kubectl cost • Prometheus
  • 20.
  • 21. What's the Future of OpenCost?
  • 22. What's the Future of OpenCost? What do you want it to be?
  • 23. Near-Term Roadmap • External Asset Costs • Backstage integration • More Clouds • More Documentation • More Integrations
  • 24. Get Involved with OpenCost https://www.opencost.io Slack • https://slack.cncf.io/ #opencost GitHub • https://github.com/opencost/opencost • https://github.com/opencost/opencost-helm-chart • https://github.com/opencost/opencost-website OpenCost Working Group • https://bit.ly/opencost-calendar • https://bit.ly/opencost-meeting LinkedIn • https://www.linkedin.com/showcase/opencost/
  • 25. Kubernetes Optimization Strategies We've got the numbers, now what do we do?
  • 26. FinOps https://finops.org The FinOps Foundation provides guidance on cloud financial management through best practices, education, and standards. Establish a FinOps practice within your organization.
  • 27. 27 Domains Personas FinOps Practitioner Executive Business/Product Owner Finance/Procurement Engineering/Operations Principles ▸ Teams need to collaborate ▸ Everyone takes ownership for their cloud usage ▸ A centralized team drives FinOps ▸ Reports should be accessible and timely ▸ Decisions are driven by business value of cloud ▸ Take advantage of the variable cost model of the cloud Understanding Cloud Usage and Cost Performance Tracking & Benchmarking Real-Time Decision Making Cloud Rate Optimization Cloud Usage Optimization Organizational Alignment FinOps Framework Maturity Phases Rates & Usage FinOps is an evolving cloud financial management discipline and cultural practice that enables organizations to get maximum business value by helping engineering, finance & business teams to collaborate on data-driven spending decision Crawl Walk Run Slide provided by the FinOps Foundation under the CC BY 4.0
  • 28. Optimization Strategy Start at the top Efficiencies and cost savings compound Coordinate your savings across the org This is an iterative process
  • 29. Abandoned Workloads • Deleting abandoned pods, controllers, or even entire namespaces Right Sizing Containers • Updating pod manifests to reflect observed usage • Providing requests and possibly LimitRanges for default resource allocations • Always provide CPU requests, probably do not use CPU limits • Always use memory requests and make limits equivalent Managing Unclaimed Volumes • Delete volumes that are unused by any pods or move them to a cheaper storage tier Workload Strategies Applications Running on Kubernetes
  • 30. Kubernetes Strategies Cluster Configurations Right Sizing Cluster Nodes • Adjust the number and size of your cluster's nodes to stop overspending on unused capacity • AMD CPUs may be less expensive than Intel for some workloads Underutilized Nodes • Adjust the number and type of your cluster's nodes to stop overspending on unused capacity • Check CPU, memory, storage class, and network requirements Managing Unclaimed Volumes • Delete volumes that are unused by any pods or move them to a cheaper storage tier
  • 31. Operating System Optimizations Under the Kubernetes Clusters Delete Unassigned Resources • Disks and IP addresses that are not being used by any clusters may continue to incur charges Resize Local Disks • Resize local disks with low utilization Switch to Arm architecture • Arm CPUs are generally less expensive than Intel across cloud providers for similar performance
  • 32. Cloud Infrastructure Optimizations Cloud FinOps Reserved Instances • Consider purchasing reserved instances based on historical resource usage patterns Spot Instances • Identify workloads ready for spot (preemptible) nodes and resize your cluster to realize the savings of migrating workloads to spot Savings Plans • Talk to your cloud vendor about all your options This is why you have a FinOps team.
  • 33. Optimization Strategy Start at the top Efficiencies and cost savings compound Coordinate your savings across the org This is an iterative process