-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This implements a `ListDisks` method in `gke` that is then used to list out disks for the GKE projects by zone. `ListDisks` will currently return a raw `compute.Disk` struct that is filtered by 2. Disks only associated with GKE clusters - Relates to #95
- Loading branch information
Showing
11 changed files
with
733 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,53 @@ | ||
# GKE Compute Metrics | ||
|
||
| Metric name | Metric type | Description | Labels | | ||
|--------------------------------------------------------|-------------|---------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ||
| Metric name | Metric type | Description | Labels | | ||
|------------------------------------------------------------|-------------|---------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ||
| cloudcost_gcp_gke_instance_cpu_usd_per_core_hour | Gauge | The processing cost of a GCP Compute Instance, associated to a GKE cluster, in USD/(core*h) | `cluster_name`=<name of the cluster the instance is associated with> <br/> `instance`=<name of the compute instance> <br/> `region`=<GCP region code> <br/> `family`=<broader compute family (n1, n2, c3 ...) > <br/> `machine_type`=<specific machine type, e.g.: n2-standard-2> <br/> `project`=<GCP project, where the instance is provisioned> <br/> `price_tier`=<spot\|ondemand> | | ||
| cloudcost_gcp_gke_compute_instance_memory_usd_per_gib_hour | Gauge | The memory cost of a GCP Compute Instance, associated to a GKE cluster, in USD/(GiB*h) | `cluster_name`=<name of the cluster the instance is associated with> <br/> `instance`=<name of the compute instance> <br/> `region`=<GCP region code> <br/> `family`=<broader compute family (n1, n2, c3 ...) > <br/> `machine_type`=<specific machine type, e.g.: n2-standard-2> <br/> `project`=<GCP project, where the instance is provisioned> <br/> `price_tier`=<spot\|ondemand> | | ||
| cloudcost_gcp_gke_persistent_volume_usd_per_gib_hour | Gauge | The cost of a GKE Persistent Volume in USD/(GiB*h) | `cluster_name`=<name of the cluster the instance is associated with> <br/> `namespace`=<The namespace the pvc was created for> <br/> `persistentvolume`=<Name of the persistent volume> <br/> `region`=<The region the pvc was created in> <br/> `project`=<GCP project, where the instance is provisioned> <br/> `storage_class`=<pd-standard\|pd-ssd\|pd-balanced\|pd-extreme> | | ||
|
||
## Persistent Volumes | ||
|
||
There's two sources of data for persistent volumes: | ||
- Skus from the Billing API | ||
- Disk metadata from compute API | ||
|
||
There's a bit of a disconnect between the two. | ||
Sku's descriptions have the following format: | ||
``` | ||
Balanced PD Capacity in <Region> | ||
Commitment v1: Local SSD In <Region> | ||
Extreme PD Capacity in <Region> | ||
Extreme PD IOPS in <Region> | ||
Hyperdisk Balanced Capacity in <Region> | ||
Hyperdisk Balanced IOPS in <Region> | ||
Hyperdisk Balanced Throughput in <Region> | ||
Hyperdisk Extreme Capacity in <Region> | ||
Hyperdisk Extreme IOPS in <Region> | ||
Hyperdisk Throughput Capacity in <Region> | ||
Hyperdisk Throughput Throughput Capacity in <Region> | ||
Regional Balanced PD Capacity in <Region> | ||
Regional SSD backed PD Capacity in <Region> | ||
Regional Storage PD Capacity in <Region> | ||
SSD backed Local Storage attached to Spot Preemptible VM in <Region> | ||
SSD backed Local Storage in <Region | ||
SSD backed PD Capacity in <Region> | ||
Storage PD Capacity in <Region> | ||
``` | ||
|
||
Generically, the sku descriptions have the following format: | ||
``` | ||
<sku-type> PD Capacity in <Region> | ||
``` | ||
|
||
Disk metadata has the following format: | ||
``` | ||
projects/<project>/zones/<zone>/disks/<disk-type> | ||
``` | ||
|
||
To map the sku to the disk type, we can use the following mapping: | ||
|
||
- Storage PD Capacity -> pd-standard | ||
- SSD backed PD Capacity -> pd-ssd | ||
- Balanced PD Capacity -> pd-balanced | ||
- Extreme PD Capacity -> pd-extreme |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.