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
- func ApplyStatueUpdate[Obj client.Object](ctx context.Context, c client.Client, o Obj, w client.StatusWriter, ...) error
- func GenerateRandomName(length int) string
- func GetObjectMappingTable(c client.Client, clientset kubernetes.Clientset, jobName, jobNamespace string) (map[string]string, error)
- type BackupConfig
- type BackupOpts
- type BackupReconciler
- type CSIDriverReconciler
- type EtcdConfig
- type FailoverConfig
- type GlobalObjectReconciler
- type LocalObjectReconciler
- type OperationReconciler
- type RecoverConfig
- type RecoverOpts
- type RecoverReconciler
- func (r *RecoverReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *RecoverReconciler) SetupWithManager(mgr ctrl.Manager) error
- func (r *RecoverReconciler) UpdateMappingStatus(ctx context.Context, backup *k8sv1alpha1.Backup, recover *k8sv1alpha1.Recover) error
- func (r *RecoverReconciler) UpdateStateStatus(ctx context.Context, backup *k8sv1alpha1.Backup, recover *k8sv1alpha1.Recover) error
- type SidecarReconciler
- type StorageConfig
- type VineyarddReconciler
Constants ¶
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 GetObjectMappingTable ¶
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 ¶
BackupReconciler reconciles a Backup object
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 ¶
CSIDriverReconciler reconciles a CSIDriver object
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 ¶
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 ¶
GlobalObjectReconciler reconciles a GlobalObject object
func (*GlobalObjectReconciler) SetupWithManager ¶
func (r *GlobalObjectReconciler) SetupWithManager(mgr ctrl.Manager) error
type LocalObjectReconciler ¶
LocalObjectReconciler reconciles a LocalObject object
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 ¶
RecoverReconciler reconciles a Recover object
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 ¶
SidecarReconciler reconciles a Sidecar object
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 VineyarddReconciler ¶
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.