env

package
v1.121.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2026 License: Apache-2.0 Imports: 4 Imported by: 4

Documentation

Index

Constants

View Source
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"
)
View Source
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"
)
View Source
const DefaultConfigPath = "/var/configs"
View Source
const DefaultStorageFile = "federated-store.yaml"

Variables

This section is empty.

Functions

func Get

func Get(key string, defaultValue string) string

Get parses an string from the environment variable key parameter. If the environment variable is empty, the defaultValue parameter is returned.

func GetAPIPortWithDefault

func GetAPIPortWithDefault(def int) int

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

func GetBool(key string, defaultValue bool) bool

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

func GetDuration(key string, defaultValue time.Duration) time.Duration

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

func GetFloat32(key string, defaultValue float32) float32

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

func GetFloat64(key string, defaultValue float64) float64

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 GetInstallNamespace(def string) string

func GetInt

func GetInt(key string, defaultValue int) int

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

func GetInt8(key string, defaultValue int8) int8

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

func GetInt16(key string, defaultValue int16) int16

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

func GetInt32(key string, defaultValue int32) int32

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

func GetInt64(key string, defaultValue int64) int64

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

func GetList(key, delimiter string) []string

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 GetPathFromConfig(subPaths ...string) string

func GetPrefixInt added in v1.117.2

func GetPrefixInt(prefix, key string, defaultValue int) int

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

func GetUInt(key string, defaultValue uint) uint

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

func GetUInt8(key string, defaultValue uint8) uint8

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

func GetUInt16(key string, defaultValue uint16) uint16

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

func GetUInt32(key string, defaultValue uint32) uint32

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

func GetUInt64(key string, defaultValue uint64) uint64

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 Set

func Set(key string, value string) error

Set sets the environment variable for the key provided using the value provided.

func SetBool

func SetBool(key string, value bool) error

SetBool sets the environment variable to a string formatted bool value.

func SetDuration

func SetDuration(key string, value time.Duration) error

SetDuration sets the environment variable to a string formatted time.Duration

func SetInt

func SetInt(key string, value int) error

SetInt sets the environment variable to a string formatted int value

func SetInt8

func SetInt8(key string, value int8) error

SetInt8 sets the environment variable to a string formatted int8 value.

func SetInt16

func SetInt16(key string, value int16) error

SetInt16 sets the environment variable to a string formatted int16 value.

func SetInt32

func SetInt32(key string, value int32) error

SetInt32 sets the environment variable to a string formatted int32 value.

func SetInt64

func SetInt64(key string, value int64) error

SetInt64 sets the environment variable to a string formatted int64 value.

func SetUInt

func SetUInt(key string, value uint) error

SetUInt sets the environment variable to a string formatted uint value

func SetUInt8

func SetUInt8(key string, value uint8) error

SetUInt8 sets the environment variable to a string formatted uint8 value

func SetUInt16

func SetUInt16(key string, value uint16) error

SetUInt16 sets the environment variable to a string formatted uint16 value

func SetUInt32

func SetUInt32(key string, value uint32) error

SetUInt32 sets the environment variable to a string formatted uint32 value

func SetUInt64

func SetUInt64(key string, value uint64) error

SetUInt64 sets the environment variable to a string formatted uint64 value

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL