Documentation ¶
Index ¶
- Constants
- func AddWorkloadInfoToPod(pod *corev1.Pod, kind string, name string, namespace string) *corev1.Pod
- func AdjustNodesOrder(nodes []string) []string
- func AdjustWorkloads(workloads map[string][]string)
- func CreateKubeClient(kubeconfig string) (*clientset.Clientset, error)
- func DecodeYamlContent(yamlRes []byte) ([]runtime.Object, error)
- func GetGpuNodeInfoFromAnnotation(node *corev1.Node) (*gpusharecache.NodeGpuInfo, error)
- func GetMasterFromKubeConfig(filename string) (string, error)
- func GetNodeAllocatable(node *corev1.Node) (resource.Quantity, resource.Quantity)
- func GetNodeCache(node *corev1.Node) (*localcache.NodeCache, error)
- func GetPodLocalPVCs(pod *corev1.Pod) ([]*corev1.PersistentVolumeClaim, []*corev1.PersistentVolumeClaim)
- func GetPodsTotalRequestsAndLimitsByNodeName(pods []corev1.Pod, nodeName string) (map[corev1.ResourceName]resource.Quantity, ...)
- func GetYamlContentFromDirectory(dir string) ([]string, error)
- func MakeValidNodeByNode(node *corev1.Node, nodename string) (*corev1.Node, error)
- func MakeValidPod(oldPod *corev1.Pod) (*corev1.Pod, error)
- func MakeValidPodByCronJob(cronjob *batchv1beta1.CronJob) ([]*corev1.Pod, error)
- func MakeValidPodByJob(job *batchv1.Job) ([]*corev1.Pod, error)
- func MakeValidPodByPod(pod *corev1.Pod) (*corev1.Pod, error)
- func MakeValidPodsByDaemonset(ds *appsv1.DaemonSet, nodes []*corev1.Node) ([]*corev1.Pod, error)
- func MakeValidPodsByDeployment(deploy *appsv1.Deployment) ([]*corev1.Pod, error)
- func MakeValidPodsByReplicaSet(rs *appsv1.ReplicaSet) ([]*corev1.Pod, error)
- func MakeValidPodsByStatefulSet(ss *appsv1.StatefulSet) ([]*corev1.Pod, error)
- func MultiplyMilliQuant(quant resource.Quantity, factor float64) resource.Quantity
- func MultiplyQuant(quant resource.Quantity, factor float64) resource.Quantity
- func NewDaemonPod(ds *appsv1.DaemonSet, nodeName string) (*corev1.Pod, error)
- func NewFakeNode(node *corev1.Node) (*corev1.Node, error)
- func NewFakeNodes(node *corev1.Node, nodeCount int) ([]*corev1.Node, error)
- func NodeShouldRunPod(node *corev1.Node, pod *corev1.Pod) bool
- func OwnedByDaemonset(refs []metav1.OwnerReference) bool
- func OwnedByWorkload(refs []metav1.OwnerReference, workload runtime.Object) bool
- func ParseFilePath(path string) (filePaths []string, err error)
- func ReadJsonFile(path string) []byte
- func ReadYamlFile(path string) []byte
- func SetDaemonSetPodNodeNameByNodeAffinity(affinity *corev1.Affinity, nodename string) *corev1.Affinity
- func SetObjectMetaFromObject(owner metav1.Object, template metav1.Object) metav1.ObjectMeta
- func SetStorageAnnotationOnPods(pods []*corev1.Pod, volumeClaimTemplates []corev1.PersistentVolumeClaim, ...) error
- func ValidateNode(node *corev1.Node) error
- func ValidatePod(pod *corev1.Pod) error
- type NodeQueue
- type NodeStorage
- type Volume
- type VolumeRequest
Constants ¶
View Source
const ( // open-local storage class names OpenLocalSCNameLVM = "open-local-lvm" OpenLocalSCNameDeviceHDD = "open-local-device-hdd" OpenLocalSCNameDeviceSSD = "open-local-device-ssd" OpenLocalSCNameMountPointHDD = "open-local-mountpoint-hdd" OpenLocalSCNameMountPointSSD = "open-local-mountpoint-ssd" // yoda storage class names YodaSCNameLVM = "yoda-lvm-default" YodaSCNameDeviceHDD = "yoda-device-hdd" YodaSCNameDeviceSSD = "yoda-device-ssd" YodaSCNameMountPointHDD = "yoda-mountpoint-hdd" YodaSCNameMountPointSSD = "yoda-mountpoint-ssd" )
Variables ¶
This section is empty.
Functions ¶
func AddWorkloadInfoToPod ¶
AddWorkloadInfoToPod add annotation in pod for simulating later
func AdjustNodesOrder ¶
func AdjustWorkloads ¶
func DecodeYamlContent ¶
DecodeYamlContent captures the yml or yaml file, and decodes it
func GetGpuNodeInfoFromAnnotation ¶ added in v0.1.1
func GetGpuNodeInfoFromAnnotation(node *corev1.Node) (*gpusharecache.NodeGpuInfo, error)
func GetMasterFromKubeConfig ¶
func GetNodeAllocatable ¶
func GetNodeCache ¶
func GetNodeCache(node *corev1.Node) (*localcache.NodeCache, error)
func GetPodLocalPVCs ¶
func GetPodLocalPVCs(pod *corev1.Pod) ([]*corev1.PersistentVolumeClaim, []*corev1.PersistentVolumeClaim)
func GetYamlContentFromDirectory ¶
GetYamlContentFromDirectory returns the yaml content and ignores other content
func MakeValidNodeByNode ¶
func MakeValidPod ¶
MakeValidPod make pod valid, so we can handle it
func MakeValidPodByCronJob ¶
func MakeValidPodByCronJob(cronjob *batchv1beta1.CronJob) ([]*corev1.Pod, error)
func MakeValidPodsByDeployment ¶
func MakeValidPodsByDeployment(deploy *appsv1.Deployment) ([]*corev1.Pod, error)
func MakeValidPodsByReplicaSet ¶
func MakeValidPodsByReplicaSet(rs *appsv1.ReplicaSet) ([]*corev1.Pod, error)
func MakeValidPodsByStatefulSet ¶
func MakeValidPodsByStatefulSet(ss *appsv1.StatefulSet) ([]*corev1.Pod, error)
func MultiplyMilliQuant ¶
MultiplyMilliQuant scales quantity by factor
func MultiplyQuant ¶
MultiplyQuant scales quantity by factor
func NewFakeNodes ¶ added in v0.1.3
func NodeShouldRunPod ¶
NodeShouldRunPod determines whether a node should run a pod according to scheduling rules
func OwnedByDaemonset ¶ added in v0.1.3
func OwnedByDaemonset(refs []metav1.OwnerReference) bool
func OwnedByWorkload ¶ added in v0.1.3
func OwnedByWorkload(refs []metav1.OwnerReference, workload runtime.Object) bool
func ParseFilePath ¶
ParseFilePath converts recursively directory path to a slice of file paths
func ReadJsonFile ¶
func ReadYamlFile ¶
func SetObjectMetaFromObject ¶
Types ¶
type NodeQueue ¶
type NodeQueue struct {
// contains filtered or unexported fields
}
func NewNodeQueue ¶
type NodeStorage ¶
type NodeStorage struct { VGs []localcache.SharedResource `json:"vgs"` Devices []localcache.ExclusiveResource `json:"devices"` }
func GetNodeStorage ¶
func GetNodeStorage(node *corev1.Node) (*NodeStorage, error)
type VolumeRequest ¶
type VolumeRequest struct {
Volumes []Volume `json:"volumes"`
}
func GetPodStorage ¶
func GetPodStorage(pod *corev1.Pod) *VolumeRequest
Click to show internal directories.
Click to hide internal directories.