Documentation ¶
Index ¶
- Constants
- type StatefulPodCtrl
- func (s *StatefulPodCtrl) CoreCtrl(ctx context.Context, statefulPod *iapetosapiv1.StatefulPod) (ctrl.Result, error)
- func (s *StatefulPodCtrl) MonitorPVCStatus(ctx context.Context, pvc *corev1.PersistentVolumeClaim) (ctrl.Result, error)
- func (s *StatefulPodCtrl) MonitorPodStatus(ctx context.Context, pod *corev1.Pod) (ctrl.Result, error)
- type StatefulPodCtrlFunc
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 ¶
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
Click to show internal directories.
Click to hide internal directories.