Documentation ¶
Index ¶
- Variables
- func CreateKubeRuntimeClient(config *rest.Config, cluster *pfschema.Cluster) (framework.RuntimeClientInterface, error)
- func GetPodResource(pod *corev1.Pod) *resources.Resource
- func KubeFrameworkVersion(gvk schema.GroupVersionKind) pfschema.FrameworkVersion
- type K3SRuntimeClient
- func (k3s *K3SRuntimeClient) Cluster() string
- func (k3s *K3SRuntimeClient) ClusterID() string
- func (k3s *K3SRuntimeClient) ClusterName() string
- func (k3s *K3SRuntimeClient) Create(resource interface{}, fv pfschema.FrameworkVersion) error
- func (k3s *K3SRuntimeClient) Delete(namespace string, name string, fv pfschema.FrameworkVersion) error
- func (k3s *K3SRuntimeClient) Get(namespace string, name string, fv pfschema.FrameworkVersion) (interface{}, error)
- func (k3s *K3SRuntimeClient) GetJobTypeFramework(fv pfschema.FrameworkVersion) (pfschema.JobType, pfschema.Framework)
- func (k3s *K3SRuntimeClient) GetTaskLog(namespace, name, logFilePosition string, pageSize, pageNo int) ([]pfschema.TaskLogInfo, error)
- func (k3s *K3SRuntimeClient) GetTaskLogV2(namespace, name string, logPage utils.LogPage) ([]pfschema.TaskLogInfo, error)
- func (k3s *K3SRuntimeClient) JobFrameworkVersion(jobType pfschema.JobType, fw pfschema.Framework) pfschema.FrameworkVersion
- func (k3s *K3SRuntimeClient) ListNodeQuota(ctx context.Context) (pfschema.QuotaSummary, []pfschema.NodeQuotaInfo, error)
- func (k3s *K3SRuntimeClient) Patch(namespace, name string, fv pfschema.FrameworkVersion, data []byte) error
- func (k3s *K3SRuntimeClient) RegisterListener(listenerType string, workQueue workqueue.RateLimitingInterface) error
- func (k3s *K3SRuntimeClient) StartListener(listenerType string, stopCh <-chan struct{}) error
- func (k3s *K3SRuntimeClient) Update(resource interface{}, fv pfschema.FrameworkVersion) error
- type KubeRuntimeClient
- func (krc *KubeRuntimeClient) Cluster() string
- func (krc *KubeRuntimeClient) ClusterID() string
- func (krc *KubeRuntimeClient) ClusterName() string
- func (krc *KubeRuntimeClient) Create(resource interface{}, fv pfschema.FrameworkVersion) error
- func (krc *KubeRuntimeClient) Delete(namespace string, name string, fv pfschema.FrameworkVersion) error
- func (krc *KubeRuntimeClient) Get(namespace string, name string, fv pfschema.FrameworkVersion) (interface{}, error)
- func (krc *KubeRuntimeClient) GetGVR(gvk schema.GroupVersionKind) (meta.RESTMapping, error)
- func (krc *KubeRuntimeClient) GetJobTypeFramework(fv pfschema.FrameworkVersion) (pfschema.JobType, pfschema.Framework)
- func (krc *KubeRuntimeClient) GetTaskLog(namespace, name, logFilePosition string, pageSize, pageNo int) ([]pfschema.TaskLogInfo, error)
- func (krc *KubeRuntimeClient) GetTaskLogV2(namespace, name string, logpage utils.LogPage) ([]pfschema.TaskLogInfo, error)
- func (krc *KubeRuntimeClient) JobFrameworkVersion(jobType pfschema.JobType, fw pfschema.Framework) pfschema.FrameworkVersion
- func (krc *KubeRuntimeClient) ListNodeQuota(ctx context.Context) (pfschema.QuotaSummary, []pfschema.NodeQuotaInfo, error)
- func (krc *KubeRuntimeClient) Patch(namespace, name string, fv pfschema.FrameworkVersion, data []byte) error
- func (krc *KubeRuntimeClient) RegisterListener(listenerType string, workQueue workqueue.RateLimitingInterface) error
- func (krc *KubeRuntimeClient) StartListener(listenerType string, stopCh <-chan struct{}) error
- func (krc *KubeRuntimeClient) Update(resource interface{}, fv pfschema.FrameworkVersion) error
- type NodeHandler
- type NodeTaskHandler
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // SyncJobPluginsPeriod defines how often to sync jobPlugins SyncJobPluginsPeriod int = 5 // TaskGVK gvk for task TaskGVK = k8s.PodGVK )
Functions ¶
func CreateKubeRuntimeClient ¶
func KubeFrameworkVersion ¶
func KubeFrameworkVersion(gvk schema.GroupVersionKind) pfschema.FrameworkVersion
Types ¶
type K3SRuntimeClient ¶ added in v0.14.6
type K3SRuntimeClient struct { Client kubernetes.Interface InformerFactory informers.SharedInformerFactory ClusterInfo *pfschema.Cluster // DynamicClient dynamic client DynamicClient dynamic.Interface DynamicFactory dynamicinformer.DynamicSharedInformerFactory Config *rest.Config // JobInformerMap contains GroupVersionKind and informer for different kubernetes job JobInformerMap map[schema.GroupVersionResource]cache.SharedIndexInformer // contains filtered or unexported fields }
func NewFakeK3SRuntimeClient ¶ added in v0.14.6
func NewFakeK3SRuntimeClient(server *httptest.Server) *K3SRuntimeClient
func (*K3SRuntimeClient) Cluster ¶ added in v0.14.6
func (k3s *K3SRuntimeClient) Cluster() string
func (*K3SRuntimeClient) ClusterID ¶ added in v0.14.6
func (k3s *K3SRuntimeClient) ClusterID() string
func (*K3SRuntimeClient) ClusterName ¶ added in v0.14.6
func (k3s *K3SRuntimeClient) ClusterName() string
func (*K3SRuntimeClient) Create ¶ added in v0.14.6
func (k3s *K3SRuntimeClient) Create(resource interface{}, fv pfschema.FrameworkVersion) error
func (*K3SRuntimeClient) Delete ¶ added in v0.14.6
func (k3s *K3SRuntimeClient) Delete(namespace string, name string, fv pfschema.FrameworkVersion) error
func (*K3SRuntimeClient) Get ¶ added in v0.14.6
func (k3s *K3SRuntimeClient) Get(namespace string, name string, fv pfschema.FrameworkVersion) (interface{}, error)
func (*K3SRuntimeClient) GetJobTypeFramework ¶ added in v0.14.6
func (k3s *K3SRuntimeClient) GetJobTypeFramework(fv pfschema.FrameworkVersion) (pfschema.JobType, pfschema.Framework)
func (*K3SRuntimeClient) GetTaskLog ¶ added in v0.14.6
func (k3s *K3SRuntimeClient) GetTaskLog(namespace, name, logFilePosition string, pageSize, pageNo int) ([]pfschema.TaskLogInfo, error)
func (*K3SRuntimeClient) GetTaskLogV2 ¶ added in v0.14.6
func (k3s *K3SRuntimeClient) GetTaskLogV2(namespace, name string, logPage utils.LogPage) ([]pfschema.TaskLogInfo, error)
func (*K3SRuntimeClient) JobFrameworkVersion ¶ added in v0.14.6
func (k3s *K3SRuntimeClient) JobFrameworkVersion(jobType pfschema.JobType, fw pfschema.Framework) pfschema.FrameworkVersion
func (*K3SRuntimeClient) ListNodeQuota ¶ added in v0.14.6
func (k3s *K3SRuntimeClient) ListNodeQuota(ctx context.Context) (pfschema.QuotaSummary, []pfschema.NodeQuotaInfo, error)
ListNodeQuota resource api for cluster nodes
func (*K3SRuntimeClient) Patch ¶ added in v0.14.6
func (k3s *K3SRuntimeClient) Patch(namespace, name string, fv pfschema.FrameworkVersion, data []byte) error
func (*K3SRuntimeClient) RegisterListener ¶ added in v0.14.6
func (k3s *K3SRuntimeClient) RegisterListener(listenerType string, workQueue workqueue.RateLimitingInterface) error
RegisterListener register single job(task) listener
func (*K3SRuntimeClient) StartListener ¶ added in v0.14.6
func (k3s *K3SRuntimeClient) StartListener(listenerType string, stopCh <-chan struct{}) error
func (*K3SRuntimeClient) Update ¶ added in v0.14.6
func (k3s *K3SRuntimeClient) Update(resource interface{}, fv pfschema.FrameworkVersion) error
type KubeRuntimeClient ¶
type KubeRuntimeClient struct { Client kubernetes.Interface InformerFactory informers.SharedInformerFactory // DynamicClient dynamic client DynamicClient dynamic.Interface DynamicFactory dynamicinformer.DynamicSharedInformerFactory // DiscoveryClient client for discovery DiscoveryClient discovery.DiscoveryInterface // TODO: adjust field Config Config *rest.Config ClusterInfo *pfschema.Cluster // GVKToGVR contains GroupVersionKind map to GroupVersionResource GVKToGVR sync.Map // JobInformerMap contains GroupVersionKind and informer for different kubernetes job JobInformerMap map[schema.GroupVersionKind]cache.SharedIndexInformer // QueueInformerMap QueueInformerMap map[schema.GroupVersionKind]cache.SharedIndexInformer // contains filtered or unexported fields }
KubeRuntimeClient for kubernetes client
func NewFakeKubeRuntimeClient ¶
func NewFakeKubeRuntimeClient(server *httptest.Server) *KubeRuntimeClient
func (*KubeRuntimeClient) Cluster ¶
func (krc *KubeRuntimeClient) Cluster() string
func (*KubeRuntimeClient) ClusterID ¶
func (krc *KubeRuntimeClient) ClusterID() string
func (*KubeRuntimeClient) ClusterName ¶ added in v0.14.6
func (krc *KubeRuntimeClient) ClusterName() string
func (*KubeRuntimeClient) Create ¶
func (krc *KubeRuntimeClient) Create(resource interface{}, fv pfschema.FrameworkVersion) error
func (*KubeRuntimeClient) Delete ¶
func (krc *KubeRuntimeClient) Delete(namespace string, name string, fv pfschema.FrameworkVersion) error
func (*KubeRuntimeClient) Get ¶
func (krc *KubeRuntimeClient) Get(namespace string, name string, fv pfschema.FrameworkVersion) (interface{}, error)
func (*KubeRuntimeClient) GetGVR ¶
func (krc *KubeRuntimeClient) GetGVR(gvk schema.GroupVersionKind) (meta.RESTMapping, error)
func (*KubeRuntimeClient) GetJobTypeFramework ¶
func (krc *KubeRuntimeClient) GetJobTypeFramework(fv pfschema.FrameworkVersion) (pfschema.JobType, pfschema.Framework)
func (*KubeRuntimeClient) GetTaskLog ¶
func (krc *KubeRuntimeClient) GetTaskLog(namespace, name, logFilePosition string, pageSize, pageNo int) ([]pfschema.TaskLogInfo, error)
func (*KubeRuntimeClient) GetTaskLogV2 ¶ added in v0.14.6
func (krc *KubeRuntimeClient) GetTaskLogV2(namespace, name string, logpage utils.LogPage) ([]pfschema.TaskLogInfo, error)
GetTaskLogV2 using lineLimit and sizeLimit to paging logs
func (*KubeRuntimeClient) JobFrameworkVersion ¶
func (krc *KubeRuntimeClient) JobFrameworkVersion(jobType pfschema.JobType, fw pfschema.Framework) pfschema.FrameworkVersion
func (*KubeRuntimeClient) ListNodeQuota ¶
func (krc *KubeRuntimeClient) ListNodeQuota(ctx context.Context) (pfschema.QuotaSummary, []pfschema.NodeQuotaInfo, error)
func (*KubeRuntimeClient) Patch ¶
func (krc *KubeRuntimeClient) Patch(namespace, name string, fv pfschema.FrameworkVersion, data []byte) error
func (*KubeRuntimeClient) RegisterListener ¶
func (krc *KubeRuntimeClient) RegisterListener(listenerType string, workQueue workqueue.RateLimitingInterface) error
func (*KubeRuntimeClient) StartListener ¶
func (krc *KubeRuntimeClient) StartListener(listenerType string, stopCh <-chan struct{}) error
func (*KubeRuntimeClient) Update ¶
func (krc *KubeRuntimeClient) Update(resource interface{}, fv pfschema.FrameworkVersion) error
type NodeHandler ¶ added in v0.14.6
type NodeHandler struct {
// contains filtered or unexported fields
}
func NewNodeHandler ¶ added in v0.14.6
func NewNodeHandler(q workqueue.RateLimitingInterface, cluster string) *NodeHandler
func (*NodeHandler) AddNode ¶ added in v0.14.6
func (n *NodeHandler) AddNode(obj interface{})
func (*NodeHandler) DeleteNode ¶ added in v0.14.6
func (n *NodeHandler) DeleteNode(obj interface{})
func (*NodeHandler) UpdateNode ¶ added in v0.14.6
func (n *NodeHandler) UpdateNode(old, new interface{})
type NodeTaskHandler ¶ added in v0.14.6
type NodeTaskHandler struct {
// contains filtered or unexported fields
}
func NewNodeTaskHandler ¶ added in v0.14.6
func NewNodeTaskHandler(q workqueue.RateLimitingInterface, cluster string) *NodeTaskHandler
func (*NodeTaskHandler) AddPod ¶ added in v0.14.6
func (n *NodeTaskHandler) AddPod(obj interface{})
func (*NodeTaskHandler) DeletePod ¶ added in v0.14.6
func (n *NodeTaskHandler) DeletePod(obj interface{})
func (*NodeTaskHandler) UpdatePod ¶ added in v0.14.6
func (n *NodeTaskHandler) UpdatePod(old, new interface{})
Click to show internal directories.
Click to hide internal directories.