Documentation ¶
Index ¶
- func Add(left *si.Resource, right *si.Resource) *si.Resource
- func CreateAllocationRequestForTask(appID, taskID string, resource *si.Resource, placeholder bool, ...) si.AllocationRequest
- func CreateReleaseAllocationRequestForTask(appID, allocUUID, partition, terminationType string) si.AllocationRequest
- func CreateReleaseAskRequestForTask(appID, taskID, partition string) si.AllocationRequest
- func CreateTagsForTask(pod *v1.Pod) map[string]string
- func CreateUpdateRequestForDeleteNode(node Node) si.NodeRequest
- func CreateUpdateRequestForNewNode(node Node) si.NodeRequest
- func CreateUpdateRequestForRemoveApplication(appID, partition string) si.ApplicationRequest
- func CreateUpdateRequestForUpdatedNode(node Node) si.NodeRequest
- func Equals(left *si.Resource, right *si.Resource) bool
- func GetNodeResource(nodeStatus *v1.NodeStatus) *si.Resource
- func GetPodResource(pod *v1.Pod) (resource *si.Resource)
- func GetTGResource(resMap map[string]resource.Quantity, members int64) *si.Resource
- func GetTerminationTypeFromString(terminationTypeStr string) si.TerminationType
- func IsZero(r *si.Resource) bool
- func ParseResource(cpuStr, memStr string) *si.Resource
- func Sub(left *si.Resource, right *si.Resource) *si.Resource
- type Node
- type ResourceBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateAllocationRequestForTask ¶ added in v0.12.0
func CreateReleaseAllocationRequestForTask ¶
func CreateReleaseAllocationRequestForTask(appID, allocUUID, partition, terminationType string) si.AllocationRequest
func CreateReleaseAskRequestForTask ¶
func CreateReleaseAskRequestForTask(appID, taskID, partition string) si.AllocationRequest
func CreateUpdateRequestForDeleteNode ¶
func CreateUpdateRequestForDeleteNode(node Node) si.NodeRequest
func CreateUpdateRequestForNewNode ¶
func CreateUpdateRequestForNewNode(node Node) si.NodeRequest
func CreateUpdateRequestForRemoveApplication ¶ added in v0.10.0
func CreateUpdateRequestForRemoveApplication(appID, partition string) si.ApplicationRequest
func CreateUpdateRequestForUpdatedNode ¶
func CreateUpdateRequestForUpdatedNode(node Node) si.NodeRequest
func GetNodeResource ¶
func GetNodeResource(nodeStatus *v1.NodeStatus) *si.Resource
func GetPodResource ¶
Get the resources from a pod's containers and convert that into a internal resource. A pod has two resource parts: Requests and Limits. Based on the values a pod gets a QOS assigned, as per https://kubernetes.io/docs/tasks/configure-pod-container/quality-service-pod/ QOS class Guaranteed and Burstable are supported. However Burstable is scheduled based on the request values, limits are ignored in the current setup. BestEffort pods are scheduled using a minimum resource of 1MB only.
func GetTGResource ¶ added in v0.10.0
func GetTerminationTypeFromString ¶ added in v0.10.0
func GetTerminationTypeFromString(terminationTypeStr string) si.TerminationType
func ParseResource ¶ added in v0.9.0
parse cpu and memory from string to si.Resource, both of them are optional if parse failed with some errors, log the error and return a nil
Types ¶
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
stores info about what scheduler cares about a node
func CreateFrom ¶
func CreateFromNodeSpec ¶
type ResourceBuilder ¶
type ResourceBuilder struct {
// contains filtered or unexported fields
}
resource builder is a helper struct to construct si resources
func NewResourceBuilder ¶
func NewResourceBuilder() *ResourceBuilder
func (*ResourceBuilder) AddResource ¶
func (w *ResourceBuilder) AddResource(name string, value int64) *ResourceBuilder
func (*ResourceBuilder) Build ¶
func (w *ResourceBuilder) Build() *si.Resource