pod

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2021 License: Apache-2.0 Imports: 8 Imported by: 3

Documentation

Index

Constants

View Source
const (
	AnnotationKeyInstanceType = "node.titus.netflix.com/itype"
	AnnotationKeyRegion       = "node.titus.netflix.com/region"
	AnnotationKeyStack        = "node.titus.netflix.com/stack"

	// Pod Networking
	AnnotationKeyEgressBandwidth  = "kubernetes.io/egress-bandwidth"
	AnnotationKeyIngressBandwidth = "kubernetes.io/ingress-bandwidth"
	AnnotationKeySecurityGroups   = "network.titus.netflix.com/securityGroups"
	AnnotationKeySubnets          = "network.titus.netflix.com/subnets"
	AnnotationKeyAccountID        = "network.titus.netflix.com/accountId"

	// Pod ENI
	AnnotationKeyIPv4Address      = "network.netflix.com/address-ipv4"
	AnnotationKeyIPv4PrefixLength = "network.netflix.com/prefixlen-ipv4"
	AnnotationKeyIPv6Address      = "network.netflix.com/address-ipv6"
	AnnotationKeyIPv6PrefixLength = "network.netflix.com/prefixlen-ipv6"

	AnnotationKeyBranchEniID     = "network.netflix.com/branch-eni-id"
	AnnotationKeyBranchEniMac    = "network.netflix.com/branch-eni-mac"
	AnnotationKeyBranchEniVpcID  = "network.netflix.com/branch-eni-vpc"
	AnnotationKeyBranchEniSubnet = "network.netflix.com/branch-eni-subnet"

	AnnotationKeyTrunkEniID    = "network.netflix.com/trunk-eni-id"
	AnnotationKeyTrunkEniMac   = "network.netflix.com/trunk-eni-mac"
	AnnotationKeyTrunkEniVpcID = "network.netflix.com/trunk-eni-vpc"

	AnnotationKeyVlanID        = "network.netflix.com/vlan-id"
	AnnotationKeyAllocationIdx = "network.netflix.com/allocation-idx"

	// matches kube2iam
	AnnotationKeyIAMRole              = "iam.amazonaws.com/role"
	AnnotationKeySecurityGroupsLegacy = "network.titus.netflix.com/securityGroups"

	// AnnotationKeyPodSchemaVersion is an integer specifying what schema version a pod was created with
	AnnotationKeyPodSchemaVersion = "pod.netflix.com/pod-schema-version"

	AnnotationKeyAppDetail     = "app.netflix.com/detail"
	AnnotationKeyAppName       = "app.netflix.com/name"
	AnnotationKeyAppOwnerEmail = "app.netflix.com/owner-email"
	AnnotationKeyAppSequence   = "app.netflix.com/sequence"
	AnnotationKeyAppStack      = "app.netflix.com/stack"

	AnnotationKeyJobAcceptedTimestampMs = "v3.job.titus.netflix.com/accepted-timestamp-ms"
	AnnotationKeyJobID                  = "v3.job.titus.netflix.com/id"
	AnnotationKeyJobType                = "v3.job.titus.netflix.com/type"
	AnnotationKeyJobDescriptor          = "v3.job.titus.netflix.com/descriptor"
	// AnnotationKeyPodTitusContainerInfo - to be removed once VK supports the full pod spec
	AnnotationKeyPodTitusContainerInfo = "pod.titus.netflix.com/container-info"

	AnnotationKeyNetworkAccountID          = "network.netflix.com/account-id"
	AnnotationKeyNetworkBurstingEnabled    = "network.netflix.com/network-bursting-enabled"
	AnnotationKeyNetworkAssignIPv6Address  = "network.netflix.com/assign-ipv6-address"
	AnnotationKeyNetworkElasticIPPool      = "network.netflix.com/elastic-ip-pool"
	AnnotationKeyNetworkElasticIPs         = "network.netflix.com/elastic-ips"
	AnnotationKeyNetworkIMDSRequireToken   = "network.netflix.com/imds-require-token"
	AnnotationKeyNetworkJumboFramesEnabled = "network.netflix.com/jumbo-frames-enabled"
	AnnotationKeyNetworkSecurityGroups     = "network.netflix.com/security-groups"
	AnnotationKeyNetworkSubnetIDs          = "network.netflix.com/subnet-ids"
	AnnotationKeyNetworkStaticIPAllocation = "network.netflix.com/static-ip-allocation"

	AnnotationKeySecurityAppMetadata    = "security.netflix.com/app-metadata"
	AnnotationKeySecurityAppMetadataSig = "security.netflix.com/app-metadata-sig"

	// AnnotationKeyOpportunisticCPU - assigned opportunistic CPUs
	AnnotationKeyOpportunisticCPU = "opportunistic.scheduler.titus.netflix.com/cpu"
	// AnnotationKeyOpportunisticResourceID - name of the opportunistic resource CRD used during scheduling
	AnnotationKeyOpportunisticResourceID = "opportunistic.scheduler.titus.netflix.com/id"

	// AnnotationKeyPredictionRuntime - predicted runtime (Go’s time.Duration format)
	AnnotationKeyPredictionRuntime = "predictions.scheduler.titus.netflix.com/runtime"
	// AnnotationKeyPredictionConfidence - confidence (percentile) of the prediction picked above
	AnnotationKeyPredictionConfidence = "predictions.scheduler.titus.netflix.com/confidence"
	// AnnotationKeyPredictionModelID - model uuid used for the runtime prediction picked above
	AnnotationKeyPredictionModelID = "predictions.scheduler.titus.netflix.com/model-id"
	// AnnotationKeyPredictionModelVersion - version of the model used for the prediction above
	AnnotationKeyPredictionModelVersion = "predictions.scheduler.titus.netflix.com/version"

	// AnnotationKeyPredictionABTestCell - cell allocation for prediction AB tests
	AnnotationKeyPredictionABTestCell = "predictions.scheduler.titus.netflix.com/ab-test"
	// AnnotationKeyPredictionPredictionAvailable - array of predictions available during job admission
	AnnotationKeyPredictionPredictionAvailable = "predictions.scheduler.titus.netflix.com/available"
	// AnnotationKeyPredictionSelectorInfo - metadata from the prediction selection algorithm
	AnnotationKeyPredictionSelectorInfo = "predictions.scheduler.titus.netflix.com/selector-info"

	AnnotationKeyPodCPUBurstingEnabled = "pod.netflix.com/cpu-bursting-enabled"
	AnnotationKeyPodKvmEnabled         = "pod.netflix.com/kvm-enabled"
	AnnotationKeyPodFuseEnabled        = "pod.netflix.com/fuse-enabled"
	AnnotationKeyPodHostnameStyle      = "pod.netflix.com/hostname-style"
	AnnotationKeyPodOomScoreAdj        = "pod.netflix.com/oom-score-adj"
	AnnotationKeyPodSchedPolicy        = "pod.netflix.com/sched-policy"

	AnnotationKeyLogKeepLocalFile       = "log.netflix.com/keep-local-file-after-upload"
	AnnotationKeyLogS3BucketName        = "log.netflix.com/s3-bucket-name"
	AnnotationKeyLogS3PathPrefix        = "log.netflix.com/s3-path-prefix"
	AnnotationKeyLogS3WriterIAMRole     = "log.netflix.com/s3-writer-iam-role"
	AnnotationKeyLogStdioCheckInterval  = "log.netflix.com/stdio-check-interval"
	AnnotationKeyLogUploadThresholdTime = "log.netflix.com/upload-threshold-time"
	AnnotationKeyLogUploadCheckInterval = "log.netflix.com/upload-check-interval"

	AnnotationKeyServiceServiceMeshEnabled = "service.netflix.com/service-mesh/enabled"
	AnnotationKeyServiceServiceMeshImage   = "service.netflix.com/service-mesh/image"
)
View Source
const (
	// High-level "domains" used for labels and annotations
	DomainNetflix = "netflix.com"
	DomainTitus   = "titus.netflix.com"
	DomainPod     = "pod.netflix.com"

	// Job details
	LabelKeyAppLegacy      = "netflix.com/applicationName"
	LabelKeyDetailLegacy   = "netflix.com/detail"
	LabelKeySequenceLegacy = "netflix.com/sequence"
	LabelKeyStackLegacy    = "netflix.com/stack"

	LabelKeyByteUnitsEnabled    = "pod.titus.netflix.com/byteUnits"
	LabelKeyCapacityGroupLegacy = "titus.netflix.com/capacityGroup"

	// v1 pod labels
	LabelKeyJobId         = "v3.job.titus.netflix.com/job-id"
	LabelKeyTaskId        = "v3.job.titus.netflix.com/task-id"
	LabelKeyAppName       = "app.netflix.com/name"
	LabelKeyAppStack      = "app.netflix.com/stack"
	LabelKeyAppDetail     = "app.netflix.com/detail"
	LabelKeyAppSequence   = "app.netflix.com/sequence"
	LabelKeyCapacityGroup = "titus.netflix.com/capacity-group"
)

