kubemetricsenv.go 1018 B

1234567891011121314151617181920212223242526272829
  1. package env
  2. const (
  3. KubecostMetricsPodEnabledEnvVar = "KUBECOST_METRICS_POD_ENABLED"
  4. KubecostMetricsPodPortEnvVar = "KUBECOST_METRICS_PORT"
  5. ExportClusterCacheEnabledEnvVar = "EXPORT_CLUSTER_CACHE_ENABLED"
  6. ExportClusterInfoEnabledEnvVar = "EXPORT_CLUSTER_INFO_ENABLED"
  7. )
  8. func GetKubecostMetricsPort() int {
  9. return GetInt(KubecostMetricsPodPortEnvVar, 9005)
  10. }
  11. // IsKubecostMetricsPodEnabled returns true if the kubecost metrics pod is deployed
  12. func IsKubecostMetricsPodEnabled() bool {
  13. return GetBool(KubecostMetricsPodEnabledEnvVar, false)
  14. }
  15. // IsExportClusterCacheEnabled is set to true if the metrics pod should export the cluster cache
  16. // data to a target file location
  17. func IsExportClusterCacheEnabled() bool {
  18. return GetBool(ExportClusterCacheEnabledEnvVar, false)
  19. }
  20. // IsExportClusterInfoEnabled is set to true if the metrics pod should export its own cluster info
  21. // data to a target file location
  22. func IsExportClusterInfoEnabled() bool {
  23. return GetBool(ExportClusterInfoEnabledEnvVar, false)
  24. }