k8s

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: Apache-2.0 Imports: 45 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Deployment  = "Deployment"
	StatefulSet = "StatefulSet"
	DaemonSet   = "DaemonSet"
	ReplicaSet  = "ReplicaSet"
	Job         = "Job"
	CronJob     = "CronJob"
)
View Source
const (
	TaskGroupName          = constants.DomainYuniKorn + "task-group-name"
	TaskGroups             = constants.DomainYuniKorn + "task-groups"
	PlaceHolder            = constants.DomainYuniKorn + "placeholder"
	SchedulingPolicyParams = constants.DomainYuniKorn + "schedulingPolicyParameters"

	MaxCPU = constants.DomainYuniKorn + "namespace.max.cpu"
	MaxMem = constants.DomainYuniKorn + "namespace.max.memory"
)
View Source
const (
	LocalTypePv string = "Local"
)

Variables

This section is empty.

Functions

func ApplyYamlWithKubectl

func ApplyYamlWithKubectl(path, namespace string) error

func DecoratePodForGangScheduling added in v1.1.0

func DecoratePodForGangScheduling(
	placeholderTimeout int,
	schedulingStyle string,
	taskGroupName string,
	taskGroups []*cache.TaskGroup,
	pod *v1.Pod) *v1.Pod

func GetConfigMapObj

func GetConfigMapObj(yamlPath string) (*v1.ConfigMap, error)

func GetPodObj

func GetPodObj(yamlPath string) (*v1.Pod, error)

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 GetSecretObj

func GetSecretObj(yamlPath string) (*v1.Secret, error)

func GetWorkerNodes added in v1.2.0

func GetWorkerNodes(nodes v1.NodeList) []v1.Node

func InitJobConfig added in v1.1.0

func InitJobConfig(conf JobConfig) (*batchv1.Job, error)

func InitPersistentVolume added in v1.4.0

func InitPersistentVolume(conf PvConfig) (*v1.PersistentVolume, error)

func InitPersistentVolumeClaim added in v1.4.0

func InitPersistentVolumeClaim(conf PvcConfig) (*v1.PersistentVolumeClaim, error)

func InitSleepPod added in v1.1.0

func InitSleepPod(conf SleepPodConfig) (*v1.Pod, error)

TestPodConfig template for sleepPods

func InitStorageClass added in v1.4.0

func InitStorageClass(conf ScConfig) (*storagev1.StorageClass, error)

func InitTaskGroup added in v1.3.0

func InitTaskGroup(conf SleepPodConfig, taskGroupName string, parallelism int32) []*cache.TaskGroup

func InitTaskGroups added in v1.1.0

func InitTaskGroups(conf SleepPodConfig, mainTaskGroupName, secondTaskGroupName string, parallelism int) []*cache.TaskGroup

func InitTestJob added in v1.1.0

func InitTestJob(jobName string, parallelism, completions int32, pod *v1.Pod) *batchv1.Job

func InitTestPod added in v1.1.0

func InitTestPod(conf TestPodConfig) (*v1.Pod, error)

func IsComputeNode added in v1.3.0

func IsComputeNode(node *v1.Node) bool

func IsMasterNode added in v1.3.0

func IsMasterNode(node *v1.Node) bool

func ObserveConfigMapInformerUpdateAfterAction added in v1.4.0

func ObserveConfigMapInformerUpdateAfterAction(action func())

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 ScheduleFailureEvent

func ScheduleFailureEvent(podName string) func(*v1.Event) bool

func ScheduleSuccessEvent

func ScheduleSuccessEvent(ns, podName, nodeName string) func(*v1.Event) bool

func SetPortForwarder

func SetPortForwarder(req PortForwardAPodRequest, dialer httpstream.Dialer, ports []string) error

Types

type Action

type Action func() error

Action is a function to be performed by the system.

type AllowPreemptOpted added in v1.4.0

type AllowPreemptOpted int
const (
	NotConfig AllowPreemptOpted = iota
	Allow
	Deny
)

type EventHandler added in v1.4.0

