kube

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInitializedNotReady = errors.New("pod initialized not ready")
	ErrContainerCreating   = errors.New("target container is creating")
)

Functions

func CheckRBAC added in v1.6.0

func CheckRBAC(ctx context.Context, c client.Client, namespace string) error

func GetPodLog added in v1.8.0

func GetPodLog(ctx context.Context, client kubernetes.Interface, namespace, jobName, targetContainer string) (string, error)

func HasFinalizer added in v1.8.0

func HasFinalizer(obj client.Object, finalizer string) bool

func UpdateFinalizer added in v1.8.0

func UpdateFinalizer(ctx context.Context, c client.Client, object client.Object, op FinalizerOpType, finalizer string) error

func ValidVersion added in v1.8.0

func ValidVersion(ver *version.Info) (bool, error)

Types

type BackupUpdateStatus added in v1.8.0

type BackupUpdateStatus struct {
	Type          v1alpha1.BackupType
	BackupName    *string
	TimeStarted   *metav1.Time
	TimeCompleted *metav1.Time
	ConditionType v1alpha1.BackupConditionType
}

type ClientSet

type ClientSet interface {
	Node() Node
	Secret() Secret
	ConfigMap() ConfigMap
	PV() PersistentVolume
	PVC() PersistentVolumeClaim
	Pod() Pod
	Service() Service
	Ingress() Ingress
	Workload() Workload
	Deployment() Deployment
	Job() Job
	NebulaCluster() NebulaCluster
	NebulaBackup() NebulaBackup
	NebulaCronBackup() NebulaCronBackup
	NebulaRestore() NebulaRestore
	NebulaAutoscaler() NebulaAutoscaler
}

func NewClientSet

func NewClientSet(config *rest.Config) (ClientSet, error)

type ConfigMap

type ConfigMap interface {
	CreateOrUpdateConfigMap(cm *corev1.ConfigMap) error
	GetConfigMap(namespace, cmName string) (*corev1.ConfigMap, error)
	DeleteConfigMap(namespace, cmName string) error
}

func NewConfigMap

func NewConfigMap(kubecli client.Client) ConfigMap

type Deployment added in v1.4.1

type Deployment interface {
	CreateDeployment(deploy *appsv1.Deployment) error
	GetDeployment(namespace string, name string) (*appsv1.Deployment, error)
	UpdateDeployment(deploy *appsv1.Deployment) error
	DeleteDeployment(deploy *appsv1.Deployment) error
}

func NewDeployment added in v1.4.1

func NewDeployment(kubecli client.Client) Deployment

type FakeNebulaCluster

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

func (*FakeNebulaCluster) CreateNebulaCluster added in v1.4.0

func (f *FakeNebulaCluster) CreateNebulaCluster(_ *v1alpha1.NebulaCluster) error

func (*FakeNebulaCluster) DeleteNebulaCluster added in v1.4.0

func (f *FakeNebulaCluster) DeleteNebulaCluster(_, _ string) error

func (*FakeNebulaCluster) GetNebulaCluster

func (f *FakeNebulaCluster) GetNebulaCluster(_, _ string) (*v1alpha1.NebulaCluster, error)

func (*FakeNebulaCluster) UpdateNebulaCluster added in v0.9.0

func (f *FakeNebulaCluster) UpdateNebulaCluster(_ *v1alpha1.NebulaCluster) error

func (*FakeNebulaCluster) UpdateNebulaClusterStatus

func (f *FakeNebulaCluster) UpdateNebulaClusterStatus(_ *v1alpha1.NebulaCluster) error

type FinalizerOpType added in v1.8.0

type FinalizerOpType string
const (
	AddFinalizerOpType    FinalizerOpType = "Add"
	RemoveFinalizerOpType FinalizerOpType = "Remove"
)

type Ingress added in v0.9.0

type Ingress interface {
	CreateOrUpdateIngress(ingress *networkingv1.Ingress) error
	GetIngress(namespace, ingressName string) (*networkingv1.Ingress, error)
	DeleteIngress(namespace, ingressName string) error
}

func NewIngress added in v0.9.0

func NewIngress(kubecli client.Client) Ingress

type Job added in v1.8.0

type Job interface {
	GetJob(namespace string, name string) (*batchv1.Job, error)
	CreateJob(job *batchv1.Job) error
	DeleteJob(namespace string, name string) error
}

func NewJob added in v1.8.0

func NewJob(client client.Client) Job

type NebulaAutoscaler added in v1.7.0

type NebulaAutoscaler interface {
	GetNebulaAutoscaler(namespace, name string) (*v1alpha1.NebulaAutoscaler, error)
	UpdateNebulaAutoscalerStatus(na *v1alpha1.NebulaAutoscaler) error
}

func NewNebulaAutoscaler added in v1.7.0

func NewNebulaAutoscaler(client client.Client) NebulaAutoscaler

type NebulaBackup added in v1.8.0

type NebulaBackup interface {
	CreateNebulaBackup(backup *v1alpha1.NebulaBackup) error
	GetNebulaBackup(namespace, name string) (*v1alpha1.NebulaBackup, error)
	ListNebulaBackups(namespace string, selector labels.Selector) ([]v1alpha1.NebulaBackup, error)
	UpdateNebulaBackup(backup *v1alpha1.NebulaBackup) error
	UpdateNebulaBackupStatus(backup *v1alpha1.NebulaBackup, condition *v1alpha1.BackupCondition, newStatus *BackupUpdateStatus) error
	DeleteNebulaBackup(namespace, name string) error
}

