k8s

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthenticateToCluster

func AuthenticateToCluster(location, kubeConfig string) (*kubernetes.Clientset, error)

AuthenticateToCluster returns a Clientset depending if you are in cluster or out cluster.

func DateFromPodInSecond

func DateFromPodInSecond(pod v1.Pod) float64

Return date in seconds from v1.Pod object.

func TTLFromPod

func TTLFromPod(pod v1.Pod, defaultTTL time.Duration) (time.Duration, error)

Types

type KubernetesClient

type KubernetesClient struct {
	// contains filtered or unexported fields
}

func InitKubernetesClient

func InitKubernetesClient(clientSet kubernetes.Interface) *KubernetesClient

InitKubernetesClient inits a KubernetesClient.

func (KubernetesClient) DeletePod

func (k KubernetesClient) DeletePod(ctx context.Context, namespace, name string) error

DeletePod deletes pods based on namespace & pod's name. Uses foreground deletion policy.

func (KubernetesClient) EvictPod

func (k KubernetesClient) EvictPod(ctx context.Context, namespace, name string) error

EvictPod evicts pods based on namespace & pod's name. Uses foreground deletion policy.

func (KubernetesClient) ListPods

func (k KubernetesClient) ListPods(ctx context.Context, namespace, labelSelector string) ([]v1.Pod, error)

ListPods returns a list of pods corresponding to the parameters you set. Pods are sorted by age in descending order.

Jump to

Keyboard shortcuts

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