Variables

This section is empty.

Functions

func ByteUnitsEnabled

func ByteUnitsEnabled(pod *corev1.Pod) (bool, error)

Is the control plane indicating that it's sending the resources in bytes?

func PodSchemaVersion added in v0.9.0

func PodSchemaVersion(pod *corev1.Pod) (uint32, error)

PodSchemaVersion returns the pod schema version used to create a pod. If unset, returns 0

Types

type Config added in v0.9.0

type Config struct {
	AssignIPv6Address      *bool
	AccountID              *string
	AppDetail              *string
	AppName                *string
	AppMetadata            *string
	AppMetadataSig         *string
	AppOwnerEmail          *string
	AppSequence            *string
	AppStack               *string
	BytesEnabled           *bool
	CapacityGroup          *string
	CPUBurstingEnabled     *bool
	ContainerInfo          *string
	EgressBandwidth        *resource.Quantity
	ElasticIPPool          *string
	ElasticIPs             *string
	FuseEnabled            *bool
	HostnameStyle          *string
	IAMRole                *string
	IngressBandwidth       *resource.Quantity
	IMDSRequireToken       *string
	JobAcceptedTimestampMs *uint64
	JobDescriptor          *string
	JobID                  *string
	JobType                *string
	JumboFramesEnabled     *bool
	KvmEnabled             *bool
	LogKeepLocalFile       *bool
	LogUploadCheckInterval *time.Duration
	LogUploadThresholdTime *time.Duration
	LogStdioCheckInterval  *time.Duration
	LogS3WriterIAMRole     *string
	LogS3BucketName        *string
	LogS3PathPrefix        *string
	NetworkBurstingEnabled *bool
	OomScoreAdj            *int32
	PodSchemaVersion       *uint32
	ResourceCPU            *resource.Quantity
	ResourceDisk           *resource.Quantity
	ResourceGPU            *resource.Quantity
	ResourceMemory         *resource.Quantity
	ResourceNetwork        *resource.Quantity
	SchedPolicy            *string
	SecurityGroups         *string
	ServiceMeshEnabled     *bool
	ServiceMeshImage       *string
	StaticIPAllocation     *string
	SubnetIDs              *string
	TaskID                 *string
	TTYEnabled             *bool
}

Config contains configuration parameters parsed out from various places in the pod (such as annotations). All fields are pointers, to differentiate between a field being unset and the empty value.

func PodToConfig added in v0.9.0

func PodToConfig(pod *corev1.Pod) (*Config, error)

PodToConfig pulls out values from a pod and turns them into a Config

Jump to

Keyboard shortcuts

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