Skip to content

🆕 Recommend Region which is cheapest in terms of 💵 across regions for selected instancetypes#69

Merged
Horiodino merged 9 commits intomainfrom
feature/62
Mar 27, 2025
Merged

🆕 Recommend Region which is cheapest in terms of 💵 across regions for selected instancetypes#69
Horiodino merged 9 commits intomainfrom
feature/62

Conversation

@dipankardas011
Copy link
Copy Markdown
Member

@dipankardas011 dipankardas011 commented Mar 26, 2025

🗒️ Changelog

This pull request introduces several enhancements and optimizations to the cmd package, specifically focusing on cost optimization and region selection for managed and self-managed clusters. The key changes include the addition of new methods for cost calculation, improvements to user prompts, and the introduction of asynchronous processing for cost optimization.

Cost Optimization Enhancements:

  • cmd/optimize.go: Added methods to calculate and optimize costs across different regions for both managed and self-managed clusters. These methods include findManagedOfferingCostAcrossRegions, findInstanceCostAcrossRegions, getBestRegionsWithTotalCostManaged, getBestRegionsWithTotalCostSelfManaged, OptimizeSelfManagedInstanceTypesAcrossRegions, and OptimizeManagedOfferingsAcrossRegions.

User Prompt Improvements:

  • cmd/create.go: Introduced asynchronous processing for cost optimization using goroutines and channels. Added user prompts to display cost recommendations and allow region switching based on the optimized costs. [1] [2] [3] [4]
  • cmd/userinput.go: Simplified the format of instance category selection prompts.

Code Refactoring:

Dependency Management:

  • go.mod: Added a replace directive for the ksctl module to use a local path.

These changes collectively enhance the functionality and user experience of the ksctl command-line tool by providing more efficient and cost-effective cluster management options.

Other changes:

  • Simplified the format of instance category selection in getSelectedInstanceCategory.
  • Added a module replacement in go.mod for local development.

🏋🏼 Issues

📎 Related Issues

Related to:

🚀 Task List

  • Self managed cluster wrt to 💰 wrt to 🌏 for 💻
  • Managed cluster wrt to 💰 wrt to 🌏 for 💻

🔍 Review Checklist

  • Code follows project style guidelines
  • Added/updated tests
  • Ran tests locally
  • Updated documentation
  • Checked Contribution Guidelines

📸 Screenshots/Recordings

📌 Additional Notes


💡 PR best practices
  • Keep changes focused and atomic
  • Update tests and documentation
  • Check for conflicts with main branch
  • Respond promptly to review comments
  • Follow project coding standards
  • Make sure you are using pre-commit for that run this command $ pre-commit install

Signed-off-by: Dipankar Das <65275144+dipankardas011@users.noreply.github.com>
Signed-off-by: Dipankar Das <65275144+dipankardas011@users.noreply.github.com>
Signed-off-by: Dipankar Das <65275144+dipankardas011@users.noreply.github.com>
Signed-off-by: Dipankar Das <65275144+dipankardas011@users.noreply.github.com>
Signed-off-by: Dipankar Das <65275144+dipankardas011@users.noreply.github.com>
Signed-off-by: Dipankar Das <65275144+dipankardas011@users.noreply.github.com>
@dipankardas011 dipankardas011 marked this pull request as draft March 26, 2025 05:10
Signed-off-by: Dipankar Das <65275144+dipankardas011@users.noreply.github.com>
@dipankardas011 dipankardas011 marked this pull request as ready for review March 27, 2025 06:52
Signed-off-by: Dipankar Das <65275144+dipankardas011@users.noreply.github.com>
@dipankardas011
Copy link
Copy Markdown
Member Author

@Horiodino We have to wait got the https://sum.golang.org/lookup/github.com/ksctl/ksctl/v2@v2.2.0 to get populated it seems some server error from golang is causing the go mod tidy to fail will retry after a few hour then only we can perform additional things

Signed-off-by: Dipankar Das <65275144+dipankardas011@users.noreply.github.com>
@dipankardas011
Copy link
Copy Markdown
Member Author

Now you can review

@Horiodino Horiodino added this pull request to the merge queue Mar 27, 2025
Merged via the queue into main with commit df01b41 Mar 27, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants