member

package
v0.0.0-...-12521ac Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2019 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
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

func CombineAnnotations(a, b map[string]string) map[string]string

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

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

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

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

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

Jump to

Keyboard shortcuts

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