k8sclient

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type K8sClient

type K8sClient struct {
	kubernetes.Interface
	// contains filtered or unexported fields
}

func NewClient

func NewClient() (*K8sClient, error)

func NewClientWithConfig added in v0.25.0

func NewClientWithConfig(config *rest.Config) (*K8sClient, error)

func (*K8sClient) CreateEvent added in v0.25.0

func (k *K8sClient) CreateEvent(ctx context.Context, pod corev1.Pod, evtType, reason, message string) error

func (*K8sClient) CreateJob

func (k *K8sClient) CreateJob(ctx context.Context, job *batchv1.Job) (*batchv1.Job, error)

func (*K8sClient) CreatePod

func (k *K8sClient) CreatePod(ctx context.Context, pod *corev1.Pod) (*corev1.Pod, error)

func (*K8sClient) CreateSecret

func (k *K8sClient) CreateSecret(ctx context.Context, secret *corev1.Secret) (*corev1.Secret, error)

func (*K8sClient) DeleteJob

func (k *K8sClient) DeleteJob(ctx context.Context, jobName string, namespace string) error

func (*K8sClient) DeletePod

func (k *K8sClient) DeletePod(ctx context.Context, pod *corev1.Pod) error

func (*K8sClient) DeleteSecret

func (k *K8sClient) DeleteSecret(ctx context.Context, secretName string, namespace string) error

func (*K8sClient) ExecuteInContainer added in v0.18.0

func (k *K8sClient) ExecuteInContainer(ctx context.Context, podName, namespace, containerName string, cmd []string) (stdout string, stderr string, err error)

func (*K8sClient) GetConfigMap added in v0.25.0

func (k *K8sClient) GetConfigMap(ctx context.Context, cmName, namespace string) (*corev1.ConfigMap, error)

func (*K8sClient) GetDaemonSet added in v0.19.0

func (k *K8sClient) GetDaemonSet(ctx context.Context, dsName, namespace string) (*appsv1.DaemonSet, error)

func (*K8sClient) GetJob

func (k *K8sClient) GetJob(ctx context.Context, jobName, namespace string) (*batchv1.Job, error)

func (*K8sClient) GetPersistentVolume

func (k *K8sClient) GetPersistentVolume(ctx context.Context, pvName string) (*corev1.PersistentVolume, error)

func (*K8sClient) GetPersistentVolumeClaim added in v0.18.0

func (k *K8sClient) GetPersistentVolumeClaim(ctx context.Context, pvcName, namespace string) (*corev1.PersistentVolumeClaim, error)

func (*K8sClient) GetPod

func (k *K8sClient) GetPod(ctx context.Context, podName, namespace string) (*corev1.Pod, error)

func (*K8sClient) GetPodLog

func (k *K8sClient) GetPodLog(ctx context.Context, podName, namespace, containerName string) (string, error)

func (*K8sClient) GetReplicaSet added in v0.20.0

func (k *K8sClient) GetReplicaSet(ctx context.Context, rsName, namespace string) (*appsv1.ReplicaSet, error)

func (*K8sClient) GetSecret

func (k *K8sClient) GetSecret(ctx context.Context, secretName, namespace string) (*corev1.Secret, error)

func (*K8sClient) GetStatefulSet added in v0.20.0

func (k *K8sClient) GetStatefulSet(ctx context.Context, stsName, namespace string) (*appsv1.StatefulSet, error)

func (*K8sClient) GetStorageClass added in v0.18.0

func (k *K8sClient) GetStorageClass(ctx context.Context, scName string) (*storagev1.StorageClass, error)

func (*K8sClient) ListNode added in v0.23.0

func (k *K8sClient) ListNode(ctx context.Context, labelSelector *metav1.LabelSelector) ([]corev1.Node, error)

func (*K8sClient) ListPersistentVolumes added in v0.18.0

func (k *K8sClient) ListPersistentVolumes(ctx context.Context, labelSelector *metav1.LabelSelector, filedSelector *fields.Set) ([]corev1.PersistentVolume, error)

func (*K8sClient) ListPersistentVolumesByVolumeHandle added in v0.23.6

func (k *K8sClient) ListPersistentVolumesByVolumeHandle(ctx context.Context, volumeHandle string) ([]corev1.PersistentVolume, error)

func (*K8sClient) ListPod

func (k *K8sClient) ListPod(ctx context.Context, namespace string, labelSelector *metav1.LabelSelector, filedSelector *fields.Set) ([]corev1.Pod, error)

func (*K8sClient) ListStorageClasses added in v0.23.0

func (k *K8sClient) ListStorageClasses(ctx context.Context) ([]storagev1.StorageClass, error)

func (*K8sClient) PatchPod

func (k *K8sClient) PatchPod(ctx context.Context, pod *corev1.Pod, data []byte, pt types.PatchType) error

func (*K8sClient) PatchSecret added in v0.22.0

func (k *K8sClient) PatchSecret(ctx context.Context, secret *corev1.Secret, data []byte, pt types.PatchType) error

func (*K8sClient) UpdateJob

func (k *K8sClient) UpdateJob(ctx context.Context, job *batchv1.Job) error

func (*K8sClient) UpdatePod

func (k *K8sClient) UpdatePod(ctx context.Context, pod *corev1.Pod) error

func (*K8sClient) UpdateSecret

func (k *K8sClient) UpdateSecret(ctx context.Context, secret *corev1.Secret) error

type KubeletClient added in v0.21.0

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

func NewKubeletClient added in v0.21.0

func NewKubeletClient(host string, port int) (*KubeletClient, error)

func (*KubeletClient) GetNodeRunningPods added in v0.21.0

func (kc *KubeletClient) GetNodeRunningPods() (*corev1.PodList, error)

type KubeletClientConfig added in v0.21.0

type KubeletClientConfig struct {
	// Address specifies the kubelet address
	Address string

	// Port specifies the default port - used if no information about Kubelet port can be found in Node.NodeStatus.DaemonEndpoints.
	Port int

	// TLSClientConfig contains settings to enable transport layer security
	restclient.TLSClientConfig

	// Server requires Bearer authentication
	BearerToken string

	// HTTPTimeout is used by the client to timeout http requests to Kubelet.
	HTTPTimeout time.Duration
}

KubeletClientConfig defines config parameters for the kubelet client

type PatchDelValue added in v0.17.4

type PatchDelValue struct {
	Op   string `json:"op"`
	Path string `json:"path"`
}

type PatchListValue

type PatchListValue struct {
	Op    string   `json:"op"`
	Path  string   `json:"path"`
	Value []string `json:"value"`
}

type PatchMapValue

type PatchMapValue struct {
	Op    string            `json:"op"`
	Path  string            `json:"path"`
	Value map[string]string `json:"value"`
}

type PatchStringValue added in v0.17.4

type PatchStringValue struct {
	Op    string `json:"op"`
	Path  string `json:"path"`
	Value string `json:"value"`
}

Jump to

Keyboard shortcuts

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