DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Because the DevOps movement has redefined engineering responsibilities, SREs now have to become stewards of observability strategy.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Related

  • The Evolution of Scalable and Resilient Container Infrastructure
  • Scaling Microservices With Docker and Kubernetes on Production
  • Can You Run a MariaDB Cluster on a $150 Kubernetes Lab? I Gave It a Shot
  • Building Reliable LLM-Powered Microservices With Kubernetes on AWS

Trending

  • IoT and Cybersecurity: Addressing Data Privacy and Security Challenges
  • How GitHub Copilot Helps You Write More Secure Code
  • Prioritizing Cloud Security Risks: A Developer's Guide to Tackling Security Debt
  • How Kubernetes Cluster Sizing Affects Performance and Cost Efficiency in Cloud Deployments
  1. DZone
  2. Software Design and Architecture
  3. Containers
  4. Automating Kubernetes Workload Rightsizing With StormForge

Automating Kubernetes Workload Rightsizing With StormForge

StormForge automates Kubernetes workload rightsizing using machine learning to optimize resource utilization and performance.

By 
Sai Sandeep Ogety user avatar
Sai Sandeep Ogety
DZone Core CORE ·
Jan. 06, 25 · Tutorial
Likes (12)
Comment
Save
Tweet
Share
3.4K Views

Join the DZone community and get the full member experience.

Join For Free

As Kubernetes workloads grow in complexity, ensuring optimal resource utilization while maintaining performance becomes a significant challenge. Over-provisioning leads to wasted costs, while under-provisioning can degrade application performance. StormForge offers a machine learning-driven approach to automate workload rightsizing, helping teams strike the perfect balance between cost and performance. 

This article provides a comprehensive guide to implementing StormForge for Kubernetes workload optimization.

Prerequisites

Before getting started, ensure you have a working Kubernetes cluster (using tools like minikube, kind, or managed services like RKS, GKE, EKS, or AKS). You’ll also need Helm, kubectl, and the StormForge CLI installed, along with an active StormForge account. A monitoring solution like Prometheus is recommended but optional.

Set Up Your Environment

Ensure Kubernetes Cluster Access

Have a working Kubernetes cluster (e.g., Minikube, Kind, GKE, EKS, or AKS).

Confirm cluster connectivity:

Shell
 
kubectl get nodes


Install Helm

Verify Helm installation:

Shell
 
helm version


Install Helm if needed by following Helm Installation Instructions.

Deploy a Sample Application

Use a simple example application, such as Nginx:

Shell
 
kubectl apply -f https://k8s.io/examples/application/deployment.yaml


Confirm the application is running:

Shell
 
kubectl get pods


Install the StormForge CLI

Download and install the StormForge CLI:

Shell
 
curl -fsSL https://downloads.stormforge.io/install | bash


Authenticate the CLI with your StormForge account:

Shell
 
stormforge login


Deploy the StormForge Agent

Use the StormForge CLI to initialize your Kubernetes cluster:

Shell
 
stormforge init


Verify that the StormForge agent is deployed:

Shell
 
kubectl get pods -n stormforge-system


Create a StormForge Experiment

Define an experiment YAML file (e.g., experiment.yaml):

YAML
 
apiVersion: optimize.stormforge.io/v1
kind: Experiment
metadata:
  name: nginx-optimization
spec:
  target:
    deployments:
    - name: nginx-deployment
      containers:
      - name: nginx
        requests:
          cpu: "100m"
          memory: "128Mi"
        limits:
          cpu: "500m"
          memory: "256Mi"


Apply the experiment configuration:

Shell
 
stormforge apply -f experiment.yaml


Run the Optimization Process

Start the optimization:

Shell
 
stormforge optimize run nginx-optimization


Monitor the progress of the optimization using the CLI or StormForge dashboard.

Review and Apply Recommendations

Once the optimization is complete, retrieve the recommendations:

Shell
 
stormforge optimize recommendations nginx-optimization


Update your Kubernetes deployment manifests with the recommended settings:

Shell
 
requests:
  cpu: "200m"
  memory: "160Mi"
limits:
  cpu: "400m"
  memory: "240Mi"


Apply the updated configuration:

Shell
 
kubectl apply -f updated-deployment.yaml


Validate the Changes

Confirm that the deployment is running with the updated settings:

Shell
 
kubectl get pods


Monitor resource utilization to verify the improvements:

Shell
 
kubectl top pods


Integrate with Monitoring Tools (Optional)

If Prometheus is not installed, you can install it for additional metrics:

Shell
 
helm install prometheus prometheus-community/prometheus


Use Prometheus metrics for deeper insights into resource usage and performance.

Automate for Continuous Optimization

Set up a recurring optimization schedule using CI/CD pipelines. Then, regularly review recommendations as application workloads evolve.

Conclusion

StormForge provides an efficient and automated solution for optimizing Kubernetes workloads by leveraging machine learning to balance performance and resource utilization. By following the step-by-step guide, you can easily integrate StormForge into your Kubernetes environment, deploy experiments, and apply data-driven recommendations to rightsize your applications. 

This process minimizes costs by eliminating resource wastage and ensures consistent application performance. Integrating StormForge into your DevOps workflows enables continuous optimization, allowing your teams to focus on innovation while maintaining efficient and reliable Kubernetes operations.

Kubernetes

Opinions expressed by DZone contributors are their own.

Related

  • The Evolution of Scalable and Resilient Container Infrastructure
  • Scaling Microservices With Docker and Kubernetes on Production
  • Can You Run a MariaDB Cluster on a $150 Kubernetes Lab? I Gave It a Shot
  • Building Reliable LLM-Powered Microservices With Kubernetes on AWS

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!