GKE (Google Kubernetes Engine) network traffic monitoring of PODs for detailed byte based billing

11/15/2019

I have the following situation:

I have a bunch of deployed things in multiple GKE clusters. I would like to generate billing for my customers who use those deployments. However, I don't want to bill them for network traffic they aren't generating, but my cluster is generating, so inter region / AZ communication is probably my doing, I don't want to bill them for that.

However, I do would like to bill them for traffic they used on / bytes basis. For this, I require to monitor outgoing and incoming traffic, by bytes, and detect if they are in the same region / AZ that the POD in question is currently in.

I heard a podcast recently that there is supposed to be an API for that. Is anyone aware of such a thing that would help me monitor network traffic in such granularity?

Note: The setup is a bit weird so I don't have individual VPCs for deployed apps, which means I can't really use VPC flow logs. It's also not enough to monitor VMs since multiple pods could be on the same VM anyways.

Does anyone know anything at all that could move me along into the right direction?

Cheers!

-- Hannibal
google-cloud-platform
google-kubernetes-engine
kubernetes

1 Answer

11/15/2019

Perhaps GKE usage metering might be of interest to you. Step by step can be found here. GKE metering will fetch resource usage/consumption from metrics servers, converts the consumption data to usage records and sends the records to a different BigQuery table in the same dataset.

-- dany L
Source: StackOverflow