Documentation
¶
Index ¶
- Constants
- func Get(key string, defaultValue string) string
- func GetAPIPortWithDefault(def int) int
- func GetAppName() string
- func GetBool(key string, defaultValue bool) bool
- func GetClusterID() string
- func GetConfigPath() string
- func GetDefaultStorageConfigFilePath() string
- func GetDuration(key string, defaultValue time.Duration) time.Duration
- func GetFloat32(key string, defaultValue float32) float32
- func GetFloat64(key string, defaultValue float64) float64
- func GetInstallNamespace(def string) string
- func GetInt(key string, defaultValue int) int
- func GetInt8(key string, defaultValue int8) int8
- func GetInt16(key string, defaultValue int16) int16
- func GetInt32(key string, defaultValue int32) int32
- func GetInt64(key string, defaultValue int64) int64
- func GetList(key, delimiter string) []string
- func GetPathFromConfig(subPaths ...string) string
- func GetPrefixInt(prefix, key string, defaultValue int) int
- func GetUInt(key string, defaultValue uint) uint
- func GetUInt8(key string, defaultValue uint8) uint8
- func GetUInt16(key string, defaultValue uint16) uint16
- func GetUInt32(key string, defaultValue uint32) uint32
- func GetUInt64(key string, defaultValue uint64) uint64
- func IsEmitCronJobAnnotationsMetric() bool
- func IsEmitCronJobLabelsMetric() bool
- func IsEmitDaemonSetAnnotationsMetric() bool
- func IsEmitDaemonSetLabelsMetric() bool
- func IsEmitDeploymentAnnotationsMetric() bool
- func IsEmitDeploymentLabelsMetric() bool
- func IsEmitDeprecatedMetrics() bool
- func IsEmitJobAnnotationsMetric() bool
- func IsEmitJobLabelsMetric() bool
- func IsEmitKsmV1Metrics() bool
- func IsEmitKsmV1MetricsOnly() bool
- func IsEmitNamespaceAnnotationsMetric() bool
- func IsEmitPodAnnotationsMetric() bool
- func IsEmitReplicaSetAnnotationsMetric() bool
- func IsEmitReplicaSetLabelsMetric() bool
- func IsEmitStatefulSetAnnotationsMetric() bool
- func IsEmitStatefulSetLabelsMetric() bool
- func IsKubeModelExported() bool
- func IsKubeModelV1Forced() bool
- func IsLegacyDataModelExported() bool
- func IsPProfEnabled() bool
- func Set(key string, value string) error
- func SetBool(key string, value bool) error
- func SetDuration(key string, value time.Duration) error
- func SetInt(key string, value int) error
- func SetInt8(key string, value int8) error
- func SetInt16(key string, value int16) error
- func SetInt32(key string, value int32) error
- func SetInt64(key string, value int64) error
- func SetUInt(key string, value uint) error
- func SetUInt8(key string, value uint8) error
- func SetUInt16(key string, value uint16) error
- func SetUInt32(key string, value uint32) error
- func SetUInt64(key string, value uint64) error
Constants ¶
const ( APIPortEnvVar = "API_PORT" ClusterIDEnvVar = "CLUSTER_ID" AppNameEnvVar = "APP_NAME" ConfigPathEnvVar = "CONFIG_PATH" PProfEnabledEnvVar = "PPROF_ENABLED" InstallNamespaceEnvVar = "INSTALL_NAMESPACE" Resolution1dRetentionEnvVar = "RESOLUTION_1D_RETENTION" // int: number of days Resolution1hRetentionEnvVar = "RESOLUTION_1H_RETENTION" // int: number of hours Resolution10mRetentionEnvVar = "RESOLUTION_10M_RETENTION" // int: number of 10m segments ExportLegacyDataModelEnvVar = "EXPORT_LEGACY_DATA_MODEL" ExportKubeModelEnvVar = "EXPORT_KUBEMODEL" ForceKubeModelV1EnvVar = "FORCE_KUBEMODEL_V1" )
const ( 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" EmitDeploymentLabelsMetricEnvVar = "EMIT_DEPLOYMENT_LABELS_METRIC" EmitDeploymentAnnotationsMetricEnvVar = "EMIT_DEPLOYMENT_ANNOTATIONS_METRIC" EmitStatefulSetLabelsMetricEnvVar = "EMIT_STATEFULSET_LABELS_METRIC" EmitStatefulSetAnnotationsMetricEnvVar = "EMIT_STATEFULSET_ANNOTATIONS_METRIC" EmitDaemonSetLabelsMetricEnvVar = "EMIT_DAEMONSET_LABELS_METRIC" EmitDaemonSetAnnotationsMetricEnvVar = "EMIT_DAEMONSET_ANNOTATIONS_METRIC" EmitJobLabelsMetricEnvVar = "EMIT_JOB_LABELS_METRIC" EmitJobAnnotationsMetricEnvVar = "EMIT_JOB_ANNOTATIONS_METRIC" EmitCronJobLabelsMetricEnvVar = "EMIT_CRONJOB_LABELS_METRIC" EmitCronJobAnnotationsMetricEnvVar = "EMIT_CRONJOB_ANNOTATIONS_METRIC" EmitReplicaSetLabelsMetricEnvVar = "EMIT_REPLICASET_LABELS_METRIC" EmitReplicaSetAnnotationsMetricEnvVar = "EMIT_REPLICASET_ANNOTATIONS_METRIC" )
const DefaultConfigPath = "/var/configs"
const DefaultStorageFile = "federated-store.yaml"
Variables ¶
This section is empty.
Functions ¶
func Get ¶
Get parses an string from the environment variable key parameter. If the environment variable is empty, the defaultValue parameter is returned.
func GetAPIPortWithDefault ¶
GetAPIPort returns the environment variable value for APIPortEnvVar which is the port number the API is available on.
func GetAppName ¶ added in v1.117.2
func GetAppName() string
GetAppName returns the name of the application name running the values
func GetBool ¶
GetBool parses a bool from the environment variable key parameter. If the environment variable is empty or fails to parse, the defaultValue parameter is returned.
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 GetConfigPath ¶
func GetConfigPath() string
GetConfigPath returns the environment variable value for ConfigPathEnvVar which represents the cost model configuration path
func GetDefaultStorageConfigFilePath ¶
func GetDefaultStorageConfigFilePath() string
func GetDuration ¶
GetDuration parses a time.Duration from the environment variable key parameter. If the environment variable is empty or fails to parse, the defaultValue parameter is returned.
func GetFloat32 ¶
GetFloat32 parses a float32 from the environment variable key parameter. If the environment variable is empty or fails to parse, the defaultValue parameter is returned.
func GetFloat64 ¶
GetFloat64 parses a float64 from the environment variable key parameter. If the environment variable is empty or fails to parse, the defaultValue parameter is returned.
func GetInstallNamespace ¶
func GetInt ¶
GetInt parses an int from the environment variable key parameter. If the environment variable is empty or fails to parse, the defaultValue parameter is returned.
func GetInt8 ¶
GetInt8 parses an int8 from the environment variable key parameter. If the environment variable is empty or fails to parse, the defaultValue parameter is returned.
func GetInt16 ¶
GetInt16 parses an int16 from the environment variable key parameter. If the environment variable is empty or fails to parse, the defaultValue parameter is returned.
func GetInt32 ¶
GetInt32 parses an int32 from the environment variable key parameter. If the environment variable is empty or fails to parse, the defaultValue parameter is returned.
func GetInt64 ¶
GetInt64 parses an int64 from the environment variable key parameter. If the environment variable is empty or fails to parse, the defaultValue parameter is returned.
func GetList ¶
GetList parses a []string from the environment variable key parameter. If the environment // variable is empty or fails to parse, nil is returned.
func GetPathFromConfig ¶
func GetPrefixInt ¶ added in v1.117.2
GetPrefixInt parses an int from the environment variable key parameter. It first checks the env var with the prefix then checks the env var without the prefix If the environment variable is empty or fails to parse, the defaultValue parameter is returned.
func GetUInt ¶
GetUInt parses a uint from the environment variable key parameter. If the environment variable is empty or fails to parse, the defaultValue parameter is returned.
func GetUInt8 ¶
GetUInt8 parses a uint8 from the environment variable key parameter. If the environment variable is empty or fails to parse, the defaultValue parameter is returned.
func GetUInt16 ¶
GetUInt16 parses a uint16 from the environment variable key parameter. If the environment variable is empty or fails to parse, the defaultValue parameter is returned.
func GetUInt32 ¶
GetUInt32 parses a uint32 from the environment variable key parameter. If the environment variable is empty or fails to parse, the defaultValue parameter is returned.
func GetUInt64 ¶
GetUInt64 parses a uint64 from the environment variable key parameter. If the environment variable is empty or fails to parse, the defaultValue parameter is returned.
func IsEmitCronJobAnnotationsMetric ¶ added in v1.121.0
func IsEmitCronJobAnnotationsMetric() bool
func IsEmitCronJobLabelsMetric ¶ added in v1.121.0
func IsEmitCronJobLabelsMetric() bool
func IsEmitDaemonSetAnnotationsMetric ¶ added in v1.121.0
func IsEmitDaemonSetAnnotationsMetric() bool
func IsEmitDaemonSetLabelsMetric ¶ added in v1.121.0
func IsEmitDaemonSetLabelsMetric() bool
func IsEmitDeploymentAnnotationsMetric ¶ added in v1.121.0
func IsEmitDeploymentAnnotationsMetric() bool
func IsEmitDeploymentLabelsMetric ¶ added in v1.121.0
func IsEmitDeploymentLabelsMetric() bool
func IsEmitDeprecatedMetrics ¶ added in v1.121.0
func IsEmitDeprecatedMetrics() bool
func IsEmitJobAnnotationsMetric ¶ added in v1.121.0
func IsEmitJobAnnotationsMetric() bool
func IsEmitJobLabelsMetric ¶ added in v1.121.0
func IsEmitJobLabelsMetric() bool
func IsEmitKsmV1Metrics ¶ added in v1.121.0
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 ¶ added in v1.121.0
func IsEmitKsmV1MetricsOnly() bool
func IsEmitNamespaceAnnotationsMetric ¶ added in v1.121.0
func IsEmitNamespaceAnnotationsMetric() bool
IsEmitNamespaceAnnotationsMetric returns true if cost-model is configured to emit the kube_namespace_annotations metric containing the namespace annotations
func IsEmitPodAnnotationsMetric ¶ added in v1.121.0
func IsEmitPodAnnotationsMetric() bool
IsEmitPodAnnotationsMetric returns true if cost-model is configured to emit the kube_pod_annotations metric containing pod annotations.
func IsEmitReplicaSetAnnotationsMetric ¶ added in v1.121.0
func IsEmitReplicaSetAnnotationsMetric() bool
func IsEmitReplicaSetLabelsMetric ¶ added in v1.121.0
func IsEmitReplicaSetLabelsMetric() bool
func IsEmitStatefulSetAnnotationsMetric ¶ added in v1.121.0
func IsEmitStatefulSetAnnotationsMetric() bool
func IsEmitStatefulSetLabelsMetric ¶ added in v1.121.0
func IsEmitStatefulSetLabelsMetric() bool
func IsKubeModelExported ¶ added in v1.121.0
func IsKubeModelExported() bool
func IsKubeModelV1Forced ¶ added in v1.121.0
func IsKubeModelV1Forced() bool
IsKubeModelV1Forced returns true if the kubemodel pipeline should always export the legacy v1 (cluster, namespaces, resource quotas only) shape, regardless of whether the source reports a complete kubemodel.
func IsLegacyDataModelExported ¶ added in v1.121.0
func IsLegacyDataModelExported() bool
func IsPProfEnabled ¶
func IsPProfEnabled() bool
func SetDuration ¶
SetDuration sets the environment variable to a string formatted time.Duration
Types ¶
This section is empty.