Documentation ¶
Index ¶
- func ApplyYamlWithKubectl(path, namespace string) error
- func GetConfigMapObj(yamlPath string) (*v1.ConfigMap, error)
- func GetPodObj(yamlPath string) (*v1.Pod, error)
- func GetSecretObj(yamlPath string) (*v1.Secret, error)
- func ObserveEventAfterAction(c clientset.Interface, ns string, eventPredicate func(*v1.Event) bool, ...) (bool, 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 KubeCtl
- 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) 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) 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) 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) DeleteServiceAccount(accountName string, namespace string) 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) GetEvents(namespace string) (*v1.EventList, error)
- func (k *KubeCtl) GetKubeConfig() (*rest.Config, error)
- func (k *KubeCtl) GetPod(name, namespace string) (*v1.Pod, error)
- func (k *KubeCtl) GetPodNamesFromNS(namespace string) ([]string, error)
- func (k *KubeCtl) GetPods(namespace string) (*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) 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) 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) WaitForPodBySelectorRunning(namespace string, selector string, timeout int) 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 PortForwardAPodRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyYamlWithKubectl ¶
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 ScheduleSuccessEvent ¶
func SetPortForwarder ¶
func SetPortForwarder(req PortForwardAPodRequest, dialer httpstream.Dialer, ports []string) error
Types ¶
type KubeCtl ¶
type KubeCtl struct {
// contains filtered or unexported fields
}
func (*KubeCtl) CreateClusterRoleBinding ¶
func (*KubeCtl) CreateConfigMap ¶
func (*KubeCtl) CreateConfigMaps ¶
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) 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) DeleteNamespace ¶
func (*KubeCtl) DeletePodAnnotation ¶
func (*KubeCtl) DeletePodGracefully ¶
func (*KubeCtl) DeleteServiceAccount ¶
func (*KubeCtl) GetClient ¶
func (k *KubeCtl) GetClient() *kubernetes.Clientset
func (*KubeCtl) GetConfigMap ¶
func (*KubeCtl) GetConfigMaps ¶
func (*KubeCtl) GetPodNamesFromNS ¶
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) 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) TearDownNamespace ¶
func (*KubeCtl) UpdateConfigMap ¶
func (*KubeCtl) UpdateConfigMaps ¶
func (*KubeCtl) UpdatePodWithAnnotation ¶
func (*KubeCtl) UpdateYunikornSchedulerPodAnnotation ¶
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) 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 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{} }