Documentation
¶
Index ¶
- type K8sClientImpl
- func (kc *K8sClientImpl) CreatePod(ctx context.Context, podSpec *executor.PodSpec) (string, error)
- func (kc *K8sClientImpl) DeletePod(ctx context.Context, podName string, gracePeriodSeconds int64) error
- func (kc *K8sClientImpl) GetKubernetesInterface() k8sClient.Interface
- func (kc *K8sClientImpl) GetPod(ctx context.Context, podName string) (*executor.PodInfo, error)
- func (kc *K8sClientImpl) GetPodLogs(ctx context.Context, podName string) (string, error)
- func (kc *K8sClientImpl) GetPodMetrics(ctx context.Context, podName string) (map[string]interface{}, error)
- func (kc *K8sClientImpl) ListPods(ctx context.Context) ([]*executor.PodInfo, error)
- func (kc *K8sClientImpl) WatchPod(ctx context.Context, podName string, callback func(*executor.PodInfo)) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type K8sClientImpl ¶
type K8sClientImpl struct {
// contains filtered or unexported fields
}
func NewK8sClient ¶
func NewK8sClient(namespace string) (*K8sClientImpl, error)
NewK8sClient: Create real K8s client (in-cluster or kubeconfig) ✅ ENHANCED: Now exposes both custom interface and real k8s.io client
func (*K8sClientImpl) DeletePod ¶
func (kc *K8sClientImpl) DeletePod(ctx context.Context, podName string, gracePeriodSeconds int64) error
DeletePod: Delete a Pod
func (*K8sClientImpl) GetKubernetesInterface ¶
func (kc *K8sClientImpl) GetKubernetesInterface() k8sClient.Interface
✅ NEW: GetKubernetesInterface() - Expose real k8s.io client This allows gpu_discovery and other components to use the standard client
Usage in gpu_discovery:
k8sClientInterface := executor.GetKubernetesInterface() gpuDiscovery := gpu.NewGPUDiscoveryWithK8s(redisClient, k8sClientInterface, nodeName)
Usage in main.go:
k8sClientInterface := executor.GetKubernetesInterface() gpuDiscovery := gpu.NewGPUDiscoveryWithK8s(redisClient, k8sClientInterface, nodeName)
func (*K8sClientImpl) GetPodLogs ¶
GetPodLogs: Get logs from Pod
func (*K8sClientImpl) GetPodMetrics ¶
func (kc *K8sClientImpl) GetPodMetrics(ctx context.Context, podName string) (map[string]interface{}, error)
GetPodMetrics queries the metrics-server for pod resource usage (CPU, memory). Returns empty map if metrics-server is unavailable (graceful degradation).
Click to show internal directories.
Click to hide internal directories.