Documentation ¶
Index ¶
- Constants
- func FilterOutNodesWithUnreadyGpus(GPULabel string, allNodes, readyNodes []*apiv1.Node) ([]*apiv1.Node, []*apiv1.Node)
- func GetGpuTypeForMetrics(GPULabel string, availableGPUTypes map[string]struct{}, node *apiv1.Node, ...) string
- func GetNodeTargetGpus(GPULabel string, node *apiv1.Node, nodeGroup cloudprovider.NodeGroup) (gpuType string, gpuCount int64, error errors.AutoscalerError)
- func NodeHasGpu(GPULabel string, node *apiv1.Node) bool
- func PodRequestsGpu(pod *apiv1.Pod) bool
Constants ¶
const ( // ResourceNvidiaGPU is the name of the Nvidia GPU resource. ResourceNvidiaGPU = "nvidia.com/gpu" // DefaultGPUType is the type of GPU used in NAP if the user // don't specify what type of GPU his pod wants. DefaultGPUType = "nvidia-tesla-k80" )
const ( // MetricsGenericGPU - for when there is no information about GPU type MetricsGenericGPU = "generic" // MetricsMissingGPU - for when there's a label, but GPU didn't appear MetricsMissingGPU = "missing-gpu" // MetricsUnexpectedLabelGPU - for when there's a label, but no GPU at all MetricsUnexpectedLabelGPU = "unexpected-label" // MetricsUnknownGPU - for when GPU type is unknown MetricsUnknownGPU = "not-listed" // MetricsErrorGPU - for when there was an error obtaining GPU type MetricsErrorGPU = "error" // MetricsNoGPU - for when there is no GPU and no label all MetricsNoGPU = "" )
Variables ¶
This section is empty.
Functions ¶
func FilterOutNodesWithUnreadyGpus ¶
func FilterOutNodesWithUnreadyGpus(GPULabel string, allNodes, readyNodes []*apiv1.Node) ([]*apiv1.Node, []*apiv1.Node)
FilterOutNodesWithUnreadyGpus removes nodes that should have GPU, but don't have it in allocatable from ready nodes list and updates their status to unready on all nodes list. This is a hack/workaround for nodes with GPU coming up without installed drivers, resulting in GPU missing from their allocatable and capacity.
func GetGpuTypeForMetrics ¶
func GetGpuTypeForMetrics(GPULabel string, availableGPUTypes map[string]struct{}, node *apiv1.Node, nodeGroup cloudprovider.NodeGroup) string
GetGpuTypeForMetrics returns name of the GPU used on the node or empty string if there's no GPU if the GPU type is unknown, "generic" is returned NOTE: current implementation is GKE/GCE-specific
func GetNodeTargetGpus ¶
func GetNodeTargetGpus(GPULabel string, node *apiv1.Node, nodeGroup cloudprovider.NodeGroup) (gpuType string, gpuCount int64, error errors.AutoscalerError)
GetNodeTargetGpus returns the number of gpus on a given node. This includes gpus which are not yet ready to use and visible in kubernetes.
func NodeHasGpu ¶
NodeHasGpu returns true if a given node has GPU hardware. The result will be true if there is hardware capability. It doesn't matter if the drivers are installed and GPU is ready to use.
func PodRequestsGpu ¶
PodRequestsGpu returns true if a given pod has GPU request.
Types ¶
This section is empty.