Documentation ¶
Index ¶
- Constants
- func CombineAnnotations(a, b map[string]string) map[string]string
- func GetLastAppliedConfig(set *apps.StatefulSet) (*apps.StatefulSetSpec, *corev1.PodSpec, error)
- func NewReplicaMemberManager(setControl controller.StatefulSetControlInterface, ...) manager.Manager
- func NewSentinelMemberManager(setControl controller.StatefulSetControlInterface, ...) manager.Manager
- type FakeRedisClusterMemberManager
- type FakeReplicaMemberManager
- type FakeSentinelMemberManager
- type Scaler
- type ServiceConfig
- type Upgrader
Constants ¶
const ( // LastAppliedConfigAnnotation is annotation key of last applied configuration LastAppliedConfigAnnotation = "anywhy.github.io/last-applied-configuration" // ImagePullBackOff is the pod state of image pull failed ImagePullBackOff = "ImagePullBackOff" // ErrImagePull is the pod state of image pull failed ErrImagePull = "ErrImagePull" )
Variables ¶
This section is empty.
Functions ¶
func CombineAnnotations ¶
CombineAnnotations merges two annotations maps
func GetLastAppliedConfig ¶
func GetLastAppliedConfig(set *apps.StatefulSet) (*apps.StatefulSetSpec, *corev1.PodSpec, error)
GetLastAppliedConfig get last applied config info from Statefulset's annotation
func NewReplicaMemberManager ¶
func NewReplicaMemberManager( setControl controller.StatefulSetControlInterface, svcControl controller.ServiceControlInterface, svcLister corelisters.ServiceLister, podLister corelisters.PodLister, podControl controller.PodControlInterface, setLister appslisters.StatefulSetLister, redisScaler Scaler, replicaUpgrader Upgrader) manager.Manager
NewReplicaMemberManager new redis instance manager
func NewSentinelMemberManager ¶
func NewSentinelMemberManager( setControl controller.StatefulSetControlInterface, svcControl controller.ServiceControlInterface, svcLister corelisters.ServiceLister, podLister corelisters.PodLister, podControl controller.PodControlInterface, setLister appslisters.StatefulSetLister) manager.Manager
NewSentinelMemberManager new redis sentinel manager
Types ¶
type FakeRedisClusterMemberManager ¶
type FakeRedisClusterMemberManager struct {
// contains filtered or unexported fields
}
FakeRedisClusterMemberManager cluster member manager fake use test
func NewFakeRedisClusterMemberManager ¶
func NewFakeRedisClusterMemberManager() *FakeRedisClusterMemberManager
NewFakeRedisClusterMemberManager new fake instance
func (*FakeRedisClusterMemberManager) SetSyncError ¶
func (frmm *FakeRedisClusterMemberManager) SetSyncError(err error)
SetSyncError sync err
func (*FakeRedisClusterMemberManager) Sync ¶
func (frmm *FakeRedisClusterMemberManager) Sync(_ *v1alpha1.RedisCluster) error
Sync sync info
type FakeReplicaMemberManager ¶
type FakeReplicaMemberManager struct {
// contains filtered or unexported fields
}
FakeReplicaMemberManager rediscluster member manager fake use test
func NewFakeReplicaMemberManager ¶
func NewFakeReplicaMemberManager() *FakeReplicaMemberManager
NewFakeReplicaMemberManager new fake instance
func (*FakeReplicaMemberManager) SetSyncError ¶
func (frmm *FakeReplicaMemberManager) SetSyncError(err error)
SetSyncError sync err
func (*FakeReplicaMemberManager) Sync ¶
func (frmm *FakeReplicaMemberManager) Sync(_ *v1alpha1.RedisCluster) error
Sync sync info
type FakeSentinelMemberManager ¶
type FakeSentinelMemberManager struct {
// contains filtered or unexported fields
}
FakeSentinelMemberManager replica cluster member manager fake use test
func NewFakeSentinelMemberManager ¶
func NewFakeSentinelMemberManager() *FakeSentinelMemberManager
NewFakeSentinelMemberManager new fake instance
func (*FakeSentinelMemberManager) SetSyncError ¶
func (fsmm *FakeSentinelMemberManager) SetSyncError(err error)
SetSyncError sync err
func (*FakeSentinelMemberManager) Sync ¶
func (fsmm *FakeSentinelMemberManager) Sync(_ *v1alpha1.RedisCluster) error
Sync sync info
type Scaler ¶
type Scaler interface { // ScaleOut scales out the cluster ScaleOut(rc *v1alpha1.RedisCluster, newSet *apps.StatefulSet, oldSet *apps.StatefulSet) error // ScaleIn scales in the cluster ScaleIn(rc *v1alpha1.RedisCluster, newSet *apps.StatefulSet, oldSet *apps.StatefulSet) error }
Scaler implements the logic for scaling out or scaling in the cluster.
func NewFakeReplicaScaler ¶
func NewFakeReplicaScaler() Scaler
NewFakeReplicaScaler returns a fake Scaler
func NewReplicaScaler ¶
func NewReplicaScaler( pvcLister corelisters.PersistentVolumeClaimLister, pvcControl controller.PVCControlInterface) Scaler
NewReplicaScaler return redis scaler implement
type ServiceConfig ¶
type ServiceConfig struct { Name string Port int32 SvcLabel func(label.Label) label.Label MemberName func(clusterName string) string Headless bool }
ServiceConfig config to a K8s service
type Upgrader ¶
type Upgrader interface { // Upgrade upgrade the cluster Upgrade(*v1alpha1.RedisCluster, *apps.StatefulSet, *apps.StatefulSet) error }
Upgrader implements the logic for upgrading the redis cluster.
func NewFakeReplicaUpgraderr ¶
func NewFakeReplicaUpgraderr() Upgrader
NewFakeReplicaUpgraderr returns a fakeReplicaUpgrader
func NewReplicaUpgrader ¶
func NewReplicaUpgrader(podControl controller.PodControlInterface, podLister corelisters.PodLister) Upgrader
NewReplicaUpgrader returns a replica cluster Upgrader