Documentation ¶
Index ¶
- Constants
- Variables
- func BuildClient(kubeconfig string) (*rest.Config, kubernetes.Interface, error)
- func DeletePods(ctx context.Context, kubeClientset kubernetes.Interface, namespace string, ...) (err error)
- func Exec(ctx context.Context, c ContainerRef, command []string, ...) (stdout string, stderr string, err error)
- func GetDeploymentList(ctx context.Context, kubeClientset kubernetes.Interface, ...) (_ []appsv1.Deployment, err error)
- func GetEvents(ctx context.Context, kubeClientset kubernetes.Interface, namespace string) (_ map[string][]*v1.Event, err error)
- func GetPod(ctx context.Context, kubeClientset kubernetes.Interface, ...) (_ *v1.Pod, err error)
- func GetPodEvents(ctx context.Context, kubeClientset kubernetes.Interface, namespace, pod string) (_ []v1.Event, err error)
- func GetPods(ctx context.Context, kubeClientset kubernetes.Interface, ...) (_ []v1.Pod, err error)
- func GetReplicaSets(ctx context.Context, kubeClientset kubernetes.Interface, ...) (_ []appsv1.ReplicaSet, err error)
- type Client
- type ContainerRef
Constants ¶
View Source
const ( EnvK8sClientQPS = "HORIZON_K8S_CLIENT_QPS" EnvK8sClientBurst = "HORIZON_K8S_CLIENT_BURST" )
View Source
const DefaultEventsLimit = 100
Variables ¶
View Source
var ( K8sClientConfigQPS float32 = 50 K8sClientConfigBurst = 100 )
Functions ¶
func BuildClient ¶
func DeletePods ¶
func Exec ¶
func Exec(ctx context.Context, c ContainerRef, command []string, executor exec.RemoteExecutor) (stdout string, stderr string, err error)
func GetDeploymentList ¶
func GetDeploymentList(ctx context.Context, kubeClientset kubernetes.Interface, namespace, labelSelector string) (_ []appsv1.Deployment, err error)
func GetEvents ¶
func GetEvents(ctx context.Context, kubeClientset kubernetes.Interface, namespace string) (_ map[string][]*v1.Event, err error)
GetEvents Returns a map. key is the basic information of Pod, name-uid-namespace
func GetPodEvents ¶
func GetPodEvents(ctx context.Context, kubeClientset kubernetes.Interface, namespace, pod string) (_ []v1.Event, err error)
GetPodEvents returns event list of a pod, notice that it will return events from oldest to latest by DefaultEventsLimit
func GetReplicaSets ¶
func GetReplicaSets(ctx context.Context, kubeClientset kubernetes.Interface, namespace, labelSelector string) (_ []appsv1.ReplicaSet, err error)
Types ¶
type ContainerRef ¶
Click to show internal directories.
Click to hide internal directories.