aboutsummaryrefslogtreecommitdiffstats
path: root/library/go/yandex/deploy/podagent/env.go
blob: 4dd4ae1790cdd19c3f02f1740ce599efb968d864 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package podagent

import "os"

// Box/Workload environment variable names, documentation references:
//   - https://deploy.yandex-team.ru/docs/concepts/pod/box#systemenv
//   - https://deploy.yandex-team.ru/docs/concepts/pod/workload/workload#system_env
const (
	EnvWorkloadIDKey  = "DEPLOY_WORKLOAD_ID"
	EnvContainerIDKey = "DEPLOY_CONTAINER_ID"
	EnvBoxIDKey       = "DEPLOY_BOX_ID"
	EnvPodIDKey       = "DEPLOY_POD_ID"
	EnvProjectIDKey   = "DEPLOY_PROJECT_ID"
	EnvStageIDKey     = "DEPLOY_STAGE_ID"
	EnvUnitIDKey      = "DEPLOY_UNIT_ID"

	EnvLogsEndpointKey = "DEPLOY_LOGS_ENDPOINT"
	EnvLogsNameKey     = "DEPLOY_LOGS_DEFAULT_NAME"
	EnvLogsSecretKey   = "DEPLOY_LOGS_SECRET"

	EnvNodeClusterKey = "DEPLOY_NODE_CLUSTER"
	EnvNodeDCKey      = "DEPLOY_NODE_DC"
	EnvNodeFQDNKey    = "DEPLOY_NODE_FQDN"

	EnvPodPersistentFQDN = "DEPLOY_POD_PERSISTENT_FQDN"
	EnvPodTransientFQDN  = "DEPLOY_POD_TRANSIENT_FQDN"
)

// UnderPodAgent returns true if application managed by pod-agent.
func UnderPodAgent() bool {
	_, ok := os.LookupEnv(EnvPodIDKey)
	return ok
}