Documentation ¶
Index ¶
- Constants
- func ApplyYamlWithKubectl(path, namespace string) error
- func DecoratePodForGangScheduling(placeholderTimeout int, schedulingStyle string, taskGroupName string, ...) *v1.Pod
- func GetConfigMapObj(yamlPath string) (*v1.ConfigMap, error)
- func GetPodObj(yamlPath string) (*v1.Pod, error)
- func GetPodsTotalRequests(podList *v1.PodList) (reqs v1.ResourceList)
- func GetSecretObj(yamlPath string) (*v1.Secret, error)
- func GetWorkerNodes(nodes v1.NodeList) []v1.Node
- func InitJobConfig(conf JobConfig) (*batchv1.Job, error)
- func InitSleepPod(conf SleepPodConfig) (*v1.Pod, error)
- func InitTaskGroups(conf SleepPodConfig, mainTaskGroupName, secondTaskGroupName string, ...) []*ykv1.TaskGroup
- func InitTestJob(jobName string, parallelism, completions int32, pod *v1.Pod) *batchv1.Job
- func InitTestPod(conf TestPodConfig) (*v1.Pod, error)
- func LogNamespaceInfo(ns string) error
- func ObserveEventAfterAction(c clientset.Interface, ns string, eventPredicate func(*v1.Event) bool, ...) (bool, error)
- func PodAnnotationToMap(annotations *PodAnnotation) (map[string]string, error)
- func ScheduleFailureEvent(podName string) func(*v1.Event) bool
- func ScheduleSuccessEvent(ns, podName, nodeName string) func(*v1.Event) bool
- func SetPortForwarder(req PortForwardAPodRequest, dialer httpstream.Dialer, ports []string) error
- type Action
- type JobConfig
- type KubeCtl
- func (k *KubeCtl) ConfigMapExists(name string, namespace string) (bool, error)
- func (k *KubeCtl) CreateClusterRoleBinding(roleName string, role string, namespace string, serviceAccount string) (*authv1.ClusterRoleBinding, error)
- func (k *KubeCtl) CreateConfigMap(cMap *v1.ConfigMap, namespace string) (*v1.ConfigMap, error)
- func (k *KubeCtl) CreateConfigMaps(namespace string, cMap *v1.ConfigMap) (*v1.ConfigMap, error)
- func (k *KubeCtl) CreateDeployment(deployment *appsv1.Deployment, namespace string) (*appsv1.Deployment, error)
- func (k *KubeCtl) CreateJob(job *batchv1.Job, namespace string) (*batchv1.Job, error)
- func (k *KubeCtl) CreateNamespace(namespace string, annotations map[string]string) (*v1.Namespace, error)
- func (k *KubeCtl) CreatePod(pod *v1.Pod, namespace string) (*v1.Pod, error)
- func (k *KubeCtl) CreatePriorityClass(pc *schedulingv1.PriorityClass) (*schedulingv1.PriorityClass, error)
- func (k *KubeCtl) CreateSecret(secret *v1.Secret, namespace string) (*v1.Secret, error)
- func (k *KubeCtl) CreateServiceAccount(accountName string, namespace string) (*v1.ServiceAccount, error)
- func (k *KubeCtl) CreateTestPodAction(pod *v1.Pod, namespace string) Action
- func (k *KubeCtl) DeleteClusterRoleBindings(roleName string) error
- func (k *KubeCtl) DeleteConfigMap(cName string, namespace string) error
- func (k *KubeCtl) DeleteConfigMaps(namespace string, cMapName string) error
- func (k *KubeCtl) DeleteDeployment(name, namespace string) error
- func (k *KubeCtl) DeleteJob(jobName string, namespace string) error
- func (k *KubeCtl) DeleteNamespace(namespace string) error
- func (k *KubeCtl) DeletePod(podName string, namespace string) error
- func (k *KubeCtl) DeletePodAnnotation(pod *v1.Pod, namespace, annotation string) (*v1.Pod, error)
- func (k *KubeCtl) DeletePodGracefully(podName string, namespace string) error
- func (k *KubeCtl) DeletePriorityClass(priorityClassName string) error
- func (k *KubeCtl) DeleteServiceAccount(accountName string, namespace string) error
- func (k *KubeCtl) DescribeNode(node v1.Node) error
- func (k *KubeCtl) GetClient() *kubernetes.Clientset
- func (k *KubeCtl) GetConfigMap(name string, namespace string) (*v1.ConfigMap, error)
- func (k *KubeCtl) GetConfigMaps(namespace string, cMapName string) (*v1.ConfigMap, error)
- func (k *KubeCtl) GetDeployment(name, namespace string) (*appsv1.Deployment, error)
- func (k *KubeCtl) GetEvents(namespace string) (*v1.EventList, error)
- func (k *KubeCtl) GetJobNamesFromNS(namespace string) ([]string, error)
- func (k *KubeCtl) GetJobs(namespace string) (*batchv1.JobList, error)
- func (k *KubeCtl) GetKubeConfig() (*rest.Config, error)
- func (k *KubeCtl) GetNodes() (*v1.NodeList, error)
- func (k *KubeCtl) GetNodesAvailRes(nodes v1.NodeList) map[string]v1.ResourceList
- func (k *KubeCtl) GetPod(name, namespace string) (*v1.Pod, error)
- func (k *KubeCtl) GetPodLogs(podName string, namespace string, containerName string) ([]byte, error)
- func (k *KubeCtl) GetPodNamesFromNS(namespace string) ([]string, error)
- func (k *KubeCtl) GetPods(namespace string) (*v1.PodList, error)
- func (k *KubeCtl) GetPodsByOptions(options metav1.ListOptions) (*v1.PodList, error)
- func (k *KubeCtl) GetSchedulerPod() (string, error)
- func (k *KubeCtl) GetService(serviceName string, namespace string) (*v1.Service, error)
- func (k *KubeCtl) KillPortForwardProcess()
- func (k *KubeCtl) ListPods(namespace string, selector string) (*v1.PodList, error)
- func (k *KubeCtl) ListPodsByFieldSelector(namespace string, selector string) (*v1.PodList, error)
- func (k *KubeCtl) PodScheduled(podNamespace, podName string) wait.ConditionFunc
- func (k *KubeCtl) PodUnschedulable(podNamespace, podName string) wait.ConditionFunc
- func (k *KubeCtl) PortForwardPod(req PortForwardAPodRequest) error
- func (k *KubeCtl) PortForwardYkSchedulerPod() error
- func (k *KubeCtl) RemoveYunikornSchedulerPodAnnotation(annotation string) error
- func (k *KubeCtl) SetClient() error
- func (k *KubeCtl) StartConfigMapInformer(namespace string, stopChan <-chan struct{}, ...) error
- func (k *KubeCtl) TearDownNamespace(namespace string) error
- func (k *KubeCtl) UpdateConfigMap(cMap *v1.ConfigMap, namespace string) (*v1.ConfigMap, error)
- func (k *KubeCtl) UpdateConfigMaps(namespace string, cMap *v1.ConfigMap) (*v1.ConfigMap, error)
- func (k *KubeCtl) UpdatePodWithAnnotation(pod *v1.Pod, namespace, annotationKey, annotationVal string) (*v1.Pod, error)
- func (k *KubeCtl) UpdateYunikornSchedulerPodAnnotation(annotation string) error
- func (k *KubeCtl) WaitForJobPods(namespace string, jobName string, numPods int, timeout time.Duration) error
- func (k *KubeCtl) WaitForJobPodsCreated(namespace string, jobName string, numPods int, timeout time.Duration) error
- func (k *KubeCtl) WaitForJobPodsRunning(namespace string, jobName string, numPods int, timeout time.Duration) error
- func (k *KubeCtl) WaitForJobPodsSucceeded(namespace string, jobName string, numPods int, timeout time.Duration) error
- func (k *KubeCtl) WaitForJobTerminated(namespace string, jobName string, timeout time.Duration) error
- func (k *KubeCtl) WaitForPlaceholders(namespace string, podPrefix string, numPods int, timeout time.Duration, ...) error
- func (k *KubeCtl) WaitForPodBySelector(namespace string, selector string, timeout time.Duration) error
- func (k *KubeCtl) WaitForPodBySelectorRunning(namespace string, selector string, timeout int) error
- func (k *KubeCtl) WaitForPodCount(namespace string, wanted int, timeout time.Duration) error
- func (k *KubeCtl) WaitForPodEvent(namespace string, podName string, expectedReason string, timeout time.Duration) error
- func (k *KubeCtl) WaitForPodFailed(namespace string, podName string, timeout time.Duration) error
- func (k *KubeCtl) WaitForPodPending(namespace string, podName string, timeout time.Duration) error
- func (k *KubeCtl) WaitForPodRunning(namespace string, podName string, timeout time.Duration) error
- func (k *KubeCtl) WaitForPodScheduled(namespace string, podName string, timeout time.Duration) error
- func (k *KubeCtl) WaitForPodSucceeded(namespace string, podName string, timeout time.Duration) error
- func (k *KubeCtl) WaitForPodTerminated(namespace string, podName string, timeout time.Duration) error
- func (k *KubeCtl) WaitForPodUnschedulable(pod *v1.Pod, timeout time.Duration) error
- func (k *KubeCtl) WaitForSchedulerAfterAction(action Action, ns, podName string, expectSuccess bool) (bool, error)
- func (k *KubeCtl) WaitForServiceAccountPresent(namespace string, svcAcctName string, timeout time.Duration) error
- type PodAnnotation
- type PortForwardAPodRequest
- type SleepPodConfig
- type TestJobConfig
- type TestPodConfig
Constants ¶
const ( TaskGroupName = "yunikorn.apache.org/task-group-name" TaskGroups = "yunikorn.apache.org/task-groups" PlaceHolder = "yunikorn.apache.org/placeholder" SchedulingPolicyParams = "yunikorn.apache.org/schedulingPolicyParameters" MaxCPU = "yunikorn.apache.org/namespace.max.cpu" MaxMem = "yunikorn.apache.org/namespace.max.memory" )
Variables ¶
This section is empty.
Functions ¶
func ApplyYamlWithKubectl ¶
func DecoratePodForGangScheduling ¶ added in v1.1.0
func GetPodsTotalRequests ¶ added in v1.2.0
func GetPodsTotalRequests(podList *v1.PodList) (reqs v1.ResourceList)
Sums up current resource usage in a list of pods. Non-running pods are filtered out.
func InitSleepPod ¶ added in v1.1.0
func InitSleepPod(conf SleepPodConfig) (*v1.Pod, error)
TestPodConfig template for sleepPods
func InitTaskGroups ¶ added in v1.1.0
func InitTaskGroups(conf SleepPodConfig, mainTaskGroupName, secondTaskGroupName string, parallelism int) []*ykv1.TaskGroup
func InitTestJob ¶ added in v1.1.0
func InitTestPod ¶ added in v1.1.0
func InitTestPod(conf TestPodConfig) (*v1.Pod, error)
func LogNamespaceInfo ¶ added in v1.2.0
func ObserveEventAfterAction ¶
func ObserveEventAfterAction(c clientset.Interface, ns string, eventPredicate func(*v1.Event) bool, action Action) (bool, error)
observeEventAfterAction returns true if an event matching the predicate was emitted from the system after performing the supplied action.
func PodAnnotationToMap ¶ added in v1.1.0
func PodAnnotationToMap(annotations *PodAnnotation) (map[string]string, error)
Pod.ObjectMeta.Annotations expect map[string]string. Converts struct to map[string]string
func ScheduleSuccessEvent ¶
func SetPortForwarder ¶
func SetPortForwarder(req PortForwardAPodRequest, dialer httpstream.Dialer, ports []string) error
Types ¶
type JobConfig ¶ added in v1.1.0
type JobConfig struct { Parallelism int32 Name string Namespace string PodConfig TestPodConfig }
type KubeCtl ¶
type KubeCtl struct {
// contains filtered or unexported fields
}
func (*KubeCtl) ConfigMapExists ¶ added in v1.2.0
func (*KubeCtl) CreateClusterRoleBinding ¶
func (*KubeCtl) CreateConfigMap ¶
func (*KubeCtl) CreateConfigMaps ¶
func (*KubeCtl) CreateDeployment ¶ added in v1.2.0
func (k *KubeCtl) CreateDeployment(deployment *appsv1.Deployment, namespace string) (*appsv1.Deployment, error)
func (*KubeCtl) CreateNamespace ¶
func (k *KubeCtl) CreateNamespace(namespace string, annotations map[string]string) (*v1.Namespace, error)
Func to create a namespace provided a name
func (*KubeCtl) CreatePriorityClass ¶ added in v1.2.0
func (k *KubeCtl) CreatePriorityClass(pc *schedulingv1.PriorityClass) (*schedulingv1.PriorityClass, error)
func (*KubeCtl) CreateSecret ¶
func (*KubeCtl) CreateServiceAccount ¶
func (*KubeCtl) CreateTestPodAction ¶
CreateTestPodAction returns a closure that creates a pause pod upon invocation.
func (*KubeCtl) DeleteClusterRoleBindings ¶
func (*KubeCtl) DeleteConfigMap ¶
func (*KubeCtl) DeleteConfigMaps ¶
func (*KubeCtl) DeleteDeployment ¶ added in v1.2.0
func (*KubeCtl) DeleteNamespace ¶
func (*KubeCtl) DeletePodAnnotation ¶
func (*KubeCtl) DeletePodGracefully ¶
func (*KubeCtl) DeletePriorityClass ¶ added in v1.2.0
func (*KubeCtl) DeleteServiceAccount ¶
func (*KubeCtl) DescribeNode ¶ added in v1.2.0
DescribeNode Describe Node
func (*KubeCtl) GetClient ¶
func (k *KubeCtl) GetClient() *kubernetes.Clientset
func (*KubeCtl) GetConfigMap ¶
func (*KubeCtl) GetConfigMaps ¶
func (*KubeCtl) GetDeployment ¶ added in v1.2.0
func (k *KubeCtl) GetDeployment(name, namespace string) (*appsv1.Deployment, error)
func (*KubeCtl) GetJobNamesFromNS ¶ added in v1.2.0
func (*KubeCtl) GetNodesAvailRes ¶ added in v1.2.0
GetNodesAvailRes Returns map of nodeName to list of available resource (memory and cpu only) amounts.
func (*KubeCtl) GetPodLogs ¶ added in v1.2.0
func (*KubeCtl) GetPodNamesFromNS ¶
func (*KubeCtl) GetPodsByOptions ¶ added in v1.2.0
func (*KubeCtl) GetSchedulerPod ¶
func (*KubeCtl) GetService ¶
func (*KubeCtl) KillPortForwardProcess ¶
func (k *KubeCtl) KillPortForwardProcess()
func (*KubeCtl) ListPods ¶
Returns the list of currently scheduled or running pods in `namespace` with the given selector
func (*KubeCtl) ListPodsByFieldSelector ¶ added in v1.2.0
Returns the list of currently scheduled or running pods in `namespace` with the given selector
func (*KubeCtl) PodScheduled ¶
func (k *KubeCtl) PodScheduled(podNamespace, podName string) wait.ConditionFunc
PodScheduled checks if the pod has been scheduled
func (*KubeCtl) PodUnschedulable ¶
func (k *KubeCtl) PodUnschedulable(podNamespace, podName string) wait.ConditionFunc
PodUnschedulable returns a condition function that returns true if the given pod gets unschedulable status.
func (*KubeCtl) PortForwardPod ¶
func (k *KubeCtl) PortForwardPod(req PortForwardAPodRequest) error
func (*KubeCtl) PortForwardYkSchedulerPod ¶
func (*KubeCtl) RemoveYunikornSchedulerPodAnnotation ¶
func (*KubeCtl) StartConfigMapInformer ¶ added in v1.2.0
func (k *KubeCtl) StartConfigMapInformer(namespace string, stopChan <-chan struct{}, eventHandler cache.ResourceEventHandler) error
func (*KubeCtl) TearDownNamespace ¶
func (*KubeCtl) UpdateConfigMap ¶
func (*KubeCtl) UpdateConfigMaps ¶
func (*KubeCtl) UpdatePodWithAnnotation ¶
func (*KubeCtl) UpdateYunikornSchedulerPodAnnotation ¶
func (*KubeCtl) WaitForJobPods ¶ added in v1.2.0
func (*KubeCtl) WaitForJobPodsCreated ¶ added in v1.1.0
func (*KubeCtl) WaitForJobPodsRunning ¶ added in v1.1.0
func (*KubeCtl) WaitForJobPodsSucceeded ¶ added in v1.1.0
func (*KubeCtl) WaitForJobTerminated ¶ added in v1.2.0
func (*KubeCtl) WaitForPlaceholders ¶ added in v1.1.0
func (*KubeCtl) WaitForPodBySelector ¶ added in v1.2.0
func (k *KubeCtl) WaitForPodBySelector(namespace string, selector string, timeout time.Duration) error
Wait up to timeout seconds for a pod in 'namespace' with given 'selector' to exist
func (*KubeCtl) WaitForPodBySelectorRunning ¶
Wait up to timeout seconds for all pods in 'namespace' with given 'selector' to enter running state. Returns an error if no pods are found or not all discovered pods enter running state.
func (*KubeCtl) WaitForPodCount ¶ added in v1.2.0
func (*KubeCtl) WaitForPodEvent ¶ added in v1.1.0
func (*KubeCtl) WaitForPodFailed ¶
func (*KubeCtl) WaitForPodPending ¶
func (*KubeCtl) WaitForPodRunning ¶
Poll up to timeout seconds for pod to enter running state. Returns an error if the pod never enters the running state.
func (*KubeCtl) WaitForPodScheduled ¶
func (*KubeCtl) WaitForPodSucceeded ¶
func (*KubeCtl) WaitForPodTerminated ¶
func (*KubeCtl) WaitForPodUnschedulable ¶
WaitForPodUnschedulable waits for a pod to fail scheduling and returns an error if it does not become unschedulable within the given timeout.
type PodAnnotation ¶ added in v1.1.0
type PortForwardAPodRequest ¶
type PortForwardAPodRequest struct { // Kube config RestConfig *rest.Config // Pod to port-forward traffic for Pod v1.Pod // Local port to expose traffic to pod's target port LocalPort int // Target port for the pod PodPort int // Streams to configure where to read/write input and output Streams genericclioptions.IOStreams // StopCh is the channel used to stop the port forward process StopCh <-chan struct{} // ReadyCh communicates when the tunnel is ready to receive traffic ReadyCh chan struct{} }
type SleepPodConfig ¶ added in v1.1.0
type TestJobConfig ¶ added in v1.1.0
type TestPodConfig ¶ added in v1.1.0
type TestPodConfig struct { Name string Namespace string Affinity *v1.Affinity Annotations *PodAnnotation Labels, NodeSelector map[string]string Resources *v1.ResourceRequirements RuntimeClassHandler *string Tolerations []v1.Toleration NodeName string Ports []v1.ContainerPort OwnerReferences []metav1.OwnerReference PriorityClassName string DeletionGracePeriodSeconds *int64 TopologySpreadConstraints []v1.TopologySpreadConstraint Image string RestartPolicy v1.RestartPolicy Command []string InitContainerSleepSecs int }