controllers

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2021 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const ACLFileLoadDuration time.Duration = time.Millisecond * 500

Defines the time it takes for Redis to load the new config

View Source
const ACLFilePropagationDuration time.Duration = time.Millisecond * 5000

Defines how long it takes for the ACL configmap to be reloaded by the kubelet and visible in the volume mount

Variables

View Source
var EMPTY struct{}

Functions

This section is empty.

Types

type FollowerNode

type FollowerNode struct {
	Pod          *corev1.Pod
	NodeNumber   string
	LeaderNumber string
	RedisID      string
	Failed       bool
	Terminating  bool
}

type LeaderNode

type LeaderNode struct {
	Pod         *corev1.Pod
	NodeNumber  string
	RedisID     string
	Failed      bool
	Terminating bool
	Followers   []FollowerNode
}

type NodeNumbers

type NodeNumbers [2]string // 0: node number, 1: leader number

type RedisClusterReconciler

type RedisClusterReconciler struct {
	client.Client
	Log      logr.Logger
	Scheme   *runtime.Scheme
	RedisCLI *rediscli.RedisCLI
	State    RedisClusterState
}

func (*RedisClusterReconciler) NewRedisClusterView

func (r *RedisClusterReconciler) NewRedisClusterView(redisCluster *dbv1.RedisCluster) (*RedisClusterView, error)

func (*RedisClusterReconciler) Reconcile

func (r *RedisClusterReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error)

func (*RedisClusterReconciler) SetupWithManager

func (r *RedisClusterReconciler) SetupWithManager(mgr ctrl.Manager) error

type RedisClusterState

type RedisClusterState string
const (
	// NotExists: the RedisCluster custom resource has just been created
	NotExists RedisClusterState = "NotExists"

	// InitializingCluster: ConfigMap, Service resources are created; the leader
	// pods are created and clusterized
	InitializingCluster RedisClusterState = "InitializingCluster"

	// InitializingFollowers: followers are added to the cluster
	InitializingFollowers RedisClusterState = "InitializingFollowers"

	// Ready: cluster is up & running as expected
	Ready RedisClusterState = "Ready"

	// Recovering: one ore note nodes are in fail state and are being recreated
	Recovering RedisClusterState = "Recovering"

	// Updating: the cluster is in the middle of a rolling update
	Updating RedisClusterState = "Updating"
)

type RedisClusterView

type RedisClusterView []LeaderNode

Representation of a cluster, each element contains information about a leader

func (*RedisClusterView) HealthyNodeIPs

func (r *RedisClusterView) HealthyNodeIPs() []string

Returns a list with all the IPs of the Redis nodes that are healthy A nod eis healthy if Redis can be reached and is in cluster mode

func (*RedisClusterView) IPs

func (v *RedisClusterView) IPs() []string

Returns a list with all the IPs of the Redis nodes

func (*RedisClusterView) Sort

func (v *RedisClusterView) Sort()

In-place sort of a cluster view - ascending alphabetical order by node number

func (*RedisClusterView) String

func (v *RedisClusterView) String() string

type RedisConfigReconciler

type RedisConfigReconciler struct {
	client.Client
	Log      logr.Logger
	Scheme   *runtime.Scheme
	RedisCLI *rediscli.RedisCLI
}

func (*RedisConfigReconciler) Reconcile

func (r *RedisConfigReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error)

func (*RedisConfigReconciler) SetupWithManager

func (r *RedisConfigReconciler) SetupWithManager(mgr ctrl.Manager) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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