statefulpod

package
v0.0.0-...-2af97ec Latest Latest
Warning

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

Go to latest
Published: May 22, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ParentNmae = "parentName"
	WaitTime   = time.Duration(time.Second * 2)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type StatefulPodCtrl

type StatefulPodCtrl struct {
	client.Client
	sync.RWMutex
}

func (*StatefulPodCtrl) CoreCtrl

func (s *StatefulPodCtrl) CoreCtrl(ctx context.Context, statefulPod *iapetosapiv1.StatefulPod) (ctrl.Result, error)

StatefulPod 控制器 len(statefulPod.Status.PodStatusMes) < int(*statefulPod.Spec.Size) 扩容 len(statefulPod.Status.PodStatusMes) > int(*statefulPod.Spec.Size) 缩容 len(statefulPod.Status.PodStatusMes) == int(*statefulPod.Spec.Size) 设置 Finalizer,维护

func (*StatefulPodCtrl) MonitorPVCStatus

func (s *StatefulPodCtrl) MonitorPVCStatus(ctx context.Context, pvc *corev1.PersistentVolumeClaim) (ctrl.Result, error)

处理 pvc 不同的 status

func (*StatefulPodCtrl) MonitorPodStatus

func (s *StatefulPodCtrl) MonitorPodStatus(ctx context.Context, pod *corev1.Pod) (ctrl.Result, error)

处理 pod 不同的 status pod 异常退出,重新拉起 pod node 节点失联,新建 pod、pvc pod running 状态,修改 statefulPod.status.PodStatusMes

type StatefulPodCtrlFunc

type StatefulPodCtrlFunc interface {
	CoreCtrl(ctx context.Context, statefulPod *iapetosapiv1.StatefulPod) (ctrl.Result, error)
	MonitorPodStatus(ctx context.Context, pod *corev1.Pod) (ctrl.Result, error)
	MonitorPVCStatus(ctx context.Context, pvc *corev1.PersistentVolumeClaim) (ctrl.Result, error)
}

func NewStatefulPodCtrl

func NewStatefulPodCtrl(client client.Client) StatefulPodCtrlFunc

Directories

Path Synopsis
child_resource_controller

Jump to

Keyboard shortcuts

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