func NewNebulaBackup added in v1.8.0

func NewNebulaBackup(client client.Client) NebulaBackup

type NebulaCluster

type NebulaCluster interface {
	CreateNebulaCluster(nc *v1alpha1.NebulaCluster) error
	GetNebulaCluster(namespace, name string) (*v1alpha1.NebulaCluster, error)
	UpdateNebulaCluster(nc *v1alpha1.NebulaCluster) error
	UpdateNebulaClusterStatus(nc *v1alpha1.NebulaCluster) error
	DeleteNebulaCluster(namespace, name string) error
}

func NewFakeNebulaCluster

func NewFakeNebulaCluster(client client.Client) NebulaCluster

func NewNebulaCluster

func NewNebulaCluster(client client.Client) NebulaCluster

type NebulaCronBackup added in v1.8.0

type NebulaCronBackup interface {
	GetCronBackup(namespace, name string) (*v1alpha1.NebulaCronBackup, error)
	UpdateCronBackupStatus(cronBackup *v1alpha1.NebulaCronBackup) error
}

func NewCronNebulaBackup added in v1.8.0

func NewCronNebulaBackup(client client.Client) NebulaCronBackup

type NebulaRestore added in v1.4.0

type NebulaRestore interface {
	GetNebulaRestore(namespace, name string) (*v1alpha1.NebulaRestore, error)
	UpdateNebulaRestoreStatus(restore *v1alpha1.NebulaRestore, condition *v1alpha1.RestoreCondition, newStatus *RestoreUpdateStatus) error
}

func NewNebulaRestore added in v1.4.0

func NewNebulaRestore(client client.Client) NebulaRestore

type Node added in v1.6.0

type Node interface {
	GetNode(nodeName string) (*corev1.Node, error)
}

func NewNode added in v1.6.0

func NewNode(kubecli client.Client) Node

type PersistentVolume

type PersistentVolume interface {
	CreatePersistentVolume(pv *corev1.PersistentVolume) error
	GetPersistentVolume(name string) (*corev1.PersistentVolume, error)
	PatchPVReclaimPolicy(pv *corev1.PersistentVolume, policy corev1.PersistentVolumeReclaimPolicy) error
	UpdateMetaInfo(obj runtime.Object, pv *corev1.PersistentVolume) error
	UpdatePersistentVolume(pv *corev1.PersistentVolume) error
}

func NewPV

func NewPV(kubecli client.Client) PersistentVolume

type PersistentVolumeClaim

type PersistentVolumeClaim interface {
	CreatePVC(pvc *corev1.PersistentVolumeClaim) error
	GetPVC(namespace, name string) (*corev1.PersistentVolumeClaim, error)
	UpdateMetaInfo(pvc *corev1.PersistentVolumeClaim, pod *corev1.Pod, isReclaimEnabled bool) error
	UpdatePVC(pvc *corev1.PersistentVolumeClaim) error
	DeletePVC(namespace string, name string) error
	ListPVCs(namespace string, selector labels.Selector) ([]corev1.PersistentVolumeClaim, error)
}

func NewPVC

func NewPVC(kubecli client.Client) PersistentVolumeClaim

type Pod

type Pod interface {
	GetPod(namespace string, name string) (*corev1.Pod, error)
	CreatePod(pod *corev1.Pod) error
	UpdatePod(pod *corev1.Pod) error
	DeletePod(namespace string, name string, nonGraceful bool) error
	ListPods(namespace string, selector labels.Selector) ([]corev1.Pod, error)
}

func NewPod

func NewPod(kubecli client.Client) Pod

type RestoreUpdateStatus added in v1.4.0

type RestoreUpdateStatus struct {
	TimeStarted     *metav1.Time
	TimeCompleted   *metav1.Time
	ClusterName     *string
	ConditionType   v1alpha1.RestoreConditionType
	Partitions      map[string][]*nebula.HostAddr
	Checkpoints     map[string]map[string]string
	MetaDownload    bool
	StorageDownload bool
}

type Secret added in v1.4.0

type Secret interface {
	GetSecret(namespace, secretName string) (*corev1.Secret, error)
}

func NewSecret added in v1.4.0

func NewSecret(kubecli client.Client) Secret

type Service

type Service interface {
	CreateService(service *corev1.Service) error
	GetService(namespace string, name string) (*corev1.Service, error)
	UpdateService(service *corev1.Service) error
	DeleteService(namespace string, name string) error
}

func NewService

func NewService(kubecli client.Client) Service

type Workload

type Workload interface {
	GetWorkload(namespace string, name string, gvk schema.GroupVersionKind) (*unstructured.Unstructured, error)
	CreateWorkload(obj *unstructured.Unstructured) error
	UpdateWorkload(obj *unstructured.Unstructured) error
	DeleteWorkload(obj *unstructured.Unstructured) error
}

func NewWorkload

func NewWorkload(kubecli client.Client) Workload

Jump to

Keyboard shortcuts

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