k8s

package
v0.0.0-...-21a76b1 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2023 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 3 more Imports: 26 Imported by: 0

Documentation

Overview

Package k8s contains k8s API versions.

Package k8s provides common functions for k8s controllers.

Package k8s contains controllers for k8s API group k8s.v6d.io

Package k8s contains k8s API versions.

Package k8s contains k8s API versions.

Package k8s contains all controllers in the vineyard operator.

Index

Constants

View Source
const (
	// SucceedState is the succeed state
	SucceedState = "Succeed"
	// RunningState is the running state
	RunningState = "Running"
)

Variables

This section is empty.

Functions

func ApplyStatueUpdate

func ApplyStatueUpdate[Obj client.Object](ctx context.Context, c client.Client,
	o Obj, w client.StatusWriter, overlayObj func(Obj) (error, Obj)) error

ApplyStatueUpdate applies the status update to the object.

func GenerateRandomName

func GenerateRandomName(length int) string

func GetObjectMappingTable

func GetObjectMappingTable(c client.Client, clientset kubernetes.Clientset,
	jobName, jobNamespace string) (map[string]string, error)

Types

type BackupConfig

type BackupConfig struct {
	Name      string
	ObjectIDs string
	FailoverConfig
}

BackupConfig holds all configuration about backup

type BackupOpts

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

BackupOpts holds all options of backup config

func NewBackupOpts

func NewBackupOpts(name, pvcName, path string) *BackupOpts

func (*BackupOpts) BuildCfgForController

func (opts *BackupOpts) BuildCfgForController(c client.Client, backup *k8sv1alpha1.Backup) (BackupConfig, error)

func (*BackupOpts) BuildCfgForVineyarctl

func (opts *BackupOpts) BuildCfgForVineyarctl(c client.Client, backup *k8sv1alpha1.Backup) (BackupConfig, error)

type BackupReconciler

type BackupReconciler struct {
	client.Client
	record.EventRecorder
	Scheme *runtime.Scheme
}

BackupReconciler reconciles a Backup object

func (*BackupReconciler) Reconcile