type EventHandler struct {
	// contains filtered or unexported fields
}

func (*EventHandler) OnAdd added in v1.4.0

func (e *EventHandler) OnAdd(_ interface{}, _ bool)

func (*EventHandler) OnDelete added in v1.4.0

func (e *EventHandler) OnDelete(_ interface{})

func (*EventHandler) OnUpdate added in v1.4.0

func (e *EventHandler) OnUpdate(_, _ interface{})

func (*EventHandler) WaitForUpdate added in v1.4.0

func (e *EventHandler) WaitForUpdate(timeout time.Duration) bool

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 (k *KubeCtl) ConfigMapExists(name string, namespace string) (bool, error)

func (*KubeCtl) CreateClusterRole added in v1.4.0

func (k *KubeCtl) CreateClusterRole(clusterRole *rbacv1.ClusterRole) (*rbacv1.ClusterRole, error)

func (*KubeCtl) CreateClusterRoleBinding

func (k *KubeCtl) CreateClusterRoleBinding(
	roleName string,
	role string,
	namespace string,
	serviceAccount string) (*authv1.ClusterRoleBinding, error)

func (*KubeCtl) CreateConfigMap

func (k *KubeCtl) CreateConfigMap(cMap *v1.ConfigMap, namespace string) (*v1.ConfigMap, error)

func (*KubeCtl) CreateConfigMaps

func (k *KubeCtl) CreateConfigMaps(namespace string, cMap *v1.ConfigMap) (*v1.ConfigMap, error)

func (*KubeCtl) CreateCronJob added in v1.3.0

func (k *KubeCtl) CreateCronJob(cronJob *batchv1.CronJob, namespace string) (*batchv1.CronJob, error)

func (*KubeCtl) CreateDaemonSet added in v1.3.0

func (k *KubeCtl) CreateDaemonSet(daemonSet *appsv1.DaemonSet, namespace string) (*appsv1.DaemonSet, error)

func (*KubeCtl) CreateDeployment added in v1.2.0

func (k *KubeCtl) CreateDeployment(deployment *appsv1.Deployment, namespace string) (*appsv1.Deployment, error)

func (*KubeCtl) CreateJob added in v1.1.0

func (k *KubeCtl) CreateJob(job *batchv1.Job, namespace string) (*batchv1.Job, 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) CreatePersistentVolume added in v1.4.0

func (k *KubeCtl) CreatePersistentVolume(pv *v1.PersistentVolume) (*v1.PersistentVolume, error)

func (*KubeCtl) CreatePersistentVolumeClaim added in v1.4.0

func (k *KubeCtl) CreatePersistentVolumeClaim(pvc *v1.PersistentVolumeClaim, ns string) (*v1.PersistentVolumeClaim, error)

func (*KubeCtl) CreatePod

func (k *KubeCtl) CreatePod(pod *v1.Pod, namespace string) (*v1.Pod, error)

func (*KubeCtl) CreatePriorityClass added in v1.2.0

func (k *KubeCtl) CreatePriorityClass(pc *schedulingv1.PriorityClass) (*schedulingv1.PriorityClass, error)

func (*KubeCtl) CreateReplicaSet added in v1.3.0

func (k *KubeCtl) CreateReplicaSet(replicaSet *appsv1.ReplicaSet, namespace string) (*appsv1.ReplicaSet, error)

func (*KubeCtl) CreateSecret

func (k *KubeCtl) CreateSecret(secret *v1.Secret, namespace string) (*v1.Secret, error)

func (*KubeCtl) CreateService added in v1.4.0

func (k *KubeCtl) CreateService(service *v1.Service, namespace string) (*v1.Service, error)

func (*KubeCtl) CreateServiceAccount

func (k *KubeCtl) CreateServiceAccount(accountName string, namespace string) (*v1.ServiceAccount, error)

func (*KubeCtl) CreateStatefulSet added in v1.3.0

func (k *KubeCtl) CreateStatefulSet(stetafulSet *appsv1.StatefulSet, namespace string) (*appsv1.StatefulSet, error)

