我有多个 GKE 集群,其中使用命名空间逻辑上分离的 K8s 对象,每个命名空间都附加了 GCS 存储桶(有状态集) 我想了解有关每个命名空间的计费信息以及每个命名空间的资源使用成本。 我发现了一个非常有用的功能,称为“GKE Metering”,是的,它通过收集计费信息并将其导入 BigQuery,显示了有关每个命名空间的 CPU 和内存计费信息的一些有用信息,然后我可以使用 Google Data Studio 等可视化结果。
问题是:
任何帮助将不胜感激🙌🏻 谢谢你
为此,您需要在 GCS 存储桶上添加标签
并获取像 BigQuery 中那样的数据
SELECT *
FROM `project.dataset.exportBillingTable`
WHERE "<Your Label Key>" IN UNNEST(labels.key)
您可以对标签键或标签值进行“分组”、“求和”、过滤...
View granular cost data from Cloud Storage usage in Cloud Billing exports to BigQuery
You can now view granular Cloud Storage bucket-level cost data in the Cloud Billing Detailed cost export. Use the resource.global_name field in the export to view and filter your detailed Cloud Storage bucket usage.