kubernetes

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

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) CreatePod

func (kc *K8sClientImpl) CreatePod(ctx context.Context, podSpec *executor.PodSpec) (string, error)

CreatePod: Actually create a Kubernetes Pod

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) GetPod

func (kc *K8sClientImpl) GetPod(ctx context.Context, podName string) (*executor.PodInfo, error)

GetPod: Get Pod information

func (*K8sClientImpl) GetPodLogs

func (kc *K8sClientImpl) GetPodLogs(ctx context.Context, podName string) (string, error)

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).

func (*K8sClientImpl) ListPods

func (kc *K8sClientImpl) ListPods(ctx context.Context) ([]*executor.PodInfo, error)

ListPods: List all Pods in namespace

func (*K8sClientImpl) WatchPod

func (kc *K8sClientImpl) WatchPod(ctx context.Context, podName string, callback func(*executor.PodInfo)) error

WatchPod: Watch Pod for status changes

Jump to

Keyboard shortcuts

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