func (r *BackupReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile reconciles the Backup.

func (*BackupReconciler) SetupWithManager

func (r *BackupReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

func (*BackupReconciler) UpdateStatus

func (r *BackupReconciler) UpdateStatus(ctx context.Context, backup *k8sv1alpha1.Backup) error

UpdateStatus updates the status of the Backup.Running

type CSIDriverReconciler

type CSIDriverReconciler struct {
	client.Client
	record.EventRecorder
	Scheme *runtime.Scheme
}

CSIDriverReconciler reconciles a CSIDriver object

func (*CSIDriverReconciler) Reconcile

func (r *CSIDriverReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*CSIDriverReconciler) SetupWithManager

func (r *CSIDriverReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

func (*CSIDriverReconciler) UpdateStatus

func (r *CSIDriverReconciler) UpdateStatus(ctx context.Context, csiDriver *k8sv1alpha1.CSIDriver) error

type EtcdConfig

type EtcdConfig struct {
	Name      string
	Namespace string
	Rank      int
	Endpoints string
	Image     string
}

EtcdConfig holds all configuration about etcd

func NewEtcdConfig

func NewEtcdConfig(name string, namespace string,
	replicas int, image string,
) EtcdConfig

NewEtcdConfig builds the etcd config.

type FailoverConfig

type FailoverConfig struct {
	Namespace          string
	Replicas           int
	Path               string
	VineyarddNamespace string
	VineyarddName      string
	Endpoint           string
	VineyardSockPath   string
	AllInstances       string
	PVCName            string
	WithScheduler      bool
}

FailoverConfig contains the common configuration about backup and recover

type GlobalObjectReconciler

type GlobalObjectReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

GlobalObjectReconciler reconciles a GlobalObject object

func (*GlobalObjectReconciler) Reconcile

func (r *GlobalObjectReconciler) Reconcile(
	ctx context.Context,
	req ctrl.Request,
) (ctrl.Result, error)

func (*GlobalObjectReconciler) SetupWithManager

func (r *GlobalObjectReconciler) SetupWithManager(mgr ctrl.Manager) error

type LocalObjectReconciler

type LocalObjectReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

LocalObjectReconciler reconciles a LocalObject object

func (*LocalObjectReconciler) Reconcile

func (r *LocalObjectReconciler) Reconcile(
	ctx context.Context,
	req ctrl.Request,
) (ctrl.Result, error)

func (*LocalObjectReconciler) SetupWithManager

func (r *LocalObjectReconciler) SetupWithManager(mgr ctrl.Manager) error

type OperationReconciler

type OperationReconciler struct {
	client.Client
	*kubernetes.Clientset
	record.EventRecorder
	Scheme *runtime.Scheme
}

OperationReconciler reconciles a Operation object

func (*OperationReconciler) Reconcile

func (r *OperationReconciler) Reconcile(
	ctx context.Context,
	req ctrl.Request,
) (ctrl.Result, error)

Reconcile reconciles the operation

func (*OperationReconciler) SetupWithManager

func (r *OperationReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

func (*OperationReconciler) UpdateStatus

func (r *OperationReconciler) UpdateStatus(
	ctx context.Context,
	op *v1alpha1.Operation,
	opDone bool,
) error

UpdateStatus updates the status of the localobject

type RecoverConfig

type RecoverConfig struct {
	Name string
	FailoverConfig
}

RecoverConfig holds all configuration about recover

type RecoverOpts

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

RecoverOpts holds all options of recover config

func NewRecoverOpts

func NewRecoverOpts(name, pvcName, path string) RecoverOpts

func (RecoverOpts) BuildCfgForController

func (opts RecoverOpts) BuildCfgForController(c client.Client, backup *k8sv1alpha1.Backup) (RecoverConfig, error)

func (RecoverOpts) BuildCfgForVineyarctl

func (opts RecoverOpts) BuildCfgForVineyarctl(c client.Client, backup *k8sv1alpha1.Backup) (RecoverConfig, error)

type RecoverReconciler

type RecoverReconciler struct {
	client.Client
	*kubernetes.Clientset
	Scheme *runtime.Scheme
}

RecoverReconciler reconciles a Recover object

func (*RecoverReconciler) Reconcile

func (r *RecoverReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile reconciles the Recover.

func (*RecoverReconciler) SetupWithManager

func (r *RecoverReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

func (*RecoverReconciler) UpdateMappingStatus

func (r *RecoverReconciler) UpdateMappingStatus(
	ctx context.Context,
	backup *k8sv1alpha1.Backup,
	recover *k8sv1alpha1.Recover,
) error

UpdateMappingStatus updates the mapping status of the Recover.

func (*RecoverReconciler) UpdateStateStatus

func (r *RecoverReconciler) UpdateStateStatus(
	ctx context.Context,
	backup *k8sv1alpha1.Backup,
	recover *k8sv1alpha1.Recover,
) error

UpdateStateStatus updates the state status of the Recover.

type SidecarReconciler

type SidecarReconciler struct {
	client.Client
	record.EventRecorder
	Scheme *runtime.Scheme
}

SidecarReconciler reconciles a Sidecar object

func (*SidecarReconciler) Reconcile

func (r *SidecarReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile the sidecar.

func (*SidecarReconciler) SetupWithManager

func (r *SidecarReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

func (*SidecarReconciler) UpdateStatus

func (r *SidecarReconciler) UpdateStatus(ctx context.Context, sidecar *k8sv1alpha1.Sidecar) error

UpdateStatus updates the status of the Sidecar.

type StorageConfig

type StorageConfig struct {
	Namespace         string
	Name              string
	VolumeBindingMode string
}

type VineyarddReconciler

type VineyarddReconciler struct {
	client.Client
	record.EventRecorder
	Scheme *runtime.Scheme
}

VineyarddReconciler reconciles a Vineyardd object

func (*VineyarddReconciler) Reconcile

func (r *VineyarddReconciler) Reconcile(
	ctx context.Context,
	req ctrl.Request,
) (ctrl.Result, error)

Reconcile reconciles the Vineyardd.

func (*VineyarddReconciler) SetupWithManager

func (r *VineyarddReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

func (*VineyarddReconciler) UpdateStatus

func (r *VineyarddReconciler) UpdateStatus(
	ctx context.Context,
	vineyardd *k8sv1alpha1.Vineyardd,
) error

UpdateStatus updates the status of the Vineyardd.

Jump to

Keyboard shortcuts

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