func (*KubeCtl) CreateStorageClass added in v1.4.0

func (k *KubeCtl) CreateStorageClass(sc *storagev1.StorageClass) (*storagev1.StorageClass, error)

func (*KubeCtl) CreateTestPodAction

func (k *KubeCtl) CreateTestPodAction(pod *v1.Pod, namespace string) Action

CreateTestPodAction returns a closure that creates a pause pod upon invocation.

func (*KubeCtl) DeleteClusterRole added in v1.4.0

func (k *KubeCtl) DeleteClusterRole(roleName string) error

func (*KubeCtl) DeleteClusterRoleBindings

func (k *KubeCtl) DeleteClusterRoleBindings(roleName string) error

func (*KubeCtl) DeleteConfigMap

func (k *KubeCtl) DeleteConfigMap(cName string, namespace string) error

func (*KubeCtl) DeleteConfigMaps

func (k *KubeCtl) DeleteConfigMaps(namespace string, cMapName string) error

func (*KubeCtl) DeleteCronJob added in v1.3.0

func (k *KubeCtl) DeleteCronJob(name, namespace string) error

func (*KubeCtl) DeleteDaemonSet added in v1.3.0

func (k *KubeCtl) DeleteDaemonSet(name, namespace string) error

func (*KubeCtl) DeleteDaemonSets added in v1.5.0

func (k *KubeCtl) DeleteDaemonSets(namespace string) error

func (*KubeCtl) DeleteDeployment added in v1.2.0

func (k *KubeCtl) DeleteDeployment(name, namespace string) error

func (*KubeCtl) DeleteDeployments added in v1.5.0

func (k *KubeCtl) DeleteDeployments(namespace string) error

func (*KubeCtl) DeleteJob added in v1.2.0

func (k *KubeCtl) DeleteJob(jobName string, namespace string) error

func (*KubeCtl) DeleteJobs added in v1.5.0

func (k *KubeCtl) DeleteJobs(namespace string) error

func (*KubeCtl) DeleteNamespace

func (k *KubeCtl) DeleteNamespace(namespace string) error

func (*KubeCtl) DeletePVCs added in v1.4.0

func (k *KubeCtl) DeletePVCs(namespace string) error

func (*KubeCtl) DeletePVs added in v1.4.0

func (k *KubeCtl) DeletePVs(namespace string) error

func (*KubeCtl) DeletePersistentVolume added in v1.4.0

func (k *KubeCtl) DeletePersistentVolume(pvName string) error

func (*KubeCtl) DeletePersistentVolumeClaim added in v1.4.0

func (k *KubeCtl) DeletePersistentVolumeClaim(pvcName string, namespace string) error

func (*KubeCtl) DeletePod

func (k *KubeCtl) DeletePod(podName string, namespace string) error

func (*KubeCtl) DeletePodAnnotation

func (k *KubeCtl) DeletePodAnnotation(pod *v1.Pod, namespace, annotation string) (*v1.Pod, error)

func (*KubeCtl) DeletePodGracefully

func (k *KubeCtl) DeletePodGracefully(podName string, namespace string) error

func (*KubeCtl) DeletePods added in v1.3.0

func (k *KubeCtl) DeletePods(namespace string) error

func (*KubeCtl) DeletePriorityClass added in v1.2.0

func (k *KubeCtl) DeletePriorityClass(priorityClassName string) error

func (*KubeCtl) DeleteReplicaSet added in v1.3.0

func (k *KubeCtl) DeleteReplicaSet(name, namespace string) error

func (*KubeCtl) DeleteReplicaSets added in v1.5.0

func (k *KubeCtl) DeleteReplicaSets(namespace string) error

func (*KubeCtl) DeleteServiceAccount

func (k *KubeCtl) DeleteServiceAccount(accountName string, namespace string) error

func (*KubeCtl) DeleteStatefulSet added in v1.3.0

func (k *KubeCtl) DeleteStatefulSet(name, namespace string) error

func (*KubeCtl) DeleteStatefulSets added in v1.5.0

func (k *KubeCtl) DeleteStatefulSets(namespace string) error

