Google Cloud 平台成本估算器使用指南

Google Cloud 平台成本估算器使用指南

google-cloud-pricing-cost-calculator 💸 Calculate estimated monthly costs of Google Cloud Platform products and resources via YAML files and CLI program (Linux, macOS, Windows) 项目地址: https://gitcode.com/gh_mirrors/go/google-cloud-pricing-cost-calculator

项目介绍

Google Cloud 平台成本估算器 是一个由 Cyclenerd 开发的开源工具,旨在帮助 DevOps 工程师、架构师及技术人员快速预估 Google Cloud Platform(GCP)资源的月度花费。该工具通过 YAML 文件定义资源使用情况,并利用命令行界面(CLI)程序执行计算,结果以易于非技术用户理解的 CSV 格式保存。重要的是,所有计算在本地完成,无需联网,确保数据私密性。

项目快速启动

步骤 1: 获取 gcosts 程序

首先,下载适用于您操作系统的预先编译好的 gcosts CLI 程序:

对于 Linux 用户:
curl -L "https://github.com/Cyclenerd/google-cloud-pricing-cost-calculator/releases/latest/download/gcosts-linux-x86_64" -o "gcosts" && chmod +x "gcosts"

或者对于 ARM64 设备:

curl -L "https://github.com/Cyclenerd/google-cloud-pricing-cost-calculator/releases/latest/download/gcosts-linux-arm64" -o "gcosts" && chmod +x "gcosts"
macOS 用户:
curl -L "https://github.com/Cyclenerd/google-cloud-pricing-cost-calculator/releases/latest/download/gcosts-macos-x86_64" -o "gcosts" && chmod +x "gcosts"

或对于苹果M系列芯片:

curl -L "https://github.com/Cyclenerd/google-cloud-pricing-cost-calculator/releases/latest/download/gcosts-macos-arm64" -o "gcosts" && chmod +x "gcosts"
Windows 用户:

PowerShell 命令:

Invoke-WebRequest -Uri "https://github.com/Cyclenerd/google-cloud-pricing-cost-calculator/releases/latest/download/gcosts-windows-x86_64.exe" -OutFile "gcosts.exe"

或针对 ARM64:

Invoke-WebRequest -Uri "https://github.com/Cyclenerd/google-cloud-pricing-cost-calculator/releases/latest/download/gcosts-windows-arm64.exe" -OutFile "gcosts.exe"

步骤 2: 下载价格信息文件

curl -L "https://github.com/Cyclenerd/google-cloud-pricing-cost-calculator/raw/master/pricing.yml" -o "pricing.yml"

步骤 3: 创建并运行示例

  1. 创建一个目录用于存放 YAML 使用文件,如 usage
  2. 在该目录下创建一个名为 resources.yml 的文件,填写资源使用情况。
    region: europe-west4
    project: my-first-project
    instances:
      - name: app-server
        type: e2-standard-8
        os: rhel
        commitment: 3
        disks:
          - name: disk-boot
            type: pd-ssd
            sizeGb: 75
    
  3. 运行 gcosts 来计算成本(替换 YML-PRICING-PATH 为实际价格文件路径):
    • Linux 或 macOS
      ./gcosts calc --pricing path/to/pricing.yml
      
    • Windows
      .\gcosts.exe calc --pricing path\to\pricing.yml
      

应用案例和最佳实践

最佳实践包括定期更新 pricing.yml 文件以反映最新的价格变动,以及为不同的项目或环境创建独立的 YAML 配置文件来管理成本估计,以便更精细地控制和分析。

典型生态项目

虽然该项目本身是自给自足的,但可以与其他自动化部署、成本监控工具集成,例如结合 Terraform 自动化资源部署后,使用 GCP 成本估算器预先评估配置的成本影响。此外,与财务管理系统集成,可以帮助企业更好地预算和预报云支出。


此指南提供了快速上手所需的基本步骤和建议,确保您能够高效利用 Google Cloud Platform 成本估算器来优化您的云成本管理。

google-cloud-pricing-cost-calculator 💸 Calculate estimated monthly costs of Google Cloud Platform products and resources via YAML files and CLI program (Linux, macOS, Windows) 项目地址: https://gitcode.com/gh_mirrors/go/google-cloud-pricing-cost-calculator

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

孔岱怀

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值