Documentation
¶
Index ¶
- Constants
- Variables
- func AddOwnerReferenceToSecret(kc kubernetes.Interface, gvk schema.GroupVersionKind, db LabeledObject, ...) error
- func BackupOrRestoreRunningForDB(KBClient client.Client, stashClient scs.StashV1beta1Interface, ...) (bool, string, error)
- func CheckManifestWorkPodReady(mw *ocmapi.ManifestWork, log *logr.Logger) bool
- func CreateDataMigratorJob(client kubernetes.Interface, jobMeta metav1.ObjectMeta, pvcTemplate string, ...) error
- func CreateDatabasePVC(client kubernetes.Interface, pvcMeta metav1.ObjectMeta, ...) error
- func CreateMigratorPVC(client kubernetes.Interface, pvcMeta metav1.ObjectMeta, ...) error
- func CreatePVCMounterPod(client kubernetes.Interface, dbPod *core.Pod, pvcMounter string) error
- func DBForSecret(certGetter cm_cs.CertificatesGetter, kind string, s *core.Secret) (cache.ExplicitKey, error)
- func DBForService(kind string, s *core.Service) cache.ExplicitKey
- func DBsForClusterIssuer(dc dynamic.Interface, gvr schema.GroupVersionResource, ...) ([]cache.ExplicitKey, error)
- func DBsForIssuer(dc dynamic.Interface, gvr schema.GroupVersionResource, issuer *cm_api.Issuer) ([]cache.ExplicitKey, error)
- func EvictDistributedPod(kbClient client.Client, pp, podName string) (types.UID, error)
- func EvictPod(kClient kubernetes.Interface, podMeta metav1.ObjectMeta) (types.UID, error)
- func ExtractPVCFromManifestWork(kbClient client.Client, pp, podName string) (*core.PersistentVolumeClaim, error)
- func ExtractPodFromManifestWork(kbClient client.Client, pp, podName string) (*core.Pod, error)
- func GetCertificateCondition(conditions []cm_api.CertificateCondition, ...) (int, *cm_api.CertificateCondition)
- func GetDatabasePVCName(pvcTemplate string, podName string) string
- func GetDistributedPodNamespace(kbClient client.Client, ppName, podName string) (string, error)
- func GetIssuerObjectRef(tlsConfig *kmapi.TLSConfig, alias string) cmmeta.ObjectReference
- func GetMigratorPVCName(podName string) string
- func GetPVCMounterPodName(podName string) string
- func GetPodMigrationCompleteCondition(podName string) string
- func GetSecret(kbClient client.Client, namespacedName types.NamespacedName) (*core.Secret, error)
- func GetStorageMigratorJobName(podName string) string
- func HasCertificateCondition(conditions []cm_api.CertificateCondition, ...) bool
- func IsCertificateConditionTrue(conditions []cm_api.CertificateCondition, ...) bool
- func IsJobConditionTrue(conditions []batchv1.JobCondition, condType batchv1.JobConditionType) bool
- func IsOpsTypeSupported(supportedTypes []string, curOpsType string) bool
- func IsServiceReady(getter v1.ServicesGetter, svc metav1.ObjectMeta) bool
- func NewLogger(verbosity int) logr.Logger
- func NewSkipper(kbClient client.Client, kind string, curOps client.Object, ...) skipper
- func ObjectToUnstructured(obj runtime.Object) (*unstructured.Unstructured, error)
- func PauseBackupConfiguration(KBClient client.Client, stashClient scs.StashV1beta1Interface, ...) ([]kmapi.TypedObjectReference, []kmapi.Condition, error)
- func ResumeBackupConfiguration(KBClient client.Client, stashClient scs.StashV1beta1Interface, ...) ([]kmapi.Condition, error)
- func SecretExists(kc kubernetes.Interface, meta metav1.ObjectMeta) bool
- func ServiceDNS(svc metav1.ObjectMeta) []string
- func ServiceHosts(getter v1.ServicesGetter, svc metav1.ObjectMeta) (sets.Set[string], sets.Set[string], error)
- func SetNodeSelector(policy nodemeta.NodeSelectionPolicy, selector map[string]string, ...) map[string]string
- func SetToleration(policy nodemeta.NodeSelectionPolicy, tolerations []core.Toleration, ...) []core.Toleration
- func StorageMigrationAnnotationKey(podName string) string
- func UpdateMachineProfileAnnotation(db, ops map[string]string)
- func UpdateManifestWork(kbClient client.Client, manifestName, namespace string, ...) error
- func UpdatePVCManifestWork(kbClient client.Client, reqResource core.VolumeResourceRequirements, ...) error
- func UpsertCertificateCondition(conditions []cm_api.CertificateCondition, newCond cm_api.CertificateCondition) []cm_api.CertificateCondition
- func ValidateAuthSecret(secret *core.Secret) error
- func ValidateVirtualAuthSecret(secret *vsecretapi.Secret) error
- func VolumeExpansionAnnotationKey(podName string) string
- func WaitForJobToBeCompleted(ctx context.Context, timeOut time.Duration, c kubernetes.Interface, ...) error
- type ConvertFunc
- type LabeledObject
- type MergeFunc
- type ReconfigureMerger
- func (m *ReconfigureMerger) CheckIfAnyOpsRequestIsProgressing() bool
- func (m *ReconfigureMerger) EnsureMergedOpsRequest(mergedOpsRequest opsapi.Accessor, pendingReconfigureOps []opsapi.Accessor) error
- func (m *ReconfigureMerger) FindPendingReconfigureOpsToMerge() (int, []opsapi.Accessor)
- func (m *ReconfigureMerger) GetMergedOpsRequest(firstPendingOps opsapi.Accessor, config any) (*unstructured.Unstructured, error)
- func (m *ReconfigureMerger) Run() (int, error)
Constants ¶
const ( DefaultCertRenewBefore = time.Minute * 5 DefaultAuthRenewBefore = time.Minute * 10 )
const ( MergedOpsSubStr = "-rcfg-merged-" OriginalOpsSkipped = "OriginalOpsSkipped" MergedFromOps = "MergedFromOps" ConfigurationMerged = "ConfigurationMerged" )
const ( ContinueGeneral = iota // 0 MergeNeeded // 1 RequeueNeeded // 2 RequeueNotNeeded // 3 )
const StorageMigrationAnnotationCoreKey = "storagemigration.ops.kubedb.com"
const VolumeExpansionAnnotationCoreKey = "volumeexpansion.ops.kubedb.com"
Variables ¶
var ExcludedFromSkipperLogic = []string{"Reconfigure"} // Skip Reconfigure ops requests - they are handled by ReconfigureMerger
Functions ¶
func AddOwnerReferenceToSecret ¶ added in v0.60.0
func AddOwnerReferenceToSecret(kc kubernetes.Interface, gvk schema.GroupVersionKind, db LabeledObject, secret metav1.ObjectMeta) error
func BackupOrRestoreRunningForDB ¶ added in v0.60.0
func BackupOrRestoreRunningForDB(KBClient client.Client, stashClient scs.StashV1beta1Interface, dbMeta metav1.ObjectMeta, kind string) (bool, string, error)
func CheckManifestWorkPodReady ¶ added in v0.60.0
func CheckManifestWorkPodReady(mw *ocmapi.ManifestWork, log *logr.Logger) bool
Check the Pod ready condition from manifestWork condition feedback.
func CreateDataMigratorJob ¶ added in v0.60.0
func CreateDataMigratorJob(client kubernetes.Interface, jobMeta metav1.ObjectMeta, pvcTemplate string, podName string) error
func CreateDatabasePVC ¶ added in v0.60.0
func CreateDatabasePVC(client kubernetes.Interface, pvcMeta metav1.ObjectMeta, pvc *core.PersistentVolumeClaim, storageClass *string, labels map[string]string) error
func CreateMigratorPVC ¶ added in v0.60.0
func CreateMigratorPVC(client kubernetes.Interface, pvcMeta metav1.ObjectMeta, pvc *core.PersistentVolumeClaim, storageClass *string, owner *metav1.OwnerReference) error
func CreatePVCMounterPod ¶ added in v0.60.0
func DBForSecret ¶ added in v0.60.0
func DBForSecret(certGetter cm_cs.CertificatesGetter, kind string, s *core.Secret) (cache.ExplicitKey, error)
func DBForService ¶ added in v0.60.0
func DBForService(kind string, s *core.Service) cache.ExplicitKey
func DBsForClusterIssuer ¶ added in v0.60.0
func DBsForClusterIssuer(dc dynamic.Interface, gvr schema.GroupVersionResource, clusterIssuer *cm_api.ClusterIssuer) ([]cache.ExplicitKey, error)
func DBsForIssuer ¶ added in v0.60.0
func DBsForIssuer(dc dynamic.Interface, gvr schema.GroupVersionResource, issuer *cm_api.Issuer) ([]cache.ExplicitKey, error)
func EvictDistributedPod ¶ added in v0.60.0
Evict Pod restart the pod by deleting the manifestwork resouces. podMeta.namespace contain the origin namespace of pod rather than the distributed manifest namespace.
func EvictPod ¶ added in v0.60.0
func EvictPod(kClient kubernetes.Interface, podMeta metav1.ObjectMeta) (types.UID, error)
func ExtractPVCFromManifestWork ¶ added in v0.60.0
func ExtractPodFromManifestWork ¶ added in v0.60.0
extractPodFromManifestWork return the pod manifest. podMeta contain the original namespace of the pods.
func GetCertificateCondition ¶ added in v0.60.0
func GetCertificateCondition(conditions []cm_api.CertificateCondition, condType cm_api.CertificateConditionType) (int, *cm_api.CertificateCondition)
func GetDatabasePVCName ¶ added in v0.60.0
func GetDistributedPodNamespace ¶ added in v0.60.0
get the manifestwork namespace for podManifestWork
func GetIssuerObjectRef ¶ added in v0.60.0
func GetIssuerObjectRef(tlsConfig *kmapi.TLSConfig, alias string) cmmeta.ObjectReference
func GetMigratorPVCName ¶ added in v0.60.0
func GetPVCMounterPodName ¶ added in v0.60.0
func GetPodMigrationCompleteCondition ¶ added in v0.60.0
func GetStorageMigratorJobName ¶ added in v0.60.0
func HasCertificateCondition ¶ added in v0.60.0
func HasCertificateCondition(conditions []cm_api.CertificateCondition, condType cm_api.CertificateConditionType) bool
func IsCertificateConditionTrue ¶ added in v0.60.0
func IsCertificateConditionTrue(conditions []cm_api.CertificateCondition, condType cm_api.CertificateConditionType) bool
func IsJobConditionTrue ¶ added in v0.60.0
func IsJobConditionTrue(conditions []batchv1.JobCondition, condType batchv1.JobConditionType) bool
func IsOpsTypeSupported ¶ added in v0.60.0
func IsServiceReady ¶ added in v0.60.0
func IsServiceReady(getter v1.ServicesGetter, svc metav1.ObjectMeta) bool
func NewSkipper ¶ added in v0.60.0
func ObjectToUnstructured ¶ added in v0.60.0
func ObjectToUnstructured(obj runtime.Object) (*unstructured.Unstructured, error)
func PauseBackupConfiguration ¶ added in v0.60.0
func PauseBackupConfiguration(KBClient client.Client, stashClient scs.StashV1beta1Interface, dbMeta metav1.ObjectMeta, pausedBackups []kmapi.TypedObjectReference, kind string, opsGeneration int64) ([]kmapi.TypedObjectReference, []kmapi.Condition, error)
func ResumeBackupConfiguration ¶ added in v0.60.0
func ResumeBackupConfiguration(KBClient client.Client, stashClient scs.StashV1beta1Interface, pausedBackups []kmapi.TypedObjectReference, opsGeneration int64) ([]kmapi.Condition, error)
func SecretExists ¶ added in v0.60.0
func SecretExists(kc kubernetes.Interface, meta metav1.ObjectMeta) bool
func ServiceDNS ¶ added in v0.60.0
func ServiceDNS(svc metav1.ObjectMeta) []string
func ServiceHosts ¶ added in v0.60.0
func SetNodeSelector ¶ added in v0.60.0
func SetToleration ¶ added in v0.60.0
func SetToleration(policy nodemeta.NodeSelectionPolicy, tolerations []core.Toleration, topology *opsapi.Topology) []core.Toleration
func StorageMigrationAnnotationKey ¶ added in v0.60.0
func UpdateMachineProfileAnnotation ¶ added in v0.60.0
func UpdateManifestWork ¶ added in v0.60.0
func UpdatePVCManifestWork ¶ added in v0.60.0
func UpsertCertificateCondition ¶ added in v0.60.0
func UpsertCertificateCondition(conditions []cm_api.CertificateCondition, newCond cm_api.CertificateCondition) []cm_api.CertificateCondition
func ValidateAuthSecret ¶ added in v0.60.0
func ValidateVirtualAuthSecret ¶ added in v0.60.0
func ValidateVirtualAuthSecret(secret *vsecretapi.Secret) error
func VolumeExpansionAnnotationKey ¶ added in v0.60.0
func WaitForJobToBeCompleted ¶ added in v0.60.0
func WaitForJobToBeCompleted(ctx context.Context, timeOut time.Duration, c kubernetes.Interface, meta metav1.ObjectMeta) error
Types ¶
type ConvertFunc ¶ added in v0.60.0
type ConvertFunc func(u *unstructured.Unstructured) (opsapi.Accessor, error)
type LabeledObject ¶ added in v0.60.0
type ReconfigureMerger ¶ added in v0.60.0
type ReconfigureMerger struct {
// contains filtered or unexported fields
}
func NewReconfigureMerger ¶ added in v0.60.0
func (*ReconfigureMerger) CheckIfAnyOpsRequestIsProgressing ¶ added in v0.60.1
func (m *ReconfigureMerger) CheckIfAnyOpsRequestIsProgressing() bool
func (*ReconfigureMerger) EnsureMergedOpsRequest ¶ added in v0.60.0
func (*ReconfigureMerger) FindPendingReconfigureOpsToMerge ¶ added in v0.60.0
func (m *ReconfigureMerger) FindPendingReconfigureOpsToMerge() (int, []opsapi.Accessor)
FindPendingReconfigureOpsToMerge - Check if OriginalOpsSkipped condition is present. - If any Reconfigure is Progressing (other than current), requeue current request - Collect pendingReconfigureOps - Avoid parallel processing by checking if current ops is already part of an existing merge - markAsSkipped is the current ops is already merged into another ops.
func (*ReconfigureMerger) GetMergedOpsRequest ¶ added in v0.60.0
func (m *ReconfigureMerger) GetMergedOpsRequest(firstPendingOps opsapi.Accessor, config any) (*unstructured.Unstructured, error)
func (*ReconfigureMerger) Run ¶ added in v0.60.0
func (m *ReconfigureMerger) Run() (int, error)