func (*KubeCtl) DeleteStorageClass added in v1.4.0

func (k *KubeCtl) DeleteStorageClass(scName string) error

func (*KubeCtl) DeleteWorkloadAndPods added in v1.3.0

func (k *KubeCtl) DeleteWorkloadAndPods(objectName string, wlType WorkloadType, namespace string)

func (*KubeCtl) DescribeNode added in v1.2.0

func (k *KubeCtl) DescribeNode(node v1.Node) (string, error)

func (*KubeCtl) GetClient

func (k *KubeCtl) GetClient() *kubernetes.Clientset

func (*KubeCtl) GetConfigMap

func (k *KubeCtl) GetConfigMap(name string, namespace string) (*v1.ConfigMap, error)

func (*KubeCtl) GetConfigMaps

func (k *KubeCtl) GetConfigMaps(namespace string, cMapName string) (*v1.ConfigMap, error)

func (*KubeCtl) GetDaemonSet added in v1.3.0

func (k *KubeCtl) GetDaemonSet(name, namespace string) (*appsv1.DaemonSet, error)

func (*KubeCtl) GetDaemonSetNamesFromNS added in v1.5.0

func (k *KubeCtl) GetDaemonSetNamesFromNS(namespace string) ([]string, error)

func (*KubeCtl) GetDaemonSets added in v1.5.0

func (k *KubeCtl) GetDaemonSets(namespace string) (*appsv1.DaemonSetList, error)

func (*KubeCtl) GetDeployment added in v1.2.0

func (k *KubeCtl) GetDeployment(name, namespace string) (*appsv1.Deployment, error)

func (*KubeCtl) GetDeploymentNamesFromNS added in v1.5.0

func (k *KubeCtl) GetDeploymentNamesFromNS(namespace string) ([]string, error)

func (*KubeCtl) GetDeployments added in v1.5.0

func (k *KubeCtl) GetDeployments(namespace string) (*appsv1.DeploymentList, error)

func (*KubeCtl) GetEvents

func (k *KubeCtl) GetEvents(namespace string) (*v1.EventList, error)

func (*KubeCtl) GetJobNamesFromNS added in v1.2.0

func (k *KubeCtl) GetJobNamesFromNS(namespace string) ([]string, error)

func (*KubeCtl) GetJobs added in v1.2.0

func (k *KubeCtl) GetJobs(namespace string) (*batchv1.JobList, error)

func (*KubeCtl) GetKubeConfig

func (k *KubeCtl) GetKubeConfig() (*rest.Config, error)

func (*KubeCtl) GetNodes added in v1.1.0

func (k *KubeCtl) GetNodes() (*v1.NodeList, error)

func (*KubeCtl) GetNodesAvailRes added in v1.2.0

func (k *KubeCtl) GetNodesAvailRes(nodes v1.NodeList) map[string]v1.ResourceList

GetNodesAvailRes Returns map of nodeName to list of available resource (memory and cpu only) amounts.

func (*KubeCtl) GetNodesCapacity added in v1.3.0

func (k *KubeCtl) GetNodesCapacity(nodes v1.NodeList) map[string]v1.ResourceList

func (*KubeCtl) GetPersistentVolume added in v1.4.0

func (k *KubeCtl) GetPersistentVolume(name string) (*v1.PersistentVolume, error)

func (*KubeCtl) GetPod

func (k *KubeCtl) GetPod(name, namespace string) (*v1.Pod, error)

func (*KubeCtl) GetPodLogs added in v1.2.0

func (k *KubeCtl) GetPodLogs(podName string, namespace string, containerName string) ([]byte, error)

func (*KubeCtl) GetPodNamesFromNS

func (k *KubeCtl) GetPodNamesFromNS(namespace string) ([]string, error)

func (*KubeCtl) GetPods

func (k *KubeCtl) GetPods(namespace string) (*v1.PodList, error)

func (*KubeCtl) GetPodsByOptions added in v1.2.0

func (k *KubeCtl) GetPodsByOptions(options metav1.ListOptions) (*v1.PodList, error)

