我在 GKE 中的一个日志循环导致我 3 天内花费了 1300 美元——是我的实际基础设施成本的 9.2 倍
3 分•作者: nthypes•7 个月前
上个月,我 GKE 集群(圣保罗地区)中的一个容器进入了错误循环,以大约每秒 2000 条日志的速度向 stdout 输出。
我以惨痛的教训发现,GKE 的默认行为是将 100% 的日志摄入 Cloud Logging,且没有速率限制。在警报发现问题之前,我的账单飙升了近 1000%。
基础设施(计算):约 140 美元(821 雷亚尔) Cloud Logging:约 1300 美元(7554 雷亚尔)
比例:日志记录成本是实际服务器的 9.2 倍。
[图片链接]
我修复了循环,并立即暂停了 `_Default` 接收器。
我提交了一个账单工单,请求对失控资源进行“一次性礼遇调整”——这在 AWS/Azure 上对于首次出现的异常情况是标准做法。
我已经两次被拒绝。
最新的回复是:“由于我们的内部政策,团队拒绝了调整请求。”
如果你运行 GKE,Log Router 中的 `_Default` 接收器会捕获所有容器的 stdout/stderr。
摄入量没有默认上限,这简直荒谬!
一个简单的 while(true); do echo "error"; done 就能让一个小项目破产。
转到 Logging -> Log Router。编辑 _Default 接收器。
添加一个排除过滤器:resource.type="k8s_container" severity=INFO(或排除特定的命名空间)。
最近有人成功将账单争议升级到 Tier 1 支持之外吗?
他们的政策似乎是现在即使对于明显的失控/意外使用也要强制全额付款,这很荒谬,因为这只是日志!文本!
查看原文
Last month, a single container in my GKE cluster (Sao Paulo region) entered an error loop, outputting to stdout at ~2k logs/second.
I discovered the hard way that GKE's default behavior is to ingest 100% of this into Cloud Logging with no rate limiting. My bill jumped nearly 1000% before alerts caught it.<p>Infrastructure (Compute): ~$140 (R$821 BRL) Cloud Logging: ~$1,300 (R$7,554 BRL)<p>Ratio: Logging cost 9.2x the actual servers.<p>https://imgur.com/jGrxnkh<p>I fixed the loop and paused the `_Default` sink immediately.<p>I opened a billing ticket requesting a "one-time courtesy adjustment" for a runaway resource—standard practice for first-time anomalies on AWS/Azure.<p>I have been rejected twice.<p>The latest response: "The team has declined the adjustment request due to our internal policies."<p>If you run GKE, the `_Default` sink in Log Router captures all container stdout/stderr.<p>There is NO DEFAULT CAP on ingestion volume which is an absurd!<p>A simple while(true); do echo "error"; done can bankrupt a small project.<p>Go to Logging -> Log Router. Edit _Default sink.<p>Add an exclusion filter: resource.type="k8s_container" severity=INFO (or exclude specific namespaces).<p>Has anyone successfully escalated a billing dispute past Tier 1 support recently?<p>It seems their policy is now to enforce full payment even on obvious runaway/accidental usage which is absurd since its LOGS! TEXT!