Documentation ¶
Index ¶
- Variables
- func Check(ctx context.Context, addr string, authInfo redis.AuthInfo) error
- func DefaultOwnerReferences(pod *corev1.Pod) []metav1.OwnerReference
- func ExposeNodePort(ctx context.Context, client *kubernetes.Clientset, ...) error
- func GetPod(ctx context.Context, client *kubernetes.Clientset, namespace, name string, ...) (*corev1.Pod, error)
- func GetStatefulSet(ctx context.Context, client *kubernetes.Clientset, namespace, name string) (*appv1.StatefulSet, error)
- func Heal(ctx context.Context, c *cli.Context, client *kubernetes.Clientset, ...) error
- func NewCommand(ctx context.Context) *cli.Command
- func Ping(ctx context.Context, addr string, authInfo redis.AuthInfo) error
- func Readiness(ctx context.Context, addr string, authInfo redis.AuthInfo) error
- func RetryGet(f func() error, steps ...int) error
- func RetryGetService(clientset *kubernetes.Clientset, svcNamespace, svcName string, isCluster bool, ...) (*corev1.Service, error)
- func Shutdown(ctx context.Context, c *cli.Context, client *kubernetes.Clientset, ...) error
- func SyncToLocal(ctx context.Context, client *kubernetes.Clientset, ...) ([]byte, error)
- func TcpSocket(ctx context.Context, addr string, t time.Duration) error
- type FailoverAction
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func DefaultOwnerReferences ¶
func DefaultOwnerReferences(pod *corev1.Pod) []metav1.OwnerReference
func ExposeNodePort ¶
func ExposeNodePort(ctx context.Context, client *kubernetes.Clientset, namespace, podName, ipfamily string, nodeportEnabled bool, customPort bool, logger logr.Logger) error
ExposeNodePort
func GetPod ¶
func GetPod(ctx context.Context, client *kubernetes.Clientset, namespace, name string, logger logr.Logger) (*corev1.Pod, error)
GetPod
func GetStatefulSet ¶
func GetStatefulSet(ctx context.Context, client *kubernetes.Clientset, namespace, name string) (*appv1.StatefulSet, error)
GetStatefulSet
func Heal ¶
func Heal(ctx context.Context, c *cli.Context, client *kubernetes.Clientset, logger logr.Logger) error
Heal heal may fail when updated password for redis 4,5
func NewCommand ¶
func RetryGetService ¶
func Shutdown ¶
func Shutdown(ctx context.Context, c *cli.Context, client *kubernetes.Clientset, logger logr.Logger) error
Shutdown 在退出时做 failover
NOTE: 在4.0, 5.0中,在更新密码时,会重启实例。但是由于密码在重启前已经热更新,导致其他脚本无法连接到实例,包括shutdown脚本 为了解决这个问题,针对4,5 版本,会在重启前,先做failover,将master failover 到-0 节点。 由于重启是逆序的,最后一个pod启动成功之后,会使用新密码连接到 master,从而确保服务一直可用,切数据不会丢失
Types ¶
type FailoverAction ¶
type FailoverAction string
const ( NoFailoverAction FailoverAction = "" ForceFailoverAction FailoverAction = "FORCE" TakeoverFailoverAction FailoverAction = "TAKEOVER" )
Click to show internal directories.
Click to hide internal directories.