func (*KubeCtl) GetPvNameListFromNs added in v1.4.0

func (k *KubeCtl) GetPvNameListFromNs(namespace string) ([]string, error)

func (*KubeCtl) GetPvcNameListFromNs added in v1.4.0

func (k *KubeCtl) GetPvcNameListFromNs(namespace string) ([]string, error)

func (*KubeCtl) GetReplicaSet added in v1.3.0

func (k *KubeCtl) GetReplicaSet(name, namespace string) (*appsv1.ReplicaSet, error)

func (*KubeCtl) GetReplicaSetNamesFromNS added in v1.5.0

func (k *KubeCtl) GetReplicaSetNamesFromNS(namespace string) ([]string, error)

func (*KubeCtl) GetReplicaSets added in v1.3.0

func (k *KubeCtl) GetReplicaSets(namespace string) (*appsv1.ReplicaSetList, error)

func (*KubeCtl) GetSchedulerPod

func (k *KubeCtl) GetSchedulerPod() (string, error)

func (*KubeCtl) GetService

func (k *KubeCtl) GetService(serviceName string, namespace string) (*v1.Service, error)

func (*KubeCtl) GetStatefulSet added in v1.3.0

func (k *KubeCtl) GetStatefulSet(name, namespace string) (*appsv1.StatefulSet, error)

func (*KubeCtl) GetStatefulSetNamesFromNS added in v1.5.0

func (k *KubeCtl) GetStatefulSetNamesFromNS(namespace string) ([]string, error)

func (*KubeCtl) GetStatefulSets added in v1.5.0

func (k *KubeCtl) GetStatefulSets(namespace string) (*appsv1.StatefulSetList, error)

func (*KubeCtl) IsNodeLabelExists added in v1.3.0

func (k *KubeCtl) IsNodeLabelExists(name, key string) (bool, error)

func (*KubeCtl) KillPortForwardProcess

func (k *KubeCtl) KillPortForwardProcess()

func (*KubeCtl) ListPlaceholders added in v1.4.0

func (k *KubeCtl) ListPlaceholders(namespace string, podPrefix string) ([]v1.Pod, error)

func (*KubeCtl) ListPods

func (k *KubeCtl) ListPods(namespace string, selector string) (*v1.PodList, error)

Returns the list of currently scheduled or running pods in `namespace` with the given selector

func (*KubeCtl) ListPodsByFieldSelector added in v1.2.0

func (k *KubeCtl) ListPodsByFieldSelector(namespace string, selector string) (*v1.PodList, error)

Returns the list of currently scheduled or running pods in `namespace` with the given selector

func (*KubeCtl) ListPodsByLabelSelector added in v1.4.0

func (k *KubeCtl) ListPodsByLabelSelector(namespace string, selector string) (*v1.PodList, error)

Returns the list of pods in `namespace` with the given label selector

func (*KubeCtl) LogNamespaceInfo added in v1.5.0

func (k *KubeCtl) LogNamespaceInfo(file *os.File, ns string) error

func (*KubeCtl) LogNodesInfo added in v1.5.0

func (k *KubeCtl) LogNodesInfo(file *os.File) error

func (*KubeCtl) LogPodsInfo added in v1.5.0

func (k *KubeCtl) LogPodsInfo(file *os.File) error

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 (k *KubeCtl) PortForwardYkSchedulerPod() error

func (*KubeCtl) RemoveNodeLabel added in v1.3.0

func (k *KubeCtl) RemoveNodeLabel(name, key, value string) error

func (*KubeCtl) SetClient

func (k *KubeCtl) SetClient() error

func (*KubeCtl) SetNodeLabel added in v1.3.0

func (k *KubeCtl) SetNodeLabel(name, key, value string) error

func (*KubeCtl) StartConfigMapInformer added in v1.2.0

func (k *KubeCtl) StartConfigMapInformer(namespace string, stopChan <-chan struct{}, eventHandler cache.ResourceEventHandler) error

func (*KubeCtl) TaintNode added in v1.3.0

