Documentation
¶
Index ¶
- Constants
- Variables
- func DeploymentReady(status appsv1.DeploymentStatus) bool
- func ExecKillIfTerminating(ctx context.Context, podList *corev1.PodList) error
- func GetAzureStorageAccount(conf map[string]interface{}) string
- func GetCondition(getter func() v1beta1.MilvusCondition, eps []string) v1beta1.MilvusCondition
- func GetConditionStatus(b bool) corev1.ConditionStatus
- func GetConfCheckSum(spec v1beta1.MilvusSpec) string
- func GetContainerIndex(containers []corev1.Container, name string) int
- func GetContainerMessage(status corev1.ContainerStatus) string
- func GetDefaultLivenessProbe() *corev1.Probe
- func GetDefaultReadinessProbe() *corev1.Probe
- func GetDefaultStartupProbe() *corev1.Probe
- func GetDeploymentConditionByType(conditions []appsv1.DeploymentCondition, t appsv1.DeploymentConditionType) appsv1.DeploymentCondition
- func GetDeploymentFalseCondition(deploy appsv1.Deployment) (*appsv1.DeploymentCondition, error)
- func GetDeploymentGroupId(deploy *appsv1.Deployment) (int, error)
- func GetDeploymentStrategy(milvus *v1beta1.Milvus, component MilvusComponent) appsv1.DeploymentStrategy
- func GetEndpointsHealth(ctx context.Context, authConfig EtcdAuthConfig, endpoints []string) map[string]EtcdEndPointHealth
- func GetEtcdCondition(ctx context.Context, authCfg EtcdAuthConfig, endpoints []string) v1beta1.MilvusCondition
- func GetKafkaCondition(ctx context.Context, logger logr.Logger, p v1beta1.MilvusKafka, ...) v1beta1.MilvusCondition
- func GetKafkaConfFromCR(mc v1beta1.Milvus) (*external.CheckKafkaConfig, error)
- func GetMilvusConditionByType(conditions []v1beta1.MilvusCondition, t v1beta1.MilvusConditionType) *v1beta1.MilvusCondition
- func GetMilvusConfCheckSum(spec v1beta1.MilvusSpec) string
- func GetMilvusEndpoint(ctx context.Context, logger logr.Logger, client client.Client, ...) string
- func GetMilvusUpdatedCondition(m *v1beta1.Milvus) v1beta1.MilvusCondition
- func GetMinioBucket(conf map[string]interface{}) string
- func GetMinioCondition(ctx context.Context, logger logr.Logger, cli client.Client, ...) v1beta1.MilvusCondition
- func GetMinioIAMEndpoint(conf map[string]interface{}) string
- func GetMinioSecure(conf map[string]interface{}) bool
- func GetMinioUseIAM(conf map[string]interface{}) bool
- func GetNotReadyDependencyConditions(conditions []v1beta1.MilvusCondition) map[v1beta1.MilvusConditionType]*v1beta1.MilvusCondition
- func GetNotReadyPods(pods []corev1.Pod) []corev1.Pod
- func GetPodConditionByType(conditions []corev1.PodCondition, t corev1.PodConditionType) corev1.PodCondition
- func GetPodFalseCondition(pod corev1.Pod) (*corev1.PodCondition, error)
- func GetServiceInstanceName(instance string) string
- func GetStorageSecretRefEnv(secretRef string) []corev1.EnvVar
- func GetStringValueWithDefault(conf map[string]interface{}, defaultVal string, fields ...string) string
- func GetTerminatingPods(pods []corev1.Pod) []corev1.Pod
- func GetVolumeIndex(volumes []corev1.Volume, name string) int
- func GetVolumeMountIndex(volumeMounts []corev1.VolumeMount, mountPath string) int
- func InitializeMetrics()
- func IsDependencyReady(conditions []v1beta1.MilvusCondition) bool
- func IsEqual(obj1, obj2 interface{}) bool
- func IsMilvusConditionTrueByType(conditions []v1beta1.MilvusCondition, t v1beta1.MilvusConditionType) bool
- func IsMilvusDeploymentsComplete(m *v1beta1.Milvus) bool
- func IsPulsarChartPath(chartPath string) bool
- func IsSetDefaultDone(mc *v1beta1.Milvus) bool
- func LoopWithInterval(ctx context.Context, loopFunc func() error, interval time.Duration, ...)
- func MergeContainerPort(src, dst []corev1.ContainerPort) []corev1.ContainerPort
- func MergeEnvVar(src, dst []corev1.EnvVar) []corev1.EnvVar
- func MergeLabels(allLabels ...map[string]string) map[string]string
- func MergeServicePort(src, dst []corev1.ServicePort) []corev1.ServicePort
- func MergeVolumeMount(src, dst []corev1.VolumeMount) []corev1.VolumeMount
- func MilvusStatusToCode(status v1beta1.MilvusHealthStatus, isMaintaining bool) float64
- func NamespacedName(namespace, name string) types.NamespacedName
- func NewAppLabels(instance string) map[string]string
- func NewComponentAppLabels(instance, component string) map[string]string
- func NewServicePodLabels(instance string) map[string]string
- func PodReady(pod corev1.Pod) bool
- func RemoveConditions(status *v1beta1.MilvusStatus, typesToRemove []v1beta1.MilvusConditionType)
- func ReplicasValue(i *int32) int32
- func SetupControllers(ctx context.Context, mgr manager.Manager, stopReconcilers []string, ...) error
- func ShouldUseVirtualHost(conf map[string]interface{}) bool
- func UpdateCondition(status *v1beta1.MilvusStatus, c v1beta1.MilvusCondition)
- func UpdateDeploymentCondition(conditions []appsv1.DeploymentCondition, cond appsv1.DeploymentCondition) []appsv1.DeploymentCondition
- func WarppedReconcileComponentFunc(f func(context.Context, v1beta1.Milvus, MilvusComponent) error, ...) func() error
- func WrappedFunc(f interface{}, args ...interface{}) func() error
- type Args
- type Chart
- type CommonComponentReconciler
- type CommonInfo
- type ComponentConditionGetter
- type ComponentConditionGetterImpl
- type ComponentErrorDetail
- type ComponentSpec
- type DeployController
- type DeployControllerBiz
- type DeployControllerBizFactory
- type DeployControllerBizFactoryImpl
- type DeployControllerBizImpl
- func (c *DeployControllerBizImpl) CheckDeployMode(ctx context.Context, mc v1beta1.Milvus) (v1beta1.ComponentDeployMode, error)
- func (c *DeployControllerBizImpl) HandleCreate(ctx context.Context, mc v1beta1.Milvus) error
- func (c *DeployControllerBizImpl) HandleManualMode(ctx context.Context, mc v1beta1.Milvus) error
- func (c *DeployControllerBizImpl) HandleRolling(ctx context.Context, mc v1beta1.Milvus) error
- func (c *DeployControllerBizImpl) HandleScaling(ctx context.Context, mc v1beta1.Milvus) error
- func (c *DeployControllerBizImpl) HandleStop(ctx context.Context, mc v1beta1.Milvus) error
- func (c *DeployControllerBizImpl) IsPaused(ctx context.Context, mc v1beta1.Milvus) bool
- func (c *DeployControllerBizImpl) IsUpdating(ctx context.Context, mc v1beta1.Milvus) (bool, error)
- type DeployControllerBizUtil
- type DeployControllerBizUtilFactory
- type DeployControllerBizUtilFactoryImpl
- type DeployControllerBizUtilImpl
- func (c *DeployControllerBizUtilImpl) CreateDeploy(ctx context.Context, mc v1beta1.Milvus, podTemplate *corev1.PodTemplateSpec, ...) error
- func (c *DeployControllerBizUtilImpl) GetDeploys(ctx context.Context, mc v1beta1.Milvus) (currentDeployment, lastDeployment *appsv1.Deployment, err error)
- func (c *DeployControllerBizUtilImpl) IsNewRollout(ctx context.Context, currentDeployment *appsv1.Deployment, ...) bool
- func (c *DeployControllerBizUtilImpl) LastRolloutFinished(ctx context.Context, mc v1beta1.Milvus, ...) (bool, error)
- func (c *DeployControllerBizUtilImpl) PrepareNewRollout(ctx context.Context, mc v1beta1.Milvus, currentDeployment *appsv1.Deployment, ...) error
- func (c *DeployControllerBizUtilImpl) RenderPodTemplateWithoutGroupID(mc v1beta1.Milvus, currentTemplate *corev1.PodTemplateSpec, ...) *corev1.PodTemplateSpec
- func (c *DeployControllerBizUtilImpl) RenewDeployAnnotation(ctx context.Context, mc v1beta1.Milvus, currentDeploy *appsv1.Deployment) bool
- func (c *DeployControllerBizUtilImpl) ScaleDeployments(ctx context.Context, mc v1beta1.Milvus, ...) error
- func (c *DeployControllerBizUtilImpl) ShouldRollback(ctx context.Context, currentDeploy, lastDeploy *appsv1.Deployment, ...) bool
- type DeployControllerImpl
- type DeployModeChanger
- type DeployModeChangerFactory
- type DeployModeChangerFactoryImpl
- type DeployModeChangerImpl
- func (c *DeployModeChangerImpl) ChangeToTwoDeployMode(ctx context.Context, mc v1beta1.Milvus) error
- func (c *DeployModeChangerImpl) MarkCurrentDeploy(ctx context.Context, mc v1beta1.Milvus) error
- func (c *DeployModeChangerImpl) MarkDeployModeChanging(ctx context.Context, mc v1beta1.Milvus, changing bool) error
- func (c *DeployModeChangerImpl) RecoverDeploy(ctx context.Context, mc v1beta1.Milvus) error
- func (c *DeployModeChangerImpl) RecoverReplicaSets(ctx context.Context, mc v1beta1.Milvus) error
- func (c *DeployModeChangerImpl) SaveDeleteOldDeploy(ctx context.Context, mc v1beta1.Milvus) error
- func (c *DeployModeChangerImpl) SaveDeleteOldReplicaSet(ctx context.Context, mc v1beta1.Milvus) error
- func (c *DeployModeChangerImpl) UpdateOldPodLabels(ctx context.Context, mc v1beta1.Milvus) error
- type EndpointCheckCache
- type EndpointCheckCacheImpl
- func (e EndpointCheckCacheImpl) EndProbeFor(endpoints []string)
- func (e EndpointCheckCacheImpl) Get(endpoints []string) (condition *v1beta1.MilvusCondition, isUpToDate bool)
- func (e EndpointCheckCacheImpl) Set(endpoints []string, condition *v1beta1.MilvusCondition)
- func (e EndpointCheckCacheImpl) TryStartProbeFor(endpoints []string) bool
- type EtcdAuthConfig
- type EtcdClient
- type EtcdConditionInfo
- type EtcdEndPointHealth
- type Func
- type Group
- type GroupRunner
- type HelmReconciler
- type ImageInfo
- type K8sClient
- type K8sStatusClient
- type K8sUtil
- type K8sUtilImpl
- func (c *K8sUtilImpl) CreateObject(ctx context.Context, obj client.Object) error
- func (c *K8sUtilImpl) DeploymentIsStable(deploy *appsv1.Deployment, allPods []corev1.Pod) (isStable bool, reason string)
- func (c *K8sUtilImpl) GetOldDeploy(ctx context.Context, mc v1beta1.Milvus, component MilvusComponent) (*appsv1.Deployment, error)
- func (c *K8sUtilImpl) GetSavedObject(ctx context.Context, key client.ObjectKey, obj interface{}) error
- func (c *K8sUtilImpl) ListDeployPods(ctx context.Context, deploy *appsv1.Deployment, component MilvusComponent) ([]corev1.Pod, error)
- func (c *K8sUtilImpl) ListOldPods(ctx context.Context, mc v1beta1.Milvus, component MilvusComponent) ([]corev1.Pod, error)
- func (c *K8sUtilImpl) ListOldReplicaSets(ctx context.Context, mc v1beta1.Milvus, component MilvusComponent) (appsv1.ReplicaSetList, error)
- func (c *K8sUtilImpl) MarkMilvusComponentGroupId(ctx context.Context, mc v1beta1.Milvus, component MilvusComponent, groupId int) error
- func (c *K8sUtilImpl) OrphanDelete(ctx context.Context, obj client.Object) error
- func (c *K8sUtilImpl) SaveObject(ctx context.Context, mc v1beta1.Milvus, name string, obj runtime.Object) error
- func (c *K8sUtilImpl) UpdateAndRequeue(ctx context.Context, obj client.Object) error
- type LocalHelmReconciler
- type Manager
- type MilvusComponent
- func (c MilvusComponent) GetComponentPort(spec v1beta1.MilvusSpec) int32
- func (c MilvusComponent) GetComponentSpec(spec v1beta1.MilvusSpec) v1beta1.ComponentSpec
- func (c MilvusComponent) GetContainerName() string
- func (c MilvusComponent) GetDependencies(spec v1beta1.MilvusSpec) []MilvusComponent
- func (c MilvusComponent) GetDeploymentName(instance string) string
- func (c MilvusComponent) GetDeploymentStrategy(configs map[string]interface{}) appsv1.DeploymentStrategy
- func (c MilvusComponent) GetInitContainers(spec v1beta1.MilvusSpec) []corev1.Container
- func (c MilvusComponent) GetLeastReplicasRegardingHPA(spec v1beta1.MilvusSpec) int32
- func (c MilvusComponent) GetMilvusReplicas(status *v1beta1.MilvusReplicas) int
- func (c MilvusComponent) GetName() string
- func (c MilvusComponent) GetPortName() string
- func (c MilvusComponent) GetReplicas(spec v1beta1.MilvusSpec) *int32
- func (c MilvusComponent) GetRestfulPort(spec v1beta1.MilvusSpec) int32
- func (c MilvusComponent) GetRunCommands() []string
- func (c MilvusComponent) GetServicePorts(spec v1beta1.MilvusSpec) []corev1.ServicePort
- func (c MilvusComponent) GetServiceType(spec v1beta1.MilvusSpec) corev1.ServiceType
- func (c MilvusComponent) GetSideCars(spec v1beta1.MilvusSpec) []corev1.Container
- func (c MilvusComponent) IsCoord() bool
- func (c MilvusComponent) IsImageUpdated(m *v1beta1.Milvus) bool
- func (c MilvusComponent) IsNode() bool
- func (c MilvusComponent) IsService() bool
- func (c MilvusComponent) IsStandalone() bool
- func (c MilvusComponent) SetReplicas(spec v1beta1.MilvusSpec, replicas *int32) error
- func (c MilvusComponent) SetStatusReplicas(status *v1beta1.MilvusReplicas, replicas int)
- type MilvusEndpointInfo
- type MilvusHealthStatusInfo
- type MilvusPredicate
- type MilvusReconcileFunc
- type MilvusReconciler
- func (r *MilvusReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *MilvusReconciler) ReconcileAll(ctx context.Context, mc v1beta1.Milvus) error
- func (r *MilvusReconciler) ReconcileComponentDeployment(ctx context.Context, mc v1beta1.Milvus, component MilvusComponent) error
- func (r *MilvusReconciler) ReconcileComponentService(ctx context.Context, mc v1beta1.Milvus, component MilvusComponent) error
- func (r *MilvusReconciler) ReconcileConfigMaps(ctx context.Context, mc v1beta1.Milvus) error
- func (r *MilvusReconciler) ReconcileDeployments(ctx context.Context, mc v1beta1.Milvus) error
- func (r *MilvusReconciler) ReconcileEtcd(ctx context.Context, mc v1beta1.Milvus) error
- func (r *MilvusReconciler) ReconcileIngress(ctx context.Context, mc v1beta1.Milvus) error
- func (r *MilvusReconciler) ReconcileKafka(ctx context.Context, mc v1beta1.Milvus) error
- func (r *MilvusReconciler) ReconcileLegacyValues(ctx context.Context, old, milvus *milvusv1beta1.Milvus) error
- func (r *MilvusReconciler) ReconcileMilvus(ctx context.Context, mc v1beta1.Milvus) error
- func (r *MilvusReconciler) ReconcileMinio(ctx context.Context, mc v1beta1.Milvus) error
- func (r *MilvusReconciler) ReconcileMsgStream(ctx context.Context, mc v1beta1.Milvus) error
- func (r *MilvusReconciler) ReconcilePVCs(ctx context.Context, mil v1beta1.Milvus) error
- func (r *MilvusReconciler) ReconcilePodMonitor(ctx context.Context, mc v1beta1.Milvus) error
- func (r *MilvusReconciler) ReconcilePulsar(ctx context.Context, mc v1beta1.Milvus) error
- func (r *MilvusReconciler) ReconcileServices(ctx context.Context, mc v1beta1.Milvus) error
- func (r *MilvusReconciler) RemoveOldStandlone(ctx context.Context, mc v1beta1.Milvus) error
- func (r *MilvusReconciler) SetDefaultStatus(ctx context.Context, mc *v1beta1.Milvus) error
- func (r *MilvusReconciler) SetupWithManager(mgr ctrl.Manager) error
- func (r *MilvusReconciler) VerifyCR(ctx context.Context, milvus *milvusv1beta1.Milvus) error
- type MilvusStatusSyncer
- func (r *MilvusStatusSyncer) GetEtcdCondition(ctx context.Context, mc v1beta1.Milvus) (v1beta1.MilvusCondition, error)
- func (r *MilvusStatusSyncer) GetMilvusEndpoint(ctx context.Context, mc v1beta1.Milvus) string
- func (r *MilvusStatusSyncer) GetMinioCondition(ctx context.Context, mc v1beta1.Milvus) (v1beta1.MilvusCondition, error)
- func (r *MilvusStatusSyncer) GetMsgStreamCondition(ctx context.Context, mc v1beta1.Milvus) (v1beta1.MilvusCondition, error)
- func (r *MilvusStatusSyncer) RunIfNot()
- func (r *MilvusStatusSyncer) UpdateIngressStatus(ctx context.Context, mc *v1beta1.Milvus) error
- func (r *MilvusStatusSyncer) UpdateStatusForNewGeneration(ctx context.Context, mc *v1beta1.Milvus, checkDependency bool) error
- func (r *MilvusStatusSyncer) UpdateStatusRoutine(ctx context.Context, mc *v1beta1.Milvus) error
- type MilvusStatusSyncerInterface
- type MilvusUpgradeReconciler
- func (r *MilvusUpgradeReconciler) BackupMeta(ctx context.Context, upgrade *v1beta1.MilvusUpgrade, milvus *v1beta1.Milvus) (v1beta1.MilvusUpgradeState, error)
- func (r *MilvusUpgradeReconciler) DetermineCurrentState(ctx context.Context, upgrade *v1beta1.MilvusUpgrade) (nextState v1beta1.MilvusUpgradeState)
- func (r *MilvusUpgradeReconciler) HandleBakupMetaFailed(ctx context.Context, upgrade *v1beta1.MilvusUpgrade, milvus *v1beta1.Milvus) (v1beta1.MilvusUpgradeState, error)
- func (r *MilvusUpgradeReconciler) HandleUpgradeFailed(ctx context.Context, upgrade *v1beta1.MilvusUpgrade, milvus *v1beta1.Milvus) (v1beta1.MilvusUpgradeState, error)
- func (r *MilvusUpgradeReconciler) OldVersionStopping(ctx context.Context, upgrade *v1beta1.MilvusUpgrade, milvus *v1beta1.Milvus) (v1beta1.MilvusUpgradeState, error)
- func (r *MilvusUpgradeReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *MilvusUpgradeReconciler) RollbackNewVersionStopping(ctx context.Context, upgrade *v1beta1.MilvusUpgrade, milvus *v1beta1.Milvus) (v1beta1.MilvusUpgradeState, error)
- func (r *MilvusUpgradeReconciler) RollbackOldVersionStarting(ctx context.Context, upgrade *v1beta1.MilvusUpgrade, milvus *v1beta1.Milvus) (v1beta1.MilvusUpgradeState, error)
- func (r *MilvusUpgradeReconciler) RollbackRestoringOldMeta(ctx context.Context, upgrade *v1beta1.MilvusUpgrade, milvus *v1beta1.Milvus) (v1beta1.MilvusUpgradeState, error)
- func (r *MilvusUpgradeReconciler) RunStateMachine(ctx context.Context, upgrade *v1beta1.MilvusUpgrade) error
- func (r *MilvusUpgradeReconciler) SetupWithManager(mgr ctrl.Manager) error
- func (r *MilvusUpgradeReconciler) StartingMilvusNewVersion(ctx context.Context, upgrade *v1beta1.MilvusUpgrade, milvus *v1beta1.Milvus) (v1beta1.MilvusUpgradeState, error)
- func (r *MilvusUpgradeReconciler) UpdatingMeta(ctx context.Context, upgrade *v1beta1.MilvusUpgrade, milvus *v1beta1.Milvus) (v1beta1.MilvusUpgradeState, error)
- type MilvusUpgradeReconcilerCommonFunc
- type NewEtcdClientFunc
- type ParallelGroupRunner
- func (ParallelGroupRunner) Run(funcs []Func, ctx context.Context, args ...interface{}) error
- func (ParallelGroupRunner) RunDiffArgs(f MilvusReconcileFunc, ctx context.Context, argsArray []*v1beta1.Milvus) error
- func (ParallelGroupRunner) RunWithResult(funcs []Func, ctx context.Context, args ...interface{}) []Result
- type Result
- type RollingModeStatusUpdater
- type RollingModeStatusUpdaterImpl
- type StorageConditionInfo
- type Values
Constants ¶
const ( EtcdMetricPortName = "client" MetricPortName = "metrics" MetricPath = "/metrics" RestfulPortName = "restful" MixCoordName = v1beta1.MixCoordName RootCoordName = v1beta1.RootCoordName DataCoordName = v1beta1.DataCoordName QueryCoordName = v1beta1.QueryCoordName IndexCoordName = v1beta1.IndexCoordName DataNodeName = v1beta1.DataNodeName QueryNodeName = v1beta1.QueryNodeName IndexNodeName = v1beta1.IndexNodeName ProxyName = v1beta1.ProxyName StandaloneName = v1beta1.StandaloneName StreamingNodeName = v1beta1.StreamingNodeName MilvusName = "milvus" MixCoordFieldName = "MixCoord" RootCoordFieldName = "RootCoord" DataCoordFieldName = "DataCoord" QueryCoordFieldName = "QueryCoord" IndexCoordFieldName = "IndexCoord" DataNodeFieldName = "DataNode" QueryNodeFieldName = "QueryNode" IndexNodeFieldName = "IndexNode" StreamingNodeFieldName = "StreamingNode" ProxyFieldName = "Proxy" StandaloneFieldName = "Standalone" MetricPort = 9091 MultiplePorts = -1 RootCoordPort = 53100 DataCoordPort = 13333 QueryCoordPort = 19531 IndexCoordPort = 31000 IndexNodePort = 21121 QueryNodePort = 21123 DataNodePort = 21124 StreamingNodePort = 22222 ProxyPort = 19530 // TODO: use configurable port? MilvusPort = ProxyPort StandalonePort = MilvusPort )
const name or ports
const ( Etcd = "etcd" Minio = "minio" Pulsar = "pulsar" PulsarV3 = "pulsar-v3" Kafka = "kafka" )
const ( MilvusDataVolumeName = "milvus-data" // for standalone persistence only MilvusConfigVolumeName = "milvus-config" MilvusConfigRootPath = "/milvus/configs" MilvusOriginalConfigPath = MilvusConfigRootPath + "/milvus.yaml" MilvusConfigmapMountPath = MilvusConfigRootPath + "/operator" UserYaml = "user.yaml" HookYaml = "hook.yaml" AccessKey = "accesskey" SecretKey = "secretkey" AnnotationCheckSum = "checksum/config" AnnotationMilvusGeneration = v1beta1.AnnotationMilvusGeneration ToolsVolumeName = "tools" ToolsMountPath = "/milvus/tools" RunScriptPath = ToolsMountPath + "/run.sh" MergeToolPath = ToolsMountPath + "/merge" )
const ( MilvusStatusCodePending = float64(0) MilvusStatusCodeHealthy = float64(1) MilvusStatusCodeUnHealthy = float64(2) MilvusStatusCodeDeleting = float64(3) MilvusStautsCodeStopped = float64(4) MilvusStautsCodeMaintaining = float64(5) )
MilvusStatusCode for milvusStatusCollector
const ( MilvusFinalizerName = "milvus.milvus.io/finalizer" ForegroundDeletionFinalizer = "foregroundDeletion" PauseReconcileAnnotation = "milvus.io/pause-reconcile" MaintainingAnnotation = "milvus.io/maintaining" )
const ( ConditionCheckingUpgrationState = "CheckingUpgrationState" ConditionUpgraded = "Upgraded" ConditionRollbacked = "Rollbacked" )
const ( LabelUpgrade = v1beta1.MilvusIO + "upgrade" LabelTaskKind = v1beta1.MilvusIO + "task-kind" BackupMeta = "backup-meta" UpdateMeta = "update-meta" RollbackMeta = "rollback-meta" )
const ( MessageEtcdReady = "Etcd endpoints is healthy" MessageEtcdNotReady = "All etcd endpoints are unhealthy" MessageStorageReady = "Storage endpoints is healthy" MessageStorageNotReady = "All Storage endpoints are unhealthy" MessageMsgStreamReady = "MsgStream is ready" MessageMsgStreamNotReady = "MsgStream is not ready" MessageSecretNotExist = "Secret not exist" MessageKeyNotExist = "accesskey or secretkey not exist in secret" MessageDecodeErr = "accesskey or secretkey decode error" MessageMilvusHealthy = "All Milvus components are healthy" MessageMilvusStopped = "All Milvus components are stopped" MessageMilvusStopping = "All Milvus components are stopping" // SSL related messages MessageStorageSSLCertSecretNotExist = "SSL CA certificate secret not exist" MessageStorageSSLCertKeyNotExist = "CA certificate not found in secret, expected key: ca.crt" MessageStorageSSLCertLoadFailed = "Failed to load CA certificate" )
const ( AppLabel = "app.kubernetes.io/" AppLabelInstance = AppLabel + "instance" AppLabelVersion = AppLabel + "version" AppLabelComponent = AppLabel + "component" AppLabelName = AppLabel + "name" AppLabelManagedBy = AppLabel + "managed-by" HelmReleaseLabel = "release" )
const (
CacheSizeEnvVarName = "CACHE_SIZE"
)
const ManagerName = "milvus-operator"
Variables ¶
var ( MixCoord = MilvusComponent{MixCoordName, MixCoordFieldName, MultiplePorts} RootCoord = MilvusComponent{RootCoordName, RootCoordFieldName, RootCoordPort} DataCoord = MilvusComponent{DataCoordName, DataCoordFieldName, DataCoordPort} QueryCoord = MilvusComponent{QueryCoordName, QueryCoordFieldName, QueryCoordPort} IndexCoord = MilvusComponent{IndexCoordName, IndexCoordFieldName, IndexCoordPort} DataNode = MilvusComponent{DataNodeName, DataNodeFieldName, DataNodePort} QueryNode = MilvusComponent{QueryNodeName, QueryNodeFieldName, QueryNodePort} IndexNode = MilvusComponent{IndexNodeName, IndexNodeFieldName, IndexNodePort} StreamingNode = MilvusComponent{StreamingNodeName, StreamingNodeFieldName, StreamingNodePort} Proxy = MilvusComponent{ProxyName, ProxyFieldName, ProxyPort} // Milvus standalone MilvusStandalone = MilvusComponent{StandaloneName, StandaloneFieldName, StandalonePort} MixtureComponents = []MilvusComponent{ MixCoord, DataNode, QueryNode, IndexNode, Proxy, MilvusStandalone, } MilvusComponents = []MilvusComponent{ RootCoord, DataCoord, QueryCoord, IndexCoord, DataNode, QueryNode, IndexNode, Proxy, MilvusStandalone, } StandaloneComponents = []MilvusComponent{ MilvusStandalone, } MilvusCoords = []MilvusComponent{ RootCoord, DataCoord, QueryCoord, IndexCoord, } )
define MilvusComponents
var ( ErrNotFound = errors.New("not found") ErrNoLastDeployment = errors.New("no last deployment found") )
var ( DefaultConfigMapMode = corev1.ConfigMapVolumeSourceDefaultMode ErrRequeue = errors.New("requeue") )
var ( DefaultOperatorImageInfo = ImageInfo{ Image: "milvusdb/milvus-operator:main-latest", ImagePullPolicy: corev1.PullAlways, } ToolImage = "" )
var ( S3ReadyCondition = v1beta1.MilvusCondition{ Type: v1beta1.StorageReady, Status: GetConditionStatus(true), Reason: v1beta1.ReasonS3Ready, } Debug = false )
var ( CacheSizeEnvVar = corev1.EnvVar{ Name: CacheSizeEnvVarName, ValueFrom: &corev1.EnvVarSource{ ResourceFieldRef: &corev1.ResourceFieldSelector{ Divisor: resource.MustParse("1Gi"), Resource: "limits.memory", }, }, } )
var CheckComponentHasTerminatingPod = func(ctx context.Context, cli client.Client, mc v1beta1.Milvus, component MilvusComponent) (bool, error) { opts := &client.ListOptions{ Namespace: mc.Namespace, } opts.LabelSelector = labels.SelectorFromSet(NewComponentAppLabels(mc.Name, component.Name)) list, err := listTerminatingPodByOpts(ctx, cli, opts) if err != nil { return false, err } return len(list.Items) > 0, nil }
var CheckMilvusStopped = func(ctx context.Context, cli client.Client, mc v1beta1.Milvus) (bool, error) { podList, err := listMilvusPods(ctx, cli, mc) if err != nil { return false, err } if len(podList.Items) > 0 { logger := ctrl.LoggerFrom(ctx) logger.Info("milvus has pods not stopped", "pods count", len(podList.Items)) return false, ExecKillIfTerminating(ctx, podList) } return true, nil }
var DeploymentConditionNotSet = appsv1.DeploymentCondition{}
var Finalize = func(ctx context.Context, r *MilvusReconciler, mc v1beta1.Milvus) error { deletingReleases := map[string]bool{} if !mc.Spec.Dep.Etcd.External && mc.Spec.Dep.Etcd.InCluster.DeletionPolicy == v1beta1.DeletionPolicyDelete { deletingReleases[mc.Name+"-etcd"] = mc.Spec.Dep.Etcd.InCluster.PVCDeletion } switch mc.Spec.Dep.MsgStreamType { case v1beta1.MsgStreamTypeKafka: if !mc.Spec.Dep.Kafka.External && mc.Spec.Dep.Kafka.InCluster.DeletionPolicy == v1beta1.DeletionPolicyDelete { deletingReleases[mc.Name+"-kafka"] = mc.Spec.Dep.Kafka.InCluster.PVCDeletion } case v1beta1.MsgStreamTypePulsar: if !mc.Spec.Dep.Pulsar.External && mc.Spec.Dep.Pulsar.InCluster.DeletionPolicy == v1beta1.DeletionPolicyDelete { deletingReleases[mc.Name+"-pulsar"] = mc.Spec.Dep.Pulsar.InCluster.PVCDeletion } default: persist := mc.Spec.Dep.RocksMQ.Persistence if persist.Enabled && persist.PVCDeletion { pvcName := getPVCNameByInstName(mc.Name) pvc := &corev1.PersistentVolumeClaim{} pvc.Namespace = mc.Namespace pvc.Name = pvcName if err := r.Delete(ctx, pvc); err != nil { return errors.Wrap(err, "delete data pvc failed") } else { r.logger.Info("pvc deleted", "name", pvc.Name, "namespace", pvc.Namespace) } } } if !mc.Spec.Dep.Storage.External && mc.Spec.Dep.Storage.InCluster.DeletionPolicy == v1beta1.DeletionPolicyDelete { deletingReleases[mc.Name+"-minio"] = mc.Spec.Dep.Storage.InCluster.PVCDeletion } if len(deletingReleases) > 0 { cfg := r.helmReconciler.NewHelmCfg(mc.Namespace) errs := []error{} for releaseName, deletePVC := range deletingReleases { if err := helm.Uninstall(cfg, releaseName); err != nil { errs = append(errs, err) continue } if deletePVC { err := r.batchDeletePVC(ctx, mc.Namespace, AppLabelInstance, releaseName) if err != nil { err = errors.Wrapf(err, "delete pvc with label %s=%s failed", AppLabelInstance, releaseName) errs = append(errs, err) continue } err = r.batchDeletePVC(ctx, mc.Namespace, HelmReleaseLabel, releaseName) if err != nil { err = errors.Wrapf(err, "delete pvc with label %s=%s failed", HelmReleaseLabel, releaseName) errs = append(errs, err) continue } } } if len(errs) > 0 { return errors.New(util.JoinErrors(errs)) } } return nil }
var ListMilvusTerminatingPods = func(ctx context.Context, cli client.Client, mc v1beta1.Milvus) (*corev1.PodList, error) { opts := &client.ListOptions{ Namespace: mc.Namespace, } opts.LabelSelector = labels.SelectorFromSet(NewAppLabels(mc.Name)) return listTerminatingPodByOpts(ctx, cli, opts) }
var MergeAnnotations = MergeLabels
var PodConditionNotSet = corev1.PodCondition{}
PodConditionNotSet is used when pod condition is not found when calling GetPodConditionByType
var ( SetControllerReference = func(owner, controlled metav1.Object, scheme *kruntime.Scheme) error { if err := ctrl.SetControllerReference(owner, controlled, scheme); err != nil { if reflect.TypeOf(err) == alreadyOwnedErrorType { if err.(*controllerutil.AlreadyOwnedError).Owner.Kind == milvusclusterOwnerKind { return nil } } return errors.Wrap(err, "set controller reference") } return nil } )
Functions ¶
func DeploymentReady ¶
func DeploymentReady(status appsv1.DeploymentStatus) bool
DeploymentReady deployment is ready when all components are available
func ExecKillIfTerminating ¶
func GetAzureStorageAccount ¶
func GetCondition ¶
func GetCondition(getter func() v1beta1.MilvusCondition, eps []string) v1beta1.MilvusCondition
func GetConditionStatus ¶
func GetConditionStatus(b bool) corev1.ConditionStatus
func GetConfCheckSum ¶
func GetConfCheckSum(spec v1beta1.MilvusSpec) string
GetConfCheckSum returns the checksum of the component configuration
func GetContainerIndex ¶
GetContainerIndex returns index of container @name in @containers, -1 if not found
func GetContainerMessage ¶
func GetContainerMessage(status corev1.ContainerStatus) string
func GetDefaultLivenessProbe ¶
func GetDefaultStartupProbe ¶
func GetDeploymentConditionByType ¶
func GetDeploymentConditionByType(conditions []appsv1.DeploymentCondition, t appsv1.DeploymentConditionType) appsv1.DeploymentCondition
func GetDeploymentFalseCondition ¶
func GetDeploymentFalseCondition(deploy appsv1.Deployment) (*appsv1.DeploymentCondition, error)
func GetDeploymentGroupId ¶
func GetDeploymentGroupId(deploy *appsv1.Deployment) (int, error)
func GetDeploymentStrategy ¶ added in v1.2.6
func GetDeploymentStrategy(milvus *v1beta1.Milvus, component MilvusComponent) appsv1.DeploymentStrategy
func GetEndpointsHealth ¶
func GetEndpointsHealth(ctx context.Context, authConfig EtcdAuthConfig, endpoints []string) map[string]EtcdEndPointHealth
func GetEtcdCondition ¶
func GetEtcdCondition(ctx context.Context, authCfg EtcdAuthConfig, endpoints []string) v1beta1.MilvusCondition
func GetKafkaCondition ¶
func GetKafkaCondition(ctx context.Context, logger logr.Logger, p v1beta1.MilvusKafka, cfg external.CheckKafkaConfig) v1beta1.MilvusCondition
func GetKafkaConfFromCR ¶
func GetKafkaConfFromCR(mc v1beta1.Milvus) (*external.CheckKafkaConfig, error)
GetKafkaConfFromCR get kafka config from CR
func GetMilvusConditionByType ¶
func GetMilvusConditionByType(conditions []v1beta1.MilvusCondition, t v1beta1.MilvusConditionType) *v1beta1.MilvusCondition
func GetMilvusConfCheckSum ¶
func GetMilvusConfCheckSum(spec v1beta1.MilvusSpec) string
GetMilvusConfCheckSum returns the checksum of the component configuration
func GetMilvusEndpoint ¶
func GetMilvusUpdatedCondition ¶
func GetMilvusUpdatedCondition(m *v1beta1.Milvus) v1beta1.MilvusCondition
func GetMinioBucket ¶
func GetMinioCondition ¶
func GetMinioCondition(ctx context.Context, logger logr.Logger, cli client.Client, info StorageConditionInfo) v1beta1.MilvusCondition
func GetMinioIAMEndpoint ¶
func GetMinioSecure ¶
func GetMinioUseIAM ¶
func GetNotReadyDependencyConditions ¶
func GetNotReadyDependencyConditions(conditions []v1beta1.MilvusCondition) map[v1beta1.MilvusConditionType]*v1beta1.MilvusCondition
func GetPodConditionByType ¶
func GetPodConditionByType(conditions []corev1.PodCondition, t corev1.PodConditionType) corev1.PodCondition
GetPodConditionByType returns the condition with the provided type, return ConditionNotSet if not found
func GetPodFalseCondition ¶
func GetPodFalseCondition(pod corev1.Pod) (*corev1.PodCondition, error)
func GetServiceInstanceName ¶
GetServiceInstanceName returns the name of the component service
func GetStorageSecretRefEnv ¶
func GetVolumeIndex ¶
GetVolumeIndex returns index of volume @name in @volumes, -1 if not found
func GetVolumeMountIndex ¶
func GetVolumeMountIndex(volumeMounts []corev1.VolumeMount, mountPath string) int
GetVolumeMountIndex returns index of volumeMount with @mountPath in @volumeMounts, -1 if not found
func IsDependencyReady ¶
func IsDependencyReady(conditions []v1beta1.MilvusCondition) bool
func IsMilvusConditionTrueByType ¶
func IsMilvusConditionTrueByType(conditions []v1beta1.MilvusCondition, t v1beta1.MilvusConditionType) bool
func IsPulsarChartPath ¶
func IsSetDefaultDone ¶
func LoopWithInterval ¶
func MergeContainerPort ¶
func MergeContainerPort(src, dst []corev1.ContainerPort) []corev1.ContainerPort
func MergeEnvVar ¶
Merge dst env into src
func MergeLabels ¶
MergeLabels merges all labels together and returns a new label.
func MergeServicePort ¶
func MergeServicePort(src, dst []corev1.ServicePort) []corev1.ServicePort
func MergeVolumeMount ¶
func MergeVolumeMount(src, dst []corev1.VolumeMount) []corev1.VolumeMount
func MilvusStatusToCode ¶
func MilvusStatusToCode(status v1beta1.MilvusHealthStatus, isMaintaining bool) float64
func NamespacedName ¶
func NamespacedName(namespace, name string) types.NamespacedName
func NewAppLabels ¶
func NewComponentAppLabels ¶
func NewServicePodLabels ¶
func PodReady ¶
PodReady returns whether a pod is running and each container has passed it's ready state.
func RemoveConditions ¶
func RemoveConditions(status *v1beta1.MilvusStatus, typesToRemove []v1beta1.MilvusConditionType)
func ReplicasValue ¶
func SetupControllers ¶
func ShouldUseVirtualHost ¶
func UpdateCondition ¶
func UpdateCondition(status *v1beta1.MilvusStatus, c v1beta1.MilvusCondition)
func UpdateDeploymentCondition ¶
func UpdateDeploymentCondition(conditions []appsv1.DeploymentCondition, cond appsv1.DeploymentCondition) []appsv1.DeploymentCondition
func WrappedFunc ¶
func WrappedFunc(f interface{}, args ...interface{}) func() error
Types ¶
type CommonComponentReconciler ¶
type CommonComponentReconciler struct {
// contains filtered or unexported fields
}
func NewCommonComponentReconciler ¶
func NewCommonComponentReconciler(r *MilvusReconciler) *CommonComponentReconciler
func (*CommonComponentReconciler) Reconcile ¶
func (r *CommonComponentReconciler) Reconcile(ctx context.Context, mc v1beta1.Milvus, component MilvusComponent) error
type CommonInfo ¶
type CommonInfo struct { OperatorImageInfo ImageInfo // contains filtered or unexported fields }
CommonInfo should be init when before time reconcile
func (*CommonInfo) InitIfNot ¶
func (c *CommonInfo) InitIfNot(cli client.Client)
type ComponentConditionGetter ¶
type ComponentConditionGetter interface {
GetMilvusInstanceCondition(ctx context.Context, cli client.Client, mc v1beta1.Milvus) (v1beta1.MilvusCondition, error)
}
func GetComponentConditionGetter ¶
func GetComponentConditionGetter() ComponentConditionGetter
type ComponentConditionGetterImpl ¶
type ComponentConditionGetterImpl struct{}
func (ComponentConditionGetterImpl) GetMilvusInstanceCondition ¶
func (c ComponentConditionGetterImpl) GetMilvusInstanceCondition(ctx context.Context, cli client.Client, mc v1beta1.Milvus) (v1beta1.MilvusCondition, error)
type ComponentErrorDetail ¶
type ComponentErrorDetail struct { ComponentName string NotObserved bool Deployment *appsv1.DeploymentCondition PodName string Pod *corev1.PodCondition Container *corev1.ContainerStatus }
ComponentErrorDetail is one sample of error detail among all error pods
func (ComponentErrorDetail) String ¶
func (m ComponentErrorDetail) String() string
type ComponentSpec ¶
type ComponentSpec = v1beta1.ComponentSpec
func MergeComponentSpec ¶
func MergeComponentSpec(src, dst ComponentSpec) ComponentSpec
MergeComponentSpec merges the src ComponentSpec to dst
type DeployController ¶
type DeployController interface {
Reconcile(context.Context, v1beta1.Milvus, MilvusComponent) error
}
DeployController controls milvus deployments
type DeployControllerBiz ¶
type DeployControllerBiz interface { // backward compatible logic CheckDeployMode(ctx context.Context, mc v1beta1.Milvus) (v1beta1.ComponentDeployMode, error) IsUpdating(ctx context.Context, mc v1beta1.Milvus) (bool, error) DeployModeChanger // 2 deployment mode logic IsPaused(ctx context.Context, mc v1beta1.Milvus) bool HandleCreate(ctx context.Context, mc v1beta1.Milvus) error HandleStop(ctx context.Context, mc v1beta1.Milvus) error HandleScaling(ctx context.Context, mc v1beta1.Milvus) error HandleRolling(ctx context.Context, mc v1beta1.Milvus) error HandleManualMode(ctx context.Context, mc v1beta1.Milvus) error }
DeployControllerBiz are the business logics of DeployController, abstracted for unit test
type DeployControllerBizFactory ¶
type DeployControllerBizFactory interface {
GetBiz(component MilvusComponent) DeployControllerBiz
}
DeployControllerBizFactory is the factory of DeployControllerBiz
type DeployControllerBizFactoryImpl ¶
type DeployControllerBizFactoryImpl struct {
// contains filtered or unexported fields
}
DeployControllerBizFactoryImpl is the implementation of DeployControllerBizFactory
func NewDeployControllerBizFactory ¶
func NewDeployControllerBizFactory(modeChangerFactory DeployModeChangerFactory, utilFactory DeployControllerBizUtilFactory, cli client.Client) *DeployControllerBizFactoryImpl
NewDeployControllerBizFactory creates a new DeployControllerBizFactory
func (*DeployControllerBizFactoryImpl) GetBiz ¶
func (f *DeployControllerBizFactoryImpl) GetBiz(component MilvusComponent) DeployControllerBiz
GetBiz get DeployControllerBiz for the given component
type DeployControllerBizImpl ¶
type DeployControllerBizImpl struct { DeployModeChanger // contains filtered or unexported fields }
DeployControllerBizImpl implements DeployControllerBiz
func NewDeployControllerBizImpl ¶
func NewDeployControllerBizImpl(component MilvusComponent, util DeployControllerBizUtil, modeChanger DeployModeChanger, cli client.Client) *DeployControllerBizImpl
func (*DeployControllerBizImpl) CheckDeployMode ¶
func (c *DeployControllerBizImpl) CheckDeployMode(ctx context.Context, mc v1beta1.Milvus) (v1beta1.ComponentDeployMode, error)
func (*DeployControllerBizImpl) HandleCreate ¶
func (*DeployControllerBizImpl) HandleManualMode ¶
func (*DeployControllerBizImpl) HandleRolling ¶
func (*DeployControllerBizImpl) HandleScaling ¶
func (*DeployControllerBizImpl) HandleStop ¶
func (*DeployControllerBizImpl) IsUpdating ¶
type DeployControllerBizUtil ¶
type DeployControllerBizUtil interface { RenderPodTemplateWithoutGroupID(mc v1beta1.Milvus, currentTemplate *corev1.PodTemplateSpec, component MilvusComponent, forceUpdateAll bool) *corev1.PodTemplateSpec // GetDeploys returns currentDeployment, lastDeployment when there is exactly one currentDeployment, one lastDeployment // otherwise return err. in particular: // - return ErrNotFound when no deployment found // - return ErrNoCurrentDeployment when no current deployment found // - return ErrNoLastDeployment when no last deployment found GetDeploys(ctx context.Context, mc v1beta1.Milvus) (currentDeployment, lastDeployment *appsv1.Deployment, err error) // CreateDeploy with replica = 0, if groupId != 0, set image to dummy to avoid rolling back and forth CreateDeploy(ctx context.Context, mc v1beta1.Milvus, podTemplate *corev1.PodTemplateSpec, groupId int) error ShouldRollback(ctx context.Context, currentDeploy, lastDeployment *appsv1.Deployment, podTemplate *corev1.PodTemplateSpec) bool LastRolloutFinished(ctx context.Context, mc v1beta1.Milvus, currentDeployment, lastDeployment *appsv1.Deployment) (bool, error) IsNewRollout(ctx context.Context, currentDeployment *appsv1.Deployment, podTemplate *corev1.PodTemplateSpec) bool // ScaleDeployments scales 2 deployments to proper replicas, it assumes currentDeployment & lastDeployment not nil ScaleDeployments(ctx context.Context, mc v1beta1.Milvus, currentDeployment, lastDeployment *appsv1.Deployment) error // PrepareNewRollout prepare a new rollout, it assumes currentDeployment not nil PrepareNewRollout(ctx context.Context, mc v1beta1.Milvus, currentDeployment *appsv1.Deployment, podTemplate *corev1.PodTemplateSpec) error // RenewDeployAnnotation check annotation, renew if necessary, returns true if annotation is updated RenewDeployAnnotation(ctx context.Context, mc v1beta1.Milvus, currentDeployment *appsv1.Deployment) bool K8sUtil }
DeployControllerBizUtil are the business logics of DeployControllerBizImpl, abstracted for unit test
type DeployControllerBizUtilFactory ¶
type DeployControllerBizUtilFactory interface {
GetBizUtil(component MilvusComponent) DeployControllerBizUtil
}
type DeployControllerBizUtilFactoryImpl ¶
type DeployControllerBizUtilFactoryImpl struct {
// contains filtered or unexported fields
}
func NewDeployControllerBizUtilFactory ¶
func NewDeployControllerBizUtilFactory(cli client.Client, k8sUtil K8sUtil) *DeployControllerBizUtilFactoryImpl
func (*DeployControllerBizUtilFactoryImpl) GetBizUtil ¶
func (f *DeployControllerBizUtilFactoryImpl) GetBizUtil(component MilvusComponent) DeployControllerBizUtil
type DeployControllerBizUtilImpl ¶
type DeployControllerBizUtilImpl struct { K8sUtil // contains filtered or unexported fields }
func NewDeployControllerBizUtil ¶
func NewDeployControllerBizUtil(component MilvusComponent, cli client.Client, k8sUtil K8sUtil) *DeployControllerBizUtilImpl
func (*DeployControllerBizUtilImpl) CreateDeploy ¶
func (c *DeployControllerBizUtilImpl) CreateDeploy(ctx context.Context, mc v1beta1.Milvus, podTemplate *corev1.PodTemplateSpec, groupId int) error
func (*DeployControllerBizUtilImpl) GetDeploys ¶
func (c *DeployControllerBizUtilImpl) GetDeploys(ctx context.Context, mc v1beta1.Milvus) (currentDeployment, lastDeployment *appsv1.Deployment, err error)
func (*DeployControllerBizUtilImpl) IsNewRollout ¶
func (c *DeployControllerBizUtilImpl) IsNewRollout(ctx context.Context, currentDeployment *appsv1.Deployment, podTemplate *corev1.PodTemplateSpec) bool
func (*DeployControllerBizUtilImpl) LastRolloutFinished ¶
func (c *DeployControllerBizUtilImpl) LastRolloutFinished(ctx context.Context, mc v1beta1.Milvus, currentDeployment, lastDeployment *appsv1.Deployment) (bool, error)
func (*DeployControllerBizUtilImpl) PrepareNewRollout ¶
func (c *DeployControllerBizUtilImpl) PrepareNewRollout(ctx context.Context, mc v1beta1.Milvus, currentDeployment *appsv1.Deployment, podTemplate *corev1.PodTemplateSpec) error
func (*DeployControllerBizUtilImpl) RenderPodTemplateWithoutGroupID ¶
func (c *DeployControllerBizUtilImpl) RenderPodTemplateWithoutGroupID(mc v1beta1.Milvus, currentTemplate *corev1.PodTemplateSpec, component MilvusComponent, forceUpdateAll bool) *corev1.PodTemplateSpec
func (*DeployControllerBizUtilImpl) RenewDeployAnnotation ¶
func (c *DeployControllerBizUtilImpl) RenewDeployAnnotation(ctx context.Context, mc v1beta1.Milvus, currentDeploy *appsv1.Deployment) bool
RenewDeployAnnotation returns true if annotation is updated
func (*DeployControllerBizUtilImpl) ScaleDeployments ¶
func (c *DeployControllerBizUtilImpl) ScaleDeployments(ctx context.Context, mc v1beta1.Milvus, currentDeployment, lastDeployment *appsv1.Deployment) error
ScaleDeployments to current deploymement, we assume both current & last deploy is not nil
func (*DeployControllerBizUtilImpl) ShouldRollback ¶
func (c *DeployControllerBizUtilImpl) ShouldRollback(ctx context.Context, currentDeploy, lastDeploy *appsv1.Deployment, podTemplate *corev1.PodTemplateSpec) bool
ShouldRollback returns if query node should rollback, it assumes currentDeploy not nil
type DeployControllerImpl ¶
type DeployControllerImpl struct {
// contains filtered or unexported fields
}
DeployControllerImpl is the implementation of DeployController
func NewDeployController ¶
func NewDeployController( bizFactory DeployControllerBizFactory, oneDeployModeController DeployController, rollingModeStatusUpdater RollingModeStatusUpdater) *DeployControllerImpl
NewDeployController returns a DeployController
func (*DeployControllerImpl) Reconcile ¶
func (c *DeployControllerImpl) Reconcile(ctx context.Context, mc v1beta1.Milvus, component MilvusComponent) error
type DeployModeChanger ¶
type DeployModeChanger interface { MarkDeployModeChanging(ctx context.Context, mc v1beta1.Milvus, changing bool) error ChangeToTwoDeployMode(ctx context.Context, mc v1beta1.Milvus) error }
DeployModeChanger changes deploy mode
type DeployModeChangerFactory ¶
type DeployModeChangerFactory interface {
GetDeployModeChanger(component MilvusComponent) DeployModeChanger
}
type DeployModeChangerFactoryImpl ¶
type DeployModeChangerFactoryImpl struct {
// contains filtered or unexported fields
}
func NewDeployModeChangerFactory ¶
func NewDeployModeChangerFactory(cli client.Client, util K8sUtil) *DeployModeChangerFactoryImpl
func (*DeployModeChangerFactoryImpl) GetDeployModeChanger ¶
func (f *DeployModeChangerFactoryImpl) GetDeployModeChanger(component MilvusComponent) DeployModeChanger
type DeployModeChangerImpl ¶
type DeployModeChangerImpl struct {
// contains filtered or unexported fields
}
func NewDeployModeChanger ¶
func NewDeployModeChanger(component MilvusComponent, cli client.Client, util K8sUtil) *DeployModeChangerImpl
func (*DeployModeChangerImpl) ChangeToTwoDeployMode ¶
func (*DeployModeChangerImpl) MarkCurrentDeploy ¶
func (*DeployModeChangerImpl) MarkDeployModeChanging ¶
func (*DeployModeChangerImpl) RecoverDeploy ¶
func (*DeployModeChangerImpl) RecoverReplicaSets ¶
func (*DeployModeChangerImpl) SaveDeleteOldDeploy ¶
func (*DeployModeChangerImpl) SaveDeleteOldReplicaSet ¶
func (*DeployModeChangerImpl) UpdateOldPodLabels ¶
type EndpointCheckCache ¶
type EndpointCheckCache interface { TryStartProbeFor(endpoint []string) bool EndProbeFor(endpoint []string) Get(endpoint []string) (condition *v1beta1.MilvusCondition, found bool) Set(endpoints []string, condition *v1beta1.MilvusCondition) }
EndpointCheckCache coordinates endpoint check to avoid duplicated check for same endpoint
func NewEndpointCheckCacheImpl ¶
func NewEndpointCheckCacheImpl() EndpointCheckCache
type EndpointCheckCacheImpl ¶
type EndpointCheckCacheImpl struct {
// contains filtered or unexported fields
}
EndpointCheckCacheImpl implements EndpointCheckCache
func (EndpointCheckCacheImpl) EndProbeFor ¶
func (e EndpointCheckCacheImpl) EndProbeFor(endpoints []string)
func (EndpointCheckCacheImpl) Get ¶
func (e EndpointCheckCacheImpl) Get(endpoints []string) (condition *v1beta1.MilvusCondition, isUpToDate bool)
func (EndpointCheckCacheImpl) Set ¶
func (e EndpointCheckCacheImpl) Set(endpoints []string, condition *v1beta1.MilvusCondition)
func (EndpointCheckCacheImpl) TryStartProbeFor ¶
func (e EndpointCheckCacheImpl) TryStartProbeFor(endpoints []string) bool
TryStartProbeFor use an atomic int32 to lock the endpoint
type EtcdAuthConfig ¶
type EtcdClient ¶
type EtcdClient interface { Get(ctx context.Context, key string, opts ...clientv3.OpOption) (*clientv3.GetResponse, error) AlarmList(ctx context.Context) (*clientv3.AlarmResponse, error) Close() error }
EtcdClient for mock
type EtcdConditionInfo ¶
type EtcdConditionInfo struct {
Endpoints []string
}
type EtcdEndPointHealth ¶
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
type GroupRunner ¶
type GroupRunner interface { // Run runs a group of funcs by same args, if any func fail, it should return err Run(funcs []Func, ctx context.Context, args ...interface{}) error // RunWithResult runs a group of funcs by same args, returns results with data & err for each func called RunWithResult(funcs []Func, ctx context.Context, args ...interface{}) []Result // RunDiffArgs runs a func by groups of args from @argsArray multiple times, if any failed, it should return err RunDiffArgs(f MilvusReconcileFunc, ctx context.Context, argsArray []*v1beta1.Milvus) error }
GroupRunner does a group of funcs in parallel
type HelmReconciler ¶
type HelmReconciler interface { NewHelmCfg(namespace string) *action.Configuration Reconcile(ctx context.Context, request helm.ChartRequest) error GetValues(namespace, release string) (map[string]interface{}, error) }
HelmReconciler reconciles Helm releases
type ImageInfo ¶
type ImageInfo struct { Image string ImagePullPolicy corev1.PullPolicy }
ImageInfo for image pulling
type K8sStatusClient ¶
type K8sStatusClient interface { client.SubResourceWriter }
K8sStatusClient for mock K8sClient.Status()
type K8sUtil ¶
type K8sUtil interface { // CreateObject if not exist CreateObject(ctx context.Context, obj client.Object) error OrphanDelete(ctx context.Context, obj client.Object) error MarkMilvusComponentGroupId(ctx context.Context, mc v1beta1.Milvus, component MilvusComponent, groupId int) error UpdateAndRequeue(ctx context.Context, obj client.Object) error // SaveObject in controllerrevision SaveObject(ctx context.Context, mc v1beta1.Milvus, name string, obj runtime.Object) error // GetObject from controllerrevision GetSavedObject(ctx context.Context, key client.ObjectKey, obj interface{}) error // read GetOldDeploy(ctx context.Context, mc v1beta1.Milvus, component MilvusComponent) (*appsv1.Deployment, error) ListOldReplicaSets(ctx context.Context, mc v1beta1.Milvus, component MilvusComponent) (appsv1.ReplicaSetList, error) ListOldPods(ctx context.Context, mc v1beta1.Milvus, component MilvusComponent) ([]corev1.Pod, error) ListDeployPods(ctx context.Context, deploy *appsv1.Deployment, component MilvusComponent) ([]corev1.Pod, error) // logic // DeploymentIsStable returns whether deployment is stable // if deployment is not stable, return reason string DeploymentIsStable(deploy *appsv1.Deployment, allPods []corev1.Pod) (isStable bool, reason string) }
type K8sUtilImpl ¶
type K8sUtilImpl struct {
// contains filtered or unexported fields
}
func NewK8sUtil ¶
func NewK8sUtil(cli client.Client) *K8sUtilImpl
func (*K8sUtilImpl) CreateObject ¶
func (*K8sUtilImpl) DeploymentIsStable ¶
func (c *K8sUtilImpl) DeploymentIsStable(deploy *appsv1.Deployment, allPods []corev1.Pod) (isStable bool, reason string)
func (*K8sUtilImpl) GetOldDeploy ¶
func (c *K8sUtilImpl) GetOldDeploy(ctx context.Context, mc v1beta1.Milvus, component MilvusComponent) (*appsv1.Deployment, error)
func (*K8sUtilImpl) GetSavedObject ¶
func (*K8sUtilImpl) ListDeployPods ¶
func (c *K8sUtilImpl) ListDeployPods(ctx context.Context, deploy *appsv1.Deployment, component MilvusComponent) ([]corev1.Pod, error)
func (*K8sUtilImpl) ListOldPods ¶
func (c *K8sUtilImpl) ListOldPods(ctx context.Context, mc v1beta1.Milvus, component MilvusComponent) ([]corev1.Pod, error)
func (*K8sUtilImpl) ListOldReplicaSets ¶
func (c *K8sUtilImpl) ListOldReplicaSets(ctx context.Context, mc v1beta1.Milvus, component MilvusComponent) (appsv1.ReplicaSetList, error)
func (*K8sUtilImpl) MarkMilvusComponentGroupId ¶
func (c *K8sUtilImpl) MarkMilvusComponentGroupId(ctx context.Context, mc v1beta1.Milvus, component MilvusComponent, groupId int) error
func (*K8sUtilImpl) OrphanDelete ¶
func (*K8sUtilImpl) SaveObject ¶
func (c *K8sUtilImpl) SaveObject(ctx context.Context, mc v1beta1.Milvus, name string, obj runtime.Object) error
SaveObject in controllerrevision
func (*K8sUtilImpl) UpdateAndRequeue ¶
type LocalHelmReconciler ¶
type LocalHelmReconciler struct {
// contains filtered or unexported fields
}
LocalHelmReconciler implements HelmReconciler at local
func MustNewLocalHelmReconciler ¶
func MustNewLocalHelmReconciler(helmSettings *cli.EnvSettings, logger logr.Logger, mgr manager.Manager) *LocalHelmReconciler
func (*LocalHelmReconciler) GetValues ¶
func (l *LocalHelmReconciler) GetValues(namespace, release string) (map[string]interface{}, error)
func (LocalHelmReconciler) NewHelmCfg ¶
func (l LocalHelmReconciler) NewHelmCfg(namespace string) *action.Configuration
func (LocalHelmReconciler) Reconcile ¶
func (l LocalHelmReconciler) Reconcile(ctx context.Context, request helm.ChartRequest) error
ReconcileHelm reconciles Helm releases
type Manager ¶
type Manager interface { // Add adds a runnable to the Manager Add(manager.Runnable) error // AddHealthzCheck allows you to add a HealthzCheck to the Manager AddHealthzCheck(name string, check healthz.Checker) error // AddReadyzCheck allows you to add a ReadyzCheck to the Manager AddReadyzCheck(name string, check healthz.Checker) error // AddMetricsServerExtraHandler adds an extra handler to the Metrics server AddMetricsServerExtraHandler(path string, handler http.Handler) error // Start starts the Manager and waits for it to be stopped Start(ctx context.Context) error // GetConfig returns the rest.Config used by the Manager GetConfig() *rest.Config // GetScheme returns the scheme.Scheme used by the Manager GetScheme() *runtime.Scheme // GetClient returns the client.Client used by the Manager GetClient() client.Client // GetFieldIndexer returns the client.FieldIndexer used by the Manager GetFieldIndexer() client.FieldIndexer // GetCache returns the cache.Cache used by the Manager GetCache() cache.Cache // GetEventRecorderFor returns a new record.EventRecorder for the provided name GetEventRecorderFor(name string) record.EventRecorder // GetRESTMapper returns the meta.RESTMapper used by the Manager GetRESTMapper() meta.RESTMapper // GetAPIReader returns a client.Reader that will hit the API server GetAPIReader() client.Reader // GetWebhookServer returns the webhook server used by the Manager GetWebhookServer() webhook.Server // GetLogger returns the logger used by the Manager GetLogger() logr.Logger // GetControllerOptions returns the controller options GetControllerOptions() config.Controller // Elected returns a channel that is closed when this Manager is elected leader Elected() <-chan struct{} // GetHTTPClient returns the http.Client used by the Manager GetHTTPClient() *http.Client }
Manager defines the interface for a controller-runtime manager
type MilvusComponent ¶
MilvusComponent contains basic info of a milvus cluster component
func GetComponentsBySpec ¶
func GetComponentsBySpec(spec v1beta1.MilvusSpec) []MilvusComponent
GetComponentsBySpec returns the components by the spec
func GetExpectedTwoDeployComponents ¶
func GetExpectedTwoDeployComponents(spec v1beta1.MilvusSpec) []MilvusComponent
func (MilvusComponent) GetComponentPort ¶
func (c MilvusComponent) GetComponentPort(spec v1beta1.MilvusSpec) int32
GetComponentPort returns the port of the component
func (MilvusComponent) GetComponentSpec ¶
func (c MilvusComponent) GetComponentSpec(spec v1beta1.MilvusSpec) v1beta1.ComponentSpec
GetComponentSpec returns the component spec
func (MilvusComponent) GetContainerName ¶
func (c MilvusComponent) GetContainerName() string
GetContainerName returns the name of the component container
func (MilvusComponent) GetDependencies ¶
func (c MilvusComponent) GetDependencies(spec v1beta1.MilvusSpec) []MilvusComponent
func (MilvusComponent) GetDeploymentName ¶
func (c MilvusComponent) GetDeploymentName(instance string) string
GetDeploymentName returns the name of the component deployment
func (MilvusComponent) GetDeploymentStrategy ¶
func (c MilvusComponent) GetDeploymentStrategy(configs map[string]interface{}) appsv1.DeploymentStrategy
func (MilvusComponent) GetInitContainers ¶
func (c MilvusComponent) GetInitContainers(spec v1beta1.MilvusSpec) []corev1.Container
GetInitContainers returns the component init containers
func (MilvusComponent) GetLeastReplicasRegardingHPA ¶
func (c MilvusComponent) GetLeastReplicasRegardingHPA(spec v1beta1.MilvusSpec) int32
GetLeastReplicasRegardingHPA returns the least replicas for the component regarding HPA
func (MilvusComponent) GetMilvusReplicas ¶
func (c MilvusComponent) GetMilvusReplicas(status *v1beta1.MilvusReplicas) int
SetStatusReplica sets the replica status of the component, input status should not be nil
func (MilvusComponent) GetName ¶
func (c MilvusComponent) GetName() string
String returns the name of the component
func (MilvusComponent) GetPortName ¶
func (c MilvusComponent) GetPortName() string
GetPortName returns the port name of the component container
func (MilvusComponent) GetReplicas ¶
func (c MilvusComponent) GetReplicas(spec v1beta1.MilvusSpec) *int32
GetReplicas returns the replicas for the component
func (MilvusComponent) GetRestfulPort ¶
func (c MilvusComponent) GetRestfulPort(spec v1beta1.MilvusSpec) int32
GetComponentPort returns the port of the component
func (MilvusComponent) GetRunCommands ¶
func (c MilvusComponent) GetRunCommands() []string
String returns the name of the component
func (MilvusComponent) GetServicePorts ¶
func (c MilvusComponent) GetServicePorts(spec v1beta1.MilvusSpec) []corev1.ServicePort
GetServicePorts returns the ports of the component service
func (MilvusComponent) GetServiceType ¶
func (c MilvusComponent) GetServiceType(spec v1beta1.MilvusSpec) corev1.ServiceType
GetServiceType returns the type of the component service
func (MilvusComponent) GetSideCars ¶
func (c MilvusComponent) GetSideCars(spec v1beta1.MilvusSpec) []corev1.Container
GetSideCars returns the component sidecar containers
func (MilvusComponent) IsCoord ¶
func (c MilvusComponent) IsCoord() bool
IsCoord return if it's a coord by its name
func (MilvusComponent) IsImageUpdated ¶
func (c MilvusComponent) IsImageUpdated(m *v1beta1.Milvus) bool
IsImageUpdated returns whether the image of the component is updated
func (MilvusComponent) IsNode ¶
func (c MilvusComponent) IsNode() bool
IsCoord return if it's a node by its name
func (MilvusComponent) IsService ¶
func (c MilvusComponent) IsService() bool
func (MilvusComponent) IsStandalone ¶
func (c MilvusComponent) IsStandalone() bool
IsCoord return if it's a coord by its name
func (MilvusComponent) SetReplicas ¶
func (c MilvusComponent) SetReplicas(spec v1beta1.MilvusSpec, replicas *int32) error
GetReplicas returns the replicas for the component
func (MilvusComponent) SetStatusReplicas ¶
func (c MilvusComponent) SetStatusReplicas(status *v1beta1.MilvusReplicas, replicas int)
SetStatusReplica sets the replica status of the component, input status should not be nil
type MilvusEndpointInfo ¶
type MilvusEndpointInfo struct { Namespace string Name string ServiceType corev1.ServiceType Port int32 }
MilvusEndpointInfo info for calculate the endpoint
type MilvusHealthStatusInfo ¶
type MilvusHealthStatusInfo struct { LastState v1beta1.MilvusHealthStatus IsStopping bool IsHealthy bool }
func (MilvusHealthStatusInfo) GetMilvusHealthStatus ¶
func (m MilvusHealthStatusInfo) GetMilvusHealthStatus() v1beta1.MilvusHealthStatus
type MilvusPredicate ¶
func (*MilvusPredicate) Create ¶
func (*MilvusPredicate) Create(e event.CreateEvent) bool
func (*MilvusPredicate) Update ¶
func (*MilvusPredicate) Update(e event.UpdateEvent) bool
type MilvusReconciler ¶
type MilvusReconciler struct { client.Client Scheme *runtime.Scheme // contains filtered or unexported fields }
MilvusReconciler reconciles a Milvus object
func (*MilvusReconciler) Reconcile ¶
Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.
For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.8.3/pkg/reconcile
func (*MilvusReconciler) ReconcileAll ¶
func (*MilvusReconciler) ReconcileComponentDeployment ¶
func (r *MilvusReconciler) ReconcileComponentDeployment( ctx context.Context, mc v1beta1.Milvus, component MilvusComponent, ) error
func (*MilvusReconciler) ReconcileComponentService ¶
func (r *MilvusReconciler) ReconcileComponentService( ctx context.Context, mc v1beta1.Milvus, component MilvusComponent, ) error
func (*MilvusReconciler) ReconcileConfigMaps ¶
func (*MilvusReconciler) ReconcileDeployments ¶
func (*MilvusReconciler) ReconcileEtcd ¶
func (*MilvusReconciler) ReconcileIngress ¶
func (*MilvusReconciler) ReconcileKafka ¶
func (*MilvusReconciler) ReconcileLegacyValues ¶
func (r *MilvusReconciler) ReconcileLegacyValues(ctx context.Context, old, milvus *milvusv1beta1.Milvus) error
func (*MilvusReconciler) ReconcileMilvus ¶
func (*MilvusReconciler) ReconcileMinio ¶
func (*MilvusReconciler) ReconcileMsgStream ¶
func (*MilvusReconciler) ReconcilePVCs ¶
func (*MilvusReconciler) ReconcilePodMonitor ¶
func (*MilvusReconciler) ReconcilePulsar ¶
func (*MilvusReconciler) ReconcileServices ¶
func (*MilvusReconciler) RemoveOldStandlone ¶
func (*MilvusReconciler) SetDefaultStatus ¶
SetDefaultStatus update status if default not set; return true if updated, return false if not, return err if update failed
func (*MilvusReconciler) SetupWithManager ¶
func (r *MilvusReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
func (*MilvusReconciler) VerifyCR ¶
func (r *MilvusReconciler) VerifyCR(ctx context.Context, milvus *milvusv1beta1.Milvus) error
type MilvusStatusSyncer ¶
type MilvusStatusSyncer struct { client.Client sync.Once // contains filtered or unexported fields }
func NewMilvusStatusSyncer ¶
func (*MilvusStatusSyncer) GetEtcdCondition ¶
func (r *MilvusStatusSyncer) GetEtcdCondition(ctx context.Context, mc v1beta1.Milvus) (v1beta1.MilvusCondition, error)
func (*MilvusStatusSyncer) GetMilvusEndpoint ¶
func (*MilvusStatusSyncer) GetMinioCondition ¶
func (r *MilvusStatusSyncer) GetMinioCondition( ctx context.Context, mc v1beta1.Milvus) (v1beta1.MilvusCondition, error)
TODO: rename as GetStorageCondition
func (*MilvusStatusSyncer) GetMsgStreamCondition ¶
func (r *MilvusStatusSyncer) GetMsgStreamCondition( ctx context.Context, mc v1beta1.Milvus) (v1beta1.MilvusCondition, error)
func (*MilvusStatusSyncer) RunIfNot ¶
func (r *MilvusStatusSyncer) RunIfNot()
func (*MilvusStatusSyncer) UpdateIngressStatus ¶
func (*MilvusStatusSyncer) UpdateStatusForNewGeneration ¶
func (r *MilvusStatusSyncer) UpdateStatusForNewGeneration(ctx context.Context, mc *v1beta1.Milvus, checkDependency bool) error
UpdateStatusForNewGeneration updates the status of the Milvus CR. if given checkDependency = true, it will check the dependency conditions
func (*MilvusStatusSyncer) UpdateStatusRoutine ¶
type MilvusStatusSyncerInterface ¶
type MilvusStatusSyncerInterface interface { RunIfNot() UpdateStatusForNewGeneration(ctx context.Context, mc *v1beta1.Milvus, checkDependency bool) error }
MilvusStatusSyncerInterface abstracts MilvusStatusSyncer
type MilvusUpgradeReconciler ¶
type MilvusUpgradeReconciler struct { client.Client Scheme *runtime.Scheme // contains filtered or unexported fields }
MilvusUpgradeReconciler reconciles a MilvusUpgrade object
func NewMilvusUpgradeReconciler ¶
func NewMilvusUpgradeReconciler(client client.Client, scheme *runtime.Scheme) *MilvusUpgradeReconciler
NewMilvusUpgradeReconciler returns a new MilvusUpgradeReconciler
func (*MilvusUpgradeReconciler) BackupMeta ¶
func (r *MilvusUpgradeReconciler) BackupMeta(ctx context.Context, upgrade *v1beta1.MilvusUpgrade, milvus *v1beta1.Milvus) (v1beta1.MilvusUpgradeState, error)
func (*MilvusUpgradeReconciler) DetermineCurrentState ¶
func (r *MilvusUpgradeReconciler) DetermineCurrentState(ctx context.Context, upgrade *v1beta1.MilvusUpgrade) (nextState v1beta1.MilvusUpgradeState)
func (*MilvusUpgradeReconciler) HandleBakupMetaFailed ¶
func (r *MilvusUpgradeReconciler) HandleBakupMetaFailed(ctx context.Context, upgrade *v1beta1.MilvusUpgrade, milvus *v1beta1.Milvus) (v1beta1.MilvusUpgradeState, error)
func (*MilvusUpgradeReconciler) HandleUpgradeFailed ¶
func (r *MilvusUpgradeReconciler) HandleUpgradeFailed(ctx context.Context, upgrade *v1beta1.MilvusUpgrade, milvus *v1beta1.Milvus) (v1beta1.MilvusUpgradeState, error)
func (*MilvusUpgradeReconciler) OldVersionStopping ¶
func (r *MilvusUpgradeReconciler) OldVersionStopping(ctx context.Context, upgrade *v1beta1.MilvusUpgrade, milvus *v1beta1.Milvus) (v1beta1.MilvusUpgradeState, error)
func (*MilvusUpgradeReconciler) Reconcile ¶
func (r *MilvusUpgradeReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the MilvusUpgrade object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.
For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.10.0/pkg/reconcile
func (*MilvusUpgradeReconciler) RollbackNewVersionStopping ¶
func (r *MilvusUpgradeReconciler) RollbackNewVersionStopping(ctx context.Context, upgrade *v1beta1.MilvusUpgrade, milvus *v1beta1.Milvus) (v1beta1.MilvusUpgradeState, error)
func (*MilvusUpgradeReconciler) RollbackOldVersionStarting ¶
func (r *MilvusUpgradeReconciler) RollbackOldVersionStarting(ctx context.Context, upgrade *v1beta1.MilvusUpgrade, milvus *v1beta1.Milvus) (v1beta1.MilvusUpgradeState, error)
func (*MilvusUpgradeReconciler) RollbackRestoringOldMeta ¶
func (r *MilvusUpgradeReconciler) RollbackRestoringOldMeta(ctx context.Context, upgrade *v1beta1.MilvusUpgrade, milvus *v1beta1.Milvus) (v1beta1.MilvusUpgradeState, error)
func (*MilvusUpgradeReconciler) RunStateMachine ¶
func (r *MilvusUpgradeReconciler) RunStateMachine(ctx context.Context, upgrade *v1beta1.MilvusUpgrade) error
func (*MilvusUpgradeReconciler) SetupWithManager ¶
func (r *MilvusUpgradeReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
func (*MilvusUpgradeReconciler) StartingMilvusNewVersion ¶
func (r *MilvusUpgradeReconciler) StartingMilvusNewVersion(ctx context.Context, upgrade *v1beta1.MilvusUpgrade, milvus *v1beta1.Milvus) (v1beta1.MilvusUpgradeState, error)
func (*MilvusUpgradeReconciler) UpdatingMeta ¶
func (r *MilvusUpgradeReconciler) UpdatingMeta(ctx context.Context, upgrade *v1beta1.MilvusUpgrade, milvus *v1beta1.Milvus) (v1beta1.MilvusUpgradeState, error)
type MilvusUpgradeReconcilerCommonFunc ¶
type MilvusUpgradeReconcilerCommonFunc func(ctx context.Context, upgrade *v1beta1.MilvusUpgrade, milvus *v1beta1.Milvus) (nextState v1beta1.MilvusUpgradeState, err error)
type NewEtcdClientFunc ¶
type NewEtcdClientFunc func(cfg clientv3.Config) (EtcdClient, error)
type ParallelGroupRunner ¶
type ParallelGroupRunner struct { }
ParallelGroupRunner is a group runner that run funcs in parallel
func (ParallelGroupRunner) Run ¶
func (ParallelGroupRunner) Run(funcs []Func, ctx context.Context, args ...interface{}) error
Run a group of funcs by same args in parallel, if any func fail, it should return err
func (ParallelGroupRunner) RunDiffArgs ¶
func (ParallelGroupRunner) RunDiffArgs(f MilvusReconcileFunc, ctx context.Context, argsArray []*v1beta1.Milvus) error
RunDiffArgs runs a func by groups of args from @argsArray multiple times, if any failed, it should return err
func (ParallelGroupRunner) RunWithResult ¶
func (ParallelGroupRunner) RunWithResult(funcs []Func, ctx context.Context, args ...interface{}) []Result
RunWithResult runs a group of funcs by same args, returns results with data & err for each func called
type Result ¶
type Result struct { Data interface{} Err error }
Result contains data & err for a func's return
type RollingModeStatusUpdater ¶
func NewRollingModeStatusUpdater ¶
func NewRollingModeStatusUpdater(cli client.Client, bizFactory DeployControllerBizFactory) RollingModeStatusUpdater
type RollingModeStatusUpdaterImpl ¶
type RollingModeStatusUpdaterImpl struct {
// contains filtered or unexported fields
}
Source Files
¶
- component_condition.go
- components.go
- conditions.go
- configmaps.go
- dependencies.go
- dependency_graph.go
- deploy_ctrl.go
- deploy_ctrl_factory.go
- deploy_ctrl_util.go
- deploy_mode_changer.go
- deployment_updater.go
- deployments.go
- endpoint_check_cache.go
- error_detail.go
- external_interfaces.go
- group_runner.go
- groups.go
- ingress.go
- k8s_default_values.go
- manager_interface.go
- metrics.go
- milvus.go
- milvus_controller.go
- milvusupgrade_controller.go
- milvusupgrade_fsm.go
- podmonitor.go
- pvc.go
- rolling_mode_status_updater.go
- rollout_util.go
- services.go
- setup.go
- status_cluster.go
- utils.go