Documentation
¶
Index ¶
- Constants
- func GetAPIPort() int
- func GetAWSAccessKeyID() string
- func GetAWSAccessKeySecret() string
- func GetAWSClusterID() string
- func GetAWSPricingURL() string
- func GetAlibabaAccessKeyID() string
- func GetAlibabaAccessKeySecret() string
- func GetAzureBillingAccount() string
- func GetAzureOfferID() string
- func GetCSVEndpoint() string
- func GetCSVPath() string
- func GetCSVRegion() string
- func GetCloudCostConfigPath() string
- func GetCloudCostMonthToDateInterval() int
- func GetCloudCostQueryWindowDays() int64
- func GetCloudCostRefreshRateHours() int64
- func GetCloudCostRunWindowDays() int64
- func GetCloudProviderAPIKey() string
- func GetClusterID() string
- func GetClusterProfile() string
- func GetConfigBucketFile() string
- func GetConfigPathWithDefault(defaultValue string) string
- func GetCostAnalyzerVolumeMountPath() string
- func GetCustomCostQueryWindowDays() int64
- func GetCustomCostQueryWindowHours() int64
- func GetCustomCostRefreshRateHours() string
- func GetDataRetentionDailyResolutionDays() int64
- func GetDataRetentionHourlyResolutionHours() int64
- func GetETLResolution() time.Duration
- func GetExportBucketConfigFile() string
- func GetExportCSVFile() string
- func GetExportCSVLabelsAll() bool
- func GetExportCSVLabelsList() []string
- func GetExportCSVMaxDays() int
- func GetInstallNamespace() string
- func GetKubeConfigPath() string
- func GetKubecostMetricsPort() int
- func GetMetricsConfigmapName() string
- func GetNetworkCostsPort() int
- func GetNodeStatsCertFile() string
- func GetNodeStatsKeyFile() string
- func GetNodeStatsLocalProxy() string
- func GetOCIPricingURL() string
- func GetParsedUTCOffset() time.Duration
- func GetPluginConfigDir() string
- func GetPluginExecutableDir() string
- func GetPodName() string
- func GetPricingConfigmapName() string
- func GetPromless() bool
- func GetRegionOverrideList() []string
- func GetReleaseName() string
- func GetRemotePW() string
- func GetSQLAddress() string
- func GetUTCOffset() string
- func GetUseCacheV1() bool
- func IsAllocationNodeLabelsEnabled() bool
- func IsAssetIncludeLocalDiskCost() bool
- func IsAzureDownloadBillingDataToDisk() bool
- func IsCarbonEstimatesEnabled() bool
- func IsCloudCostEnabled() bool
- func IsClusterCacheFileEnabled() bool
- func IsClusterInfoFileEnabled() bool
- func IsCustomCostEnabled() bool
- func IsETLEnabled() bool
- func IsETLReadOnlyMode() bool
- func IsEmitDeprecatedMetrics() bool
- func IsEmitKsmV1Metrics() bool
- func IsEmitKsmV1MetricsOnly() bool
- func IsEmitNamespaceAnnotationsMetric() bool
- func IsEmitPodAnnotationsMetric() bool
- func IsErrorReportingEnabled() bool
- func IsExportClusterCacheEnabled() bool
- func IsExportClusterInfoEnabled() bool
- func IsIngestingPodUID() bool
- func IsKubeRbacProxyEnabled() bool
- func IsKubecostMetricsPodEnabled() bool
- func IsKubernetesEnabled() bool
- func IsLogCollectionEnabled() bool
- func IsNodeStatsForceKubeProxy() bool
- func IsNodeStatsInsecure() bool
- func IsPProfEnabled() bool
- func IsProductAnalyticsEnabled() bool
- func IsRemoteEnabled() bool
- func IsUseCSVProvider() bool
- func IsUseCustomProvider() bool
- func IsValuesReportingEnabled() bool
Constants ¶
const ( APIPortEnvVar = "API_PORT" NetworkCostsPortEnvVar = "NETWORK_COSTS_PORT" AWSAccessKeyIDEnvVar = "AWS_ACCESS_KEY_ID" AWSAccessKeySecretEnvVar = "AWS_SECRET_ACCESS_KEY" AWSClusterIDEnvVar = "AWS_CLUSTER_ID" AWSPricingURL = "AWS_PRICING_URL" AlibabaAccessKeyIDEnvVar = "ALIBABA_ACCESS_KEY_ID" AlibabaAccessKeySecretEnvVar = "ALIBABA_SECRET_ACCESS_KEY" AzureOfferIDEnvVar = "AZURE_OFFER_ID" AzureBillingAccountEnvVar = "AZURE_BILLING_ACCOUNT" AzureDownloadBillingDataToDiskEnvVar = "AZURE_DOWNLOAD_BILLING_DATA_TO_DISK" ReleaseNameEnvVar = "RELEASE_NAME" PodNameEnvVar = "POD_NAME" ClusterIDEnvVar = "CLUSTER_ID" ClusterProfileEnvVar = "CLUSTER_PROFILE" RemoteEnabledEnvVar = "REMOTE_WRITE_ENABLED" RemotePWEnvVar = "REMOTE_WRITE_PASSWORD" SQLAddressEnvVar = "SQL_ADDRESS" UseCSVProviderEnvVar = "USE_CSV_PROVIDER" UseCustomProviderEnvVar = "USE_CUSTOM_PROVIDER" CSVRegionEnvVar = "CSV_REGION" CSVEndpointEnvVar = "CSV_ENDPOINT" CSVPathEnvVar = "CSV_PATH" ConfigPathEnvVar = "CONFIG_PATH" CloudProviderAPIKeyEnvVar = "CLOUD_PROVIDER_API_KEY" PromlessEnvVar = "PROMLESS" EmitPodAnnotationsMetricEnvVar = "EMIT_POD_ANNOTATIONS_METRIC" EmitNamespaceAnnotationsMetricEnvVar = "EMIT_NAMESPACE_ANNOTATIONS_METRIC" EmitDeprecatedMetrics = "EMIT_DEPRECATED_METRICS" EmitKsmV1MetricsEnvVar = "EMIT_KSM_V1_METRICS" EmitKsmV1MetricsOnly = "EMIT_KSM_V1_METRICS_ONLY" PProfEnabledEnvVar = "PPROF_ENABLED" LogCollectionEnabledEnvVar = "LOG_COLLECTION_ENABLED" ProductAnalyticsEnabledEnvVar = "PRODUCT_ANALYTICS_ENABLED" ErrorReportingEnabledEnvVar = "ERROR_REPORTING_ENABLED" ValuesReportingEnabledEnvVar = "VALUES_REPORTING_ENABLED" KubeRbacProxyEnabled = "KUBE_RBAC_PROXY_ENABLED" KubeConfigPathEnvVar = "KUBECONFIG_PATH" UTCOffsetEnvVar = "UTC_OFFSET" ETLEnabledEnvVar = "ETL_ENABLED" ETLResolutionSeconds = "ETL_RESOLUTION_SECONDS" PricingConfigmapName = "PRICING_CONFIGMAP_NAME" MetricsConfigmapName = "METRICS_CONFIGMAP_NAME" ClusterInfoFileEnabledEnvVar = "CLUSTER_INFO_FILE_ENABLED" ClusterCacheFileEnabledEnvVar = "CLUSTER_CACHE_FILE_ENABLED" IngestPodUIDEnvVar = "INGEST_POD_UID" ETLReadOnlyMode = "ETL_READ_ONLY" AllocationNodeLabelsEnabled = "ALLOCATION_NODE_LABELS_ENABLED" AssetIncludeLocalDiskCostEnvVar = "ASSET_INCLUDE_LOCAL_DISK_COST" ExportCSVFile = "EXPORT_CSV_FILE" ExportCSVLabelsList = "EXPORT_CSV_LABELS_LIST" ExportCSVLabelsAll = "EXPORT_CSV_LABELS_ALL" ExportCSVMaxDays = "EXPORT_CSV_MAX_DAYS" ExportBucketConfigFileEnvVar = "EXPORT_BUCKET_CONFIG_FILE" DataRetentionDailyResolutionDaysEnvVar = "DATA_RETENTION_DAILY_RESOLUTION_DAYS" DataRetentionHourlyResolutionHoursEnvVar = "DATA_RETENTION_HOURLY_RESOLUTION_HOURS" // We assume that Kubernetes is enabled if there is a KUBERNETES_PORT environment variable present KubernetesEnabledEnvVar = "KUBERNETES_PORT" CloudCostEnabledEnvVar = "CLOUD_COST_ENABLED" CloudCostConfigPath = "CLOUD_COST_CONFIG_PATH" CloudCostMonthToDateIntervalVar = "CLOUD_COST_MONTH_TO_DATE_INTERVAL" CloudCostRefreshRateHoursEnvVar = "CLOUD_COST_REFRESH_RATE_HOURS" CloudCostQueryWindowDaysEnvVar = "CLOUD_COST_QUERY_WINDOW_DAYS" CloudCostRunWindowDaysEnvVar = "CLOUD_COST_RUN_WINDOW_DAYS" CustomCostEnabledEnvVar = "CUSTOM_COST_ENABLED" CustomCostQueryWindowDaysEnvVar = "CUSTOM_COST_QUERY_WINDOW_DAYS" CustomCostRefreshRateHoursEnvVar = "CUSTOM_COST_REFRESH_RATE_HOURS" PluginConfigDirEnvVar = "PLUGIN_CONFIG_DIR" PluginExecutableDirEnvVar = "PLUGIN_EXECUTABLE_DIR" OCIPricingURL = "OCI_PRICING_URL" CarbonEstimatesEnabledEnvVar = "CARBON_ESTIMATES_ENABLED" UseCacheV1 = "USE_CACHE_V1" InstallNamespaceEnvVar = "INSTALL_NAMESPACE" ConfigBucketEnvVar = "CONFIG_BUCKET" // Node Stats Client Configuration NodeStatsForceKubeProxyEnvVar = "NODESTATS_FORCE_KUBE_PROXY" NodeStatsLocalProxyEnvVar = "NODESTATS_LOCAL_PROXY" NodeStatsInsecureEnvVar = "NODESTATS_INSECURE" NodeStatsCertFileEnvVar = "NODESTATS_CERT_FILE" NodeStatsKeyFileEnvVar = "NODESTATS_KEY_FILE" // Deprecated KubecostNamespaceEnvVar = "KUBECOST_NAMESPACE" KubecostConfigBucketEnvVar = "KUBECOST_CONFIG_BUCKET" )
const ( KubecostMetricsPodEnabledEnvVar = "KUBECOST_METRICS_POD_ENABLED" KubecostMetricsPodPortEnvVar = "KUBECOST_METRICS_PORT" ExportClusterCacheEnabledEnvVar = "EXPORT_CLUSTER_CACHE_ENABLED" ExportClusterInfoEnabledEnvVar = "EXPORT_CLUSTER_INFO_ENABLED" )
const DefaultConfigMountPath = "/var/configs"
Variables ¶
This section is empty.
Functions ¶
func GetAPIPort ¶ added in v1.108.0
func GetAPIPort() int
GetAPIPort returns the environment variable value for APIPortEnvVar which is the port number the API is available on.
func GetAWSAccessKeyID ¶
func GetAWSAccessKeyID() string
GetAWSAccessKeyID returns the environment variable value for AWSAccessKeyIDEnvVar which represents the AWS access key for authentication
func GetAWSAccessKeySecret ¶
func GetAWSAccessKeySecret() string
GetAWSAccessKeySecret returns the environment variable value for AWSAccessKeySecretEnvVar which represents the AWS access key secret for authentication
func GetAWSClusterID ¶
func GetAWSClusterID() string
GetAWSClusterID returns the environment variable value for AWSClusterIDEnvVar which represents an AWS specific cluster identifier.
func GetAWSPricingURL ¶ added in v1.99.0
func GetAWSPricingURL() string
GetAWSPricingURL returns an optional alternative URL to fetch AWS pricing data from; for use in airgapped environments
func GetAlibabaAccessKeyID ¶ added in v1.99.0
func GetAlibabaAccessKeyID() string
GetAlibabaAccessKeyID returns the environment variable value for AlibabaAccessKeyIDEnvVar which represents the Alibaba access key for authentication
func GetAlibabaAccessKeySecret ¶ added in v1.99.0
func GetAlibabaAccessKeySecret() string
GetAlibabaAccessKeySecret returns the environment variable value for AlibabaAccessKeySecretEnvVar which represents the Alibaba access key secret for authentication
func GetAzureBillingAccount ¶ added in v1.103.0
func GetAzureBillingAccount() string
GetAzureBillingAccount returns the environment variable value for AzureBillingAccountEnvVar which represents the Azure billing account for determining prices. If this is specified customer-specific prices will be downloaded from the consumption price sheet API.
func GetAzureOfferID ¶ added in v1.103.0
func GetAzureOfferID() string
GetAzureOfferID returns the environment variable value for AzureOfferIDEnvVar which represents the Azure offer ID for determining prices.
func GetCSVEndpoint ¶
func GetCSVEndpoint() string
GetCSVEndpoint returns the environment variable value for CSVEndpointEnvVar which represents the endpoint configured for a S3 CSV provider another than AWS S3.
func GetCSVPath ¶
func GetCSVPath() string
GetCSVPath returns the environment variable value for CSVPathEnvVar which represents the key path configured for a CSV provider.
func GetCSVRegion ¶
func GetCSVRegion() string
GetCSVRegion returns the environment variable value for CSVRegionEnvVar which represents the region configured for a CSV provider.
func GetCloudCostConfigPath ¶ added in v1.109.0
func GetCloudCostConfigPath() string
func GetCloudCostMonthToDateInterval ¶ added in v1.108.0
func GetCloudCostMonthToDateInterval() int
func GetCloudCostQueryWindowDays ¶ added in v1.108.0
func GetCloudCostQueryWindowDays() int64
func GetCloudCostRefreshRateHours ¶ added in v1.108.0
func GetCloudCostRefreshRateHours() int64
func GetCloudCostRunWindowDays ¶ added in v1.108.0
func GetCloudCostRunWindowDays() int64
func GetCloudProviderAPIKey ¶
func GetCloudProviderAPIKey() string
GetCloudProviderAPI returns the environment variable value for CloudProviderAPIEnvVar which represents the API key provided for the cloud provider.
func GetClusterID ¶
func GetClusterID() string
GetClusterID returns the environment variable value for ClusterIDEnvVar which represents the configurable identifier used for multi-cluster metric emission.
func GetClusterProfile ¶
func GetClusterProfile() string
GetClusterProfile returns the environment variable value for ClusterProfileEnvVar which represents the cluster profile configured for
func GetConfigBucketFile ¶ added in v1.115.0
func GetConfigBucketFile() string
GetConfigBucketFile returns a file location for a mounted bucket configuration which is used to store a subset of configurations that require sharing via remote storage.
func GetConfigPathWithDefault ¶
GetConfigPath returns the environment variable value for ConfigPathEnvVar which represents the cost model configuration path
func GetCostAnalyzerVolumeMountPath ¶ added in v1.102.0
func GetCostAnalyzerVolumeMountPath() string
GetCostAnalyzerVolumeMountPath is an alias of GetConfigPath, which returns the mount path for the Cost Analyzer volume, which stores configs, persistent data, etc.
func GetCustomCostQueryWindowDays ¶ added in v1.111.0
func GetCustomCostQueryWindowDays() int64
func GetCustomCostQueryWindowHours ¶ added in v1.111.0
func GetCustomCostQueryWindowHours() int64
func GetCustomCostRefreshRateHours ¶ added in v1.111.0
func GetCustomCostRefreshRateHours() string
func GetDataRetentionDailyResolutionDays ¶ added in v1.108.0
func GetDataRetentionDailyResolutionDays() int64
func GetDataRetentionHourlyResolutionHours ¶ added in v1.111.0
func GetDataRetentionHourlyResolutionHours() int64
func GetETLResolution ¶
GetETLResolution determines the resolution of ETL queries. The smaller the duration, the higher the resolution; the higher the resolution, the more accurate the query results, but the more computationally expensive.
func GetExportBucketConfigFile ¶ added in v1.115.0
func GetExportBucketConfigFile() string
func GetExportCSVFile ¶ added in v1.104.0
func GetExportCSVFile() string
func GetExportCSVLabelsAll ¶ added in v1.104.0
func GetExportCSVLabelsAll() bool
func GetExportCSVLabelsList ¶ added in v1.104.0
func GetExportCSVLabelsList() []string
func GetExportCSVMaxDays ¶ added in v1.107.0
func GetExportCSVMaxDays() int
func GetInstallNamespace ¶ added in v1.115.0
func GetInstallNamespace() string
GetInstallNamespace returns the environment variable value that is set for the kubernetes namespace this service is installed in.
func GetKubeConfigPath ¶
func GetKubeConfigPath() string
GetKubeConfigPath returns the environment variable value for KubeConfigPathEnvVar
func GetKubecostMetricsPort ¶
func GetKubecostMetricsPort() int
func GetMetricsConfigmapName ¶
func GetMetricsConfigmapName() string
func GetNetworkCostsPort ¶ added in v1.115.0
func GetNetworkCostsPort() int
func GetNodeStatsCertFile ¶ added in v1.115.0
func GetNodeStatsCertFile() string
GetNodeStatsCertFile returns the path of the cert file
func GetNodeStatsKeyFile ¶ added in v1.115.0
func GetNodeStatsKeyFile() string
GetNodeStatsKeyFile returns the path of the key file
func GetNodeStatsLocalProxy ¶ added in v1.115.0
func GetNodeStatsLocalProxy() string
GetNodeStatsLocalProxy returns the fully qualified local proxy endpoint for the node stats client IFF the proxyAPI is selected.
func GetOCIPricingURL ¶ added in v1.109.0
func GetOCIPricingURL() string
func GetParsedUTCOffset ¶
GetParsedUTCOffset returns the duration of the configured UTC offset
func GetPluginConfigDir ¶ added in v1.111.0
func GetPluginConfigDir() string
func GetPluginExecutableDir ¶ added in v1.111.0
func GetPluginExecutableDir() string
func GetPodName ¶
func GetPodName() string
GetPodName returns the name of the current running pod. If this environment variable is not set, empty string is returned.
func GetPricingConfigmapName ¶
func GetPricingConfigmapName() string
func GetPromless ¶ added in v1.115.0
func GetPromless() bool
GetPromless returns the environment variable which enables a source.OpencostDatasource which uses Prometheus
func GetRegionOverrideList ¶ added in v1.101.0
func GetRegionOverrideList() []string
func GetReleaseName ¶ added in v1.115.0
func GetReleaseName() string
func GetRemotePW ¶
func GetRemotePW() string
GetRemotePW returns the environment variable value for RemotePWEnvVar which represents the remote persistent storage password.
func GetSQLAddress ¶
func GetSQLAddress() string
GetSQLAddress returns the environment variable value for SQLAddressEnvVar which represents the SQL database address used with remote persistent storage.
func GetUTCOffset ¶
func GetUTCOffset() string
GetUTCOffset returns the environment variable value for UTCOffset
func GetUseCacheV1 ¶ added in v1.114.0
func GetUseCacheV1() bool
GetUseCacheV1 is a temporary flag to allow users to opt-in to using the old cache Mainly for comparison purposes
func IsAllocationNodeLabelsEnabled ¶ added in v1.115.0
func IsAllocationNodeLabelsEnabled() bool
func IsAssetIncludeLocalDiskCost ¶ added in v1.115.0
func IsAssetIncludeLocalDiskCost() bool
func IsAzureDownloadBillingDataToDisk ¶ added in v1.111.0
func IsAzureDownloadBillingDataToDisk() bool
IsAzureDownloadBillingDataToDisk returns the environment variable value for AzureDownloadBillingDataToDiskEnvVar which indicates whether the Azure Billing Data should be held in memory or written to disk.
func IsCarbonEstimatesEnabled ¶ added in v1.111.0
func IsCarbonEstimatesEnabled() bool
func IsCloudCostEnabled ¶ added in v1.108.0
func IsCloudCostEnabled() bool
func IsClusterCacheFileEnabled ¶
func IsClusterCacheFileEnabled() bool
IsClusterCacheFileEnabled returns true if the kubernetes cluster data is read from a file or pulled from the local kubernetes API.
func IsClusterInfoFileEnabled ¶
func IsClusterInfoFileEnabled() bool
IsClusterInfoFileEnabled returns true if the cluster info is read from a file or pulled from the local cloud provider and kubernetes.
func IsCustomCostEnabled ¶ added in v1.111.0
func IsCustomCostEnabled() bool
func IsETLEnabled ¶
func IsETLEnabled() bool
func IsETLReadOnlyMode ¶
func IsETLReadOnlyMode() bool
func IsEmitDeprecatedMetrics ¶ added in v1.109.0
func IsEmitDeprecatedMetrics() bool
func IsEmitKsmV1Metrics ¶
func IsEmitKsmV1Metrics() bool
IsEmitKsmV1Metrics returns true if cost-model is configured to emit all necessary KSM v1 metrics that were removed in KSM v2
func IsEmitKsmV1MetricsOnly ¶
func IsEmitKsmV1MetricsOnly() bool
func IsEmitNamespaceAnnotationsMetric ¶
func IsEmitNamespaceAnnotationsMetric() bool
IsEmitNamespaceAnnotationsMetric returns true if cost-model is configured to emit the kube_namespace_annotations metric containing the namespace annotations
func IsEmitPodAnnotationsMetric ¶
func IsEmitPodAnnotationsMetric() bool
IsEmitPodAnnotationsMetric returns true if cost-model is configured to emit the kube_pod_annotations metric containing pod annotations.
func IsErrorReportingEnabled ¶
func IsErrorReportingEnabled() bool
IsErrorReportingEnabled returns the environment variable value for ErrorReportingEnabledEnvVar
func IsExportClusterCacheEnabled ¶
func IsExportClusterCacheEnabled() bool
IsExportClusterCacheEnabled is set to true if the metrics pod should export the cluster cache data to a target file location
func IsExportClusterInfoEnabled ¶
func IsExportClusterInfoEnabled() bool
IsExportClusterInfoEnabled is set to true if the metrics pod should export its own cluster info data to a target file location
func IsIngestingPodUID ¶
func IsIngestingPodUID() bool
IsIngestingPodUID returns the env variable from ingestPodUID, which alters the contents of podKeys in Allocation
func IsKubeRbacProxyEnabled ¶ added in v1.113.0
func IsKubeRbacProxyEnabled() bool
func IsKubecostMetricsPodEnabled ¶
func IsKubecostMetricsPodEnabled() bool
IsKubecostMetricsPodEnabled returns true if the kubecost metrics pod is deployed
func IsKubernetesEnabled ¶ added in v1.109.0
func IsKubernetesEnabled() bool
func IsLogCollectionEnabled ¶
func IsLogCollectionEnabled() bool
IsLogCollectionEnabled returns the environment variable value for LogCollectionEnabledEnvVar which represents whether or not log collection has been enabled for kubecost deployments.
func IsNodeStatsForceKubeProxy ¶ added in v1.115.0
func IsNodeStatsForceKubeProxy() bool
IsNodeStatsForceKubeProxy returns true if the node stats client should force the kube proxy direct end point formatting
func IsNodeStatsInsecure ¶ added in v1.115.0
func IsNodeStatsInsecure() bool
IsNodeStatsInsecure returns true if the node stats client should skip TLS verification
func IsPProfEnabled ¶ added in v1.108.0
func IsPProfEnabled() bool
func IsProductAnalyticsEnabled ¶
func IsProductAnalyticsEnabled() bool
IsProductAnalyticsEnabled returns the environment variable value for ProductAnalyticsEnabledEnvVar
func IsRemoteEnabled ¶
func IsRemoteEnabled() bool
IsRemoteEnabled returns the environment variable value for RemoteEnabledEnvVar which represents whether or not remote write is enabled for prometheus for use with SQL backed persistent storage.
func IsUseCSVProvider ¶
func IsUseCSVProvider() bool
IsUseCSVProvider returns the environment variable value for UseCSVProviderEnvVar which represents whether or not the use of a CSV cost provider is enabled.
func IsUseCustomProvider ¶ added in v1.111.0
func IsUseCustomProvider() bool
IsUseCustomProvider returns the environment variable value for UseCustomProviderEnvVar which represents whether or not the use of a custom cost provider is enabled.
func IsValuesReportingEnabled ¶
func IsValuesReportingEnabled() bool
IsValuesReportingEnabled returns the environment variable value for ValuesReportingEnabledEnvVar
Types ¶
This section is empty.