func (k *KubeCtl) TaintNode(name, key, val string, effect v1.TaintEffect) error

func (*KubeCtl) TaintNodes added in v1.4.0

func (k *KubeCtl) TaintNodes(names []string, key, val string, effect v1.TaintEffect) error

func (*KubeCtl) TearDownNamespace

func (k *KubeCtl) TearDownNamespace(namespace string) error

func (*KubeCtl) UntaintNode added in v1.3.0

func (k *KubeCtl) UntaintNode(name, key string) error

func (*KubeCtl) UntaintNodes added in v1.4.0

func (k *KubeCtl) UntaintNodes(names []string, key string) error

func (*KubeCtl) UpdateConfigMap

func (k *KubeCtl) UpdateConfigMap(cMap *v1.ConfigMap, namespace string) (*v1.ConfigMap, error)

func (*KubeCtl) UpdateConfigMaps

func (k *KubeCtl) UpdateConfigMaps(namespace string, cMap *v1.ConfigMap) (*v1.ConfigMap, error)

func (*KubeCtl) UpdateDeployment added in v1.3.0

func (k *KubeCtl) UpdateDeployment(deployment *appsv1.Deployment, namespace string) (*appsv1.Deployment, error)

func (*KubeCtl) UpdateNamespace added in v1.4.0

func (k *KubeCtl) UpdateNamespace(namespace string, annotations map[string]string) (*v1.Namespace, error)

Func to update a namespace with annotations

func (*KubeCtl) UpdatePod added in v1.3.0

func (k *KubeCtl) UpdatePod(pod *v1.Pod, namespace string) (*v1.Pod, error)

func (*KubeCtl) UpdatePodWithAnnotation

func (k *KubeCtl) UpdatePodWithAnnotation(pod *v1.Pod, namespace, annotationKey, annotationVal string) (*v1.Pod, error)

func (*KubeCtl) WaitForJobPods added in v1.2.0

func (k *KubeCtl) WaitForJobPods(namespace string, jobName string, numPods int, timeout time.Duration) error

func (*KubeCtl) WaitForJobPodsCreated added in v1.1.0

func (k *KubeCtl) WaitForJobPodsCreated(namespace string, jobName string, numPods int, timeout time.Duration) error

func (*KubeCtl) WaitForJobPodsRunning added in v1.1.0

func (k *KubeCtl) WaitForJobPodsRunning(namespace string, jobName string, numPods int, timeout time.Duration) error

func (*KubeCtl) WaitForJobPodsSucceeded added in v1.1.0

func (k *KubeCtl) WaitForJobPodsSucceeded(namespace string, jobName string, numPods int, timeout time.Duration) error

func (*KubeCtl) WaitForJobTerminated added in v1.2.0

func (k *KubeCtl) WaitForJobTerminated(namespace string, jobName string, timeout time.Duration) error

func (*KubeCtl) WaitForPersistentVolumeAvailable added in v1.4.0

func (k *KubeCtl) WaitForPersistentVolumeAvailable(name string, timeout time.Duration) error

func (*KubeCtl) WaitForPersistentVolumeClaimPresent added in v1.4.0

func (k *KubeCtl) WaitForPersistentVolumeClaimPresent(namespace string, name string, timeout time.Duration) error

func (*KubeCtl) WaitForPlaceholders added in v1.1.0

func (k *KubeCtl) WaitForPlaceholders(namespace string, podPrefix string, numPods int, timeout time.Duration, podPhase *v1.PodPhase) error

func (*KubeCtl) WaitForPlaceholdersStableState added in v1.3.0

func (k *KubeCtl) WaitForPlaceholdersStableState(namespace string, podPrefix string, timeout time.Duration) error

WaitForPlaceholdersStableState used when the expected state of the placeholders cannot be properly determined in advance or not needed. Returns when the phase of pods does not change three times in a row.

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

func (k *KubeCtl) WaitForPodBySelectorRunning(namespace string, selector string, timeout int) error

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) WaitForPodBySelectorSucceeded added in v1.4.0

func (k *KubeCtl) WaitForPodBySelectorSucceeded(namespace string, selector string, timeout time.Duration) error

Wait for all pods in 'namespace' with given 'selector' to enter succeeded state. Returns an error if no pods are found or not all discovered pods enter succeeded state.

func (*KubeCtl) WaitForPodCount added in v1.2.0

func (k *KubeCtl) WaitForPodCount(namespace string, wanted int, timeout time.Duration) error

func (*KubeCtl) WaitForPodEvent added in v1.1.0

func (k *KubeCtl) WaitForPodEvent(namespace string, podName string, expectedReason string, timeout time.Duration) error

func (*KubeCtl) WaitForPodFailed

func (k *KubeCtl) WaitForPodFailed(namespace string, podName string, timeout time.Duration) error

func (*KubeCtl) WaitForPodPending

func (k *KubeCtl) WaitForPodPending(namespace string, podName string, timeout time.Duration) error

func (*KubeCtl) WaitForPodRunning

func (k *KubeCtl) WaitForPodRunning(namespace string, podName string, timeout time.Duration) error

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 (k *KubeCtl) WaitForPodScheduled(namespace string, podName string, timeout time.Duration) error

func (*KubeCtl) WaitForPodStateStable added in v1.3.0

func (k *KubeCtl) WaitForPodStateStable(namespace string, podName string, timeout time.Duration) (v1.PodPhase, error)

func (*KubeCtl) WaitForPodSucceeded

func (k *KubeCtl) WaitForPodSucceeded(namespace string, podName string, timeout time.Duration) error

func (*KubeCtl) WaitForPodTerminated

func (k *KubeCtl) WaitForPodTerminated(namespace string, podName string, timeout time.Duration) error

func (*KubeCtl) WaitForPodUnschedulable

func (k *KubeCtl) WaitForPodUnschedulable(pod *v1.Pod, timeout time.Duration) error

WaitForPodUnschedulable waits for a pod to fail scheduling and returns an error if it does not become unschedulable within the given timeout.

func (*KubeCtl) WaitForSchedulerAfterAction

func (k *KubeCtl) WaitForSchedulerAfterAction(action Action, ns, podName string, expectSuccess bool) (bool, error)

WaitForSchedulerAfterAction performs the provided action and then waits for scheduler to act on the given pod.

func (*KubeCtl) WaitForServiceAccountPresent

func (k *KubeCtl) WaitForServiceAccountPresent(namespace string, svcAcctName string, timeout time.Duration) error

type PodAnnotation added in v1.1.0

type PodAnnotation struct {
	TaskGroupName          string            `json:"yunikorn.apache.org/task-group-name,omitempty"`
	TaskGroups             []cache.TaskGroup `json:"-"`
	SchedulingPolicyParams string            `json:"yunikorn.apache.org/schedulingPolicyParameters,omitempty"`
	Other                  map[string]string `json:"-"`
}

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 PvConfig added in v1.4.0

type PvConfig struct {
	Name         string
	Labels       map[string]string
	Capacity     string
	AccessModes  []v1.PersistentVolumeAccessMode
	Type         string
	Path         string
	NodeAffinity *v1.VolumeNodeAffinity
	StorageClass string
}

type PvcConfig added in v1.4.0

type PvcConfig struct {
	Name             string
	Capacity         string
	VolumeName       string
	StorageClassName string
}

type ScConfig added in v1.4.0

type ScConfig struct {
	Name        string
	Provisioner string
	Parameters  map[string]string
}

type SleepPodConfig added in v1.1.0

type SleepPodConfig struct {
	Name         string
	NS           string
	AppID        string
	Time         int
	CPU          int64
	Mem          int64
	RequiredNode string
	Optedout     AllowPreemptOpted
	Labels       map[string]string
}

type TestJobConfig added in v1.1.0

type TestJobConfig struct {
	JobName     string
	Parallelism int32
	Completions int32
}

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
	PvcName                    string
	PvName                     string
	VolumeName                 string
}

type WorkloadType added in v1.3.0

type WorkloadType string

Jump to

Keyboard shortcuts

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