v1

package
v0.9.212 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddNodeStatus

type AddNodeStatus struct {
	AddInstanceID     string `json:"addInstanceID,omitempty"`
	AddInstanceStatus string `json:"addInstanceStatus,omitempty"`
	ErrMsg            string `json:"errMsg,omitempty"`
}

type BaseStepConfig

type BaseStepConfig struct {
	// +kubebuilder:validation:Optional
	// +kubebuilder:default:false
	EnableNotification bool `json:"enableNotification,omitempty"`

	// +kubebuilder:validation:Optional
	// +kubebuilder:default:false
	LifeCycle *StepLifecycle `json:"lifeCycle,omitempty"`
}

type ConditionReconcileStepsConfig

type ConditionReconcileStepsConfig struct {
	// +kubebuilder:validation:Optional
	Steps []StepName `json:"steps,omitempty"`
	// +kubebuilder:validation:Optional
	MachineRepairContents []string `json:"machineRepairContents,omitempty"`
}

type ConditionStatus

type ConditionStatus string

type ConfigType

type ConfigType string
const (
	ConfigTypeSystemPresetConfig ConfigType = "SystemPresetConfig"
	ConfigTypeCustomConfig       ConfigType = "CustomConfig"
)

type DeleteNodeStatus

type DeleteNodeStatus struct {
	DeleteInstanceID     string `json:"deleteInstanceID,omitempty"`
	DeleteInstanceStatus string `json:"deleteInstanceStatus,omitempty"`
	ErrMsg               string `json:"errMsg,omitempty"`
}

type DrainConfig

type DrainConfig struct {
	BaseStepConfig `json:",inline"`
	// 是否跳过排水
	SkipDrain bool `json:"skipDrain,omitempty"`
	// 是否驱逐 Daemonset 创建的 pod
	EvictDaemonsetPods bool `json:"evictDaemonsetPods,omitempty"`
	// 是否驱逐 StatefulSet 创建的 pod
	EvictStatefulsetPods bool `json:"evictStatefulsetPods,omitempty"`
	// 排水超时时间
	TimeOut int `json:"timeout,omitempty"`
	// 是否强制删除
	Force bool `json:"force,omitempty"`
	// 优雅删除时间
	GracePeriodSeconds int `json:"gracePeriodSeconds,omitempty"`

	SkipWaitForDeleteTimeoutSeconds int `json:"skipWaitForDeleteTimeoutSeconds,omitempty"`
	// 是否删除使用empty dir的pod
	DeleteEmptyDirData bool `json:"deleteEmptyDirData,omitempty"`
	// 是否删除使用host path的pod
	DeleteHostPathData bool `json:"deleteHostPathData,omitempty"`
}

type HTTPHeader

type HTTPHeader struct {
	// The header field name.
	// This will be canonicalized upon output, so case-variant names will be understood as the same header.
	Name string `json:"name" protobuf:"bytes,1,opt,name=name"`
	// The header field value
	Value string `json:"value" protobuf:"bytes,2,opt,name=value"`
}

type HTTPPostActionPayload

type HTTPPostActionPayload struct {
	// ClusterID of k8s cluster
	// +kubebuilder:validation:Optional
	ClusterID string `json:"clusterID,omitempty"`

	// NodeName of k8s node
	// +kubebuilder:validation:Optional
	NodeName string `json:"nodeName,omitempty"`

	// InstanceID of BCC/EBC instance from IaaS
	// +kubebuilder:validation:Optional
	InstanceID string `json:"instanceID,omitempty"`

	// +kubebuilder:validation:Optional
	RemedyTaskName string `json:"remedyTaskName,omitempty"`

	// +kubebuilder:validation:Optional
	RemedyTaskNamespace string `json:"remedyTaskNamespace,omitempty"`

	// StepName of remedy action
	// +kubebuilder:validation:Optional
	StepName string `json:"stepName,omitempty"`

	// HandlerType of executor
	// +kubebuilder:validation:Optional
	HandlerType LifecycleHandlerType `json:"handlerType,omitempty"`
}

type HTTPPostActionResponse

type HTTPPostActionResponse struct {
	// +kubebuilder:validation:Optional
	Result bool `json:"result,omitempty"`
	// +kubebuilder:validation:Optional
	Reason string `json:"reason,omitempty"`
}

type HTTPostAction

type HTTPostAction struct {
	// Path to access on the HTTP server.
	// +kubebuilder:validation:Optional
	Path string `json:"path,omitempty"`
	// Name or number of the port to access on the container.
	// Number must be in the range 1 to 65535.
	// Name must be an IANA_SVC_NAME.
	// +kubebuilder:validation:Optional
	Port IntOrString `json:"port,omitempty"`
	// Host name to connect to, defaults to the pod IP. You probably want to set
	// "Host" in httpHeaders instead.
	// +kubebuilder:validation:Optional
	Host string `json:"host,omitempty"`
	// Scheme to use for connecting to the host.
	// Defaults to HTTP.
	// +kubebuilder:validation:Optional
	Scheme string `json:"scheme,omitempty"`
	// Custom headers to set in the request. HTTP allows repeated headers.
	// +kubebuilder:validation:Optional
	HTTPHeaders []HTTPHeader `json:"httpHeaders,omitempty"`
}

HTTPostAction describes an action based on HTTP Get requests.

type InstancePhase

type InstancePhase string

InstancePhase for CCE K8S Cluster Phase

type InstanceState

type InstanceState string

type IntOrString

type IntOrString struct {
	Type   Type   `protobuf:"varint,1,opt,name=type,casttype=Type"`
	IntVal int32  `protobuf:"varint,2,opt,name=intVal"`
	StrVal string `protobuf:"bytes,3,opt,name=strVal"`
}

type LabelSelector

type LabelSelector struct {
	MatchLabels      map[string]string          `json:"matchLabels,omitempty" protobuf:"bytes,1,rep,name=matchLabels"`
	MatchExpressions []LabelSelectorRequirement `json:"matchExpressions,omitempty" protobuf:"bytes,2,rep,name=matchExpressions"`
}

type LabelSelectorRequirement

type LabelSelectorRequirement struct {
	Key string `json:"key" protobuf:"bytes,1,opt,name=key"`

	Operator string `json:"operator" protobuf:"bytes,2,opt,name=operator,casttype=LabelSelectorOperator"`

	Values []string `json:"values,omitempty" protobuf:"bytes,3,rep,name=values"`
}

type LifecycleHandlerType

type LifecycleHandlerType string
const (
	LifecycleHandlerTypePreExec  LifecycleHandlerType = "preExec"
	LifecycleHandlerTypePostExec LifecycleHandlerType = "postExec"
)

type ListMeta

type ListMeta struct {
	SelfLink string `json:"selfLink,omitempty" protobuf:"bytes,1,opt,name=selfLink"`

	ResourceVersion string `json:"resourceVersion,omitempty" protobuf:"bytes,2,opt,name=resourceVersion"`

	Continue string `json:"continue,omitempty" protobuf:"bytes,3,opt,name=continue"`

	// remainingItemCount is the number of subsequent items in the list which are not included in this
	RemainingItemCount *int64 `json:"remainingItemCount,omitempty" protobuf:"bytes,4,opt,name=remainingItemCount"`
}

ListMeta describes metadata that synthetic resources must have, including lists and various status objects. A resource may have only one of {ObjectMeta, ListMeta}.

type MachineAddConfig

type MachineAddConfig struct {
	BaseStepConfig `json:",inline"`
}

type MachineCordonConfig

type MachineCordonConfig struct {
	BaseStepConfig `json:",inline"`
}

type MachineDeleteConfig

type MachineDeleteConfig struct {
	BaseStepConfig       `json:",inline"`
	KeepInstanceCount    bool `json:"keepInstanceCount,omitempty"`
	KeepPostPaidInstance bool `json:"KeepPostPaidInstance,omitempty"`
}

MachineDeleteConfig define the machine offline config

type MachineDetectRecoveryConfig

type MachineDetectRecoveryConfig struct {
	BaseStepConfig `json:",inline"`
}

type MachineReInstallConfig

type MachineReInstallConfig struct {
	BaseStepConfig `json:",inline"`
	// 机器重装模板
	MachineTemplate string `json:"machineTemplate,omitempty"`
}

MachineReInstallConfig define the machine reinstall config

type MachineRebootConfig

type MachineRebootConfig struct {
	BaseStepConfig `json:",inline"`
	// 重启设置,最多重启次数
	MaxRebootTimes int64 `json:"maxRestartTimes"`
}

MachineRebootConfig define the machine reboot config

type MachineRemediationTemplate

type MachineRemediationTemplate struct {
	Spec RemediationTemplateSpec `json:"spec,omitempty"`
}

MachineRemediationTemplate is the Schema for the machineremediationtemplates API

type MachineRemediationTemplateList

type MachineRemediationTemplateList struct {
	//metav1.TypeMeta `json:",inline"`
	//metav1.ListMeta `json:"metadata,omitempty"`
	Items []MachineRemediationTemplate `json:"items,omitempty"`
}

MachineRemediationTemplateList contains a list of MachineRemediationTemplate

type MachineRepairAuthConfig

type MachineRepairAuthConfig struct {
	Automatic             bool          `json:"automatic,omitempty"`
	RetryInterval         time.Duration `json:"retryInterval,omitempty"`
	RequestAuthWebhookURL string        `json:"requestAuthWebhookURL,omitempty"`
}

type MachineRepairConfig

type MachineRepairConfig struct {
	BaseStepConfig `json:",inline"`
	AuthConfig     MachineRepairAuthConfig `json:"authConfig,omitempty"`
}

type MachineScaleUpConfig

type MachineScaleUpConfig struct {
	BaseStepConfig `json:",inline"`
	// 机器扩容模板
	NodeTemplate string `json:"nodeTemplate,omitempty"`
}

MachineScaleUpConfig define machine increase config

type NodeCondition

type NodeCondition struct {
	// Type of node condition.
	Type NodeConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=NodeConditionType"`
	// Status of the condition, one of True, False, Unknown.
	Status ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=ConditionStatus"`

	LastHeartbeatTime Time `json:"lastHeartbeatTime,omitempty" protobuf:"bytes,3,opt,name=lastHeartbeatTime"`

	LastTransitionTime Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,4,opt,name=lastTransitionTime"`

	Reason string `json:"reason,omitempty" protobuf:"bytes,5,opt,name=reason"`

	Message string `json:"message,omitempty" protobuf:"bytes,6,opt,name=message"`
}

NodeCondition contains condition information for a node.

type NodeConditionType

type NodeConditionType string
const (
	// NodeReady means kubelet is healthy and ready to accept pods.
	NodeReady NodeConditionType = "Ready"
	// NodeMemoryPressure means the kubelet is under pressure due to insufficient available memory.
	NodeMemoryPressure NodeConditionType = "MemoryPressure"
	// NodeDiskPressure means the kubelet is under pressure due to insufficient available disk.
	NodeDiskPressure NodeConditionType = "DiskPressure"
	// NodePIDPressure means the kubelet is under pressure due to insufficient available PID.
	NodePIDPressure NodeConditionType = "PIDPressure"
	// NodeNetworkUnavailable means that network for the node is not correctly configured.
	NodeNetworkUnavailable NodeConditionType = "NetworkUnavailable"
)

type NodeRemediation

type NodeRemediation struct {
	MachineRemediationTemplate *ObjectReference `json:"machineRemediationTemplate,omitempty"`

	NodeRemedierPolicy *NodeRemedierPolicy `json:"nodeRemedierPolicy,omitempty"`
}

type NodeRemedier

type NodeRemedier struct {
	TypeMeta   `json:",inline"`
	ObjectMeta `json:"metadata,omitempty"`

	Spec   NodeRemedierSpec   `json:"spec,omitempty"`
	Status NodeRemedierStatus `json:"status,omitempty"`
}

NodeRemedier is the Schema for the noderemediers API

type NodeRemedierList

type NodeRemedierList struct {
	TypeMeta `json:",inline"`
	ListMeta `json:"metadata,omitempty"`
	Items    []NodeRemedier `json:"items,omitempty"`
}

NodeRemedierList contains a list of NodeRemedier

type NodeRemedierPolicy

type NodeRemedierPolicy struct {
	// 每天最大维修数
	// +kubebuilder:validation:Optional
	MaxNodesPerDay *IntOrString `json:"maxNodesPerDay,omitempty"`
	// 每小时最大维修数
	// +kubebuilder:validation:Optional
	MaxNodesPerHour *IntOrString `json:"maxNodesPerHour,omitempty"`

	// 当前维修最大并发
	// +kubebuilder:validation:Optional
	MaxProcessingNodes *IntOrString `json:"maxProcessingNodes,omitempty"`
	// 同一个node维修最小间隔
	// +kubebuilder:validation:Optional
	MinIntervalPerNode string `json:"minIntervalPerNode,omitempty"`

	// 不健康比例,node达到不健康比例后暂停维修
	// +kubebuilder:validation:Optional
	MaxUnhealthy *IntOrString `json:"maxUnhealthy,omitempty"`
	// [3-5] 只有故障在 3-5 台可以修
	// +kubebuilder:validation:Optional
	UnhealthyRange *string `json:"unhealthyRange,omitempty"`
}

nodeSelector 级别,不同CR的node之间做聚合。例如,一条cr选定十台机器,已经开始维修一台node3。另一条cr选定十台机器,也包括node3,node2也触发故障,此时已经计算维修了一台机器。

type NodeRemedierSpec

type NodeRemedierSpec struct {
	// 是否启用
	// +kubebuilder:validation:Optional
	Paused bool `json:"paused,omitempty"`
	// 集群名称
	ClusterName string `json:"clusterName"`
	// 集群节点
	// +kubebuilder:validation:Optional
	NodeSelector LabelSelector `json:"nodeSelector,omitempty"`
	// 不健康 condition
	// +kubebuilder:validation:Optional
	UnhealthyConditions []UnhealthyCondition `json:"unhealthyConditions,omitempty"`
	// 机器维修设置
	NodeRemediation *NodeRemediation `json:"nodeRemediation,omitempty"`

	// The number of remedyTasks to retain.
	// This is a pointer to distinguish between explicit zero and not specified.
	// Defaults to 10.
	// // +kubebuilder:validation:Optional
	RemedyTaskLimit *int32 `json:"remedyTaskLimit,omitempty"`
}

NodeRemedierSpec defines the desired state of NodeRemedier

type NodeRemedierStatus

type NodeRemedierStatus struct {
	UpdateTime          *Time `json:"updateTime,omitempty"`
	ExpectedNodes       int32 `json:"expectedNodes,omitempty"`
	CurrentHealthy      int32 `json:"currentHealthy,omitempty"`
	RemediationsAllowed int32 `json:"remediationsAllowed,omitempty"`
	// +kubebuilder:validation:Optional
	UnhealthyTarget []UnhealthyTarget `json:"unhealthyTarget,omitempty"`
	// +kubebuilder:validation:Optional
	ProcessTarget []UnhealthyTarget `json:"processTarget,omitempty"`
}

NodeRemedierStatus defines the observed state of NodeRemedier

type NotificationConfig

type NotificationConfig struct {
	WebhookURL string `json:"webhookURL,omitempty"`
}

type ObjectMeta

type ObjectMeta struct {
	// Name must be unique within a namespace. Is required when creating resources, although
	Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"`

	// GenerateName is an optional prefix, used by the server, to generate a unique
	GenerateName string `json:"generateName,omitempty" protobuf:"bytes,2,opt,name=generateName"`

	// Namespace defines the space within which each name must be unique. An empty namespace is
	Namespace string `json:"namespace,omitempty" protobuf:"bytes,3,opt,name=namespace"`

	// Deprecated: selfLink is a legacy read-only field that is no longer populated by the system.
	// +optional
	SelfLink string `json:"selfLink,omitempty" protobuf:"bytes,4,opt,name=selfLink"`

	// UID is the unique in time and space value for this object. It is typically generated by
	UID string `json:"uid,omitempty" protobuf:"bytes,5,opt,name=uid,casttype=k8s.io/kubernetes/pkg/types.UID"`

	ResourceVersion string `json:"resourceVersion,omitempty" protobuf:"bytes,6,opt,name=resourceVersion"`

	Generation int64 `json:"generation,omitempty" protobuf:"varint,7,opt,name=generation"`

	// CreationTimestamp is a timestamp representing the server time when this object was
	CreationTimestamp Time `json:"creationTimestamp,omitempty" protobuf:"bytes,8,opt,name=creationTimestamp"`

	// DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This
	DeletionTimestamp *Time `json:"deletionTimestamp,omitempty" protobuf:"bytes,9,opt,name=deletionTimestamp"`

	// Number of seconds allowed for this object to gracefully terminate before
	DeletionGracePeriodSeconds *int64 `json:"deletionGracePeriodSeconds,omitempty" protobuf:"varint,10,opt,name=deletionGracePeriodSeconds"`

	// Map of string keys and values that can be used to organize and categorize
	Labels map[string]string `json:"labels,omitempty" protobuf:"bytes,11,rep,name=labels"`

	// Annotations is an unstructured key value map stored with a resource that may be
	Annotations map[string]string `json:"annotations,omitempty" protobuf:"bytes,12,rep,name=annotations"`

	OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" patchStrategy:"merge" patchMergeKey:"uid" protobuf:"bytes,13,rep,name=ownerReferences"`

	Finalizers []string `json:"finalizers,omitempty" patchStrategy:"merge" protobuf:"bytes,14,rep,name=finalizers"`
}

ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.

type ObjectReference

type ObjectReference struct {
	// Kind of the referent.
	Kind string `json:"kind,omitempty" protobuf:"bytes,1,opt,name=kind"`
	// Namespace of the referent.
	Namespace string `json:"namespace,omitempty" protobuf:"bytes,2,opt,name=namespace"`
	// Name of the referent.
	Name string `json:"name,omitempty" protobuf:"bytes,3,opt,name=name"`

	UID string `json:"uid,omitempty" protobuf:"bytes,4,opt,name=uid,casttype=k8s.io/apimachinery/pkg/types.UID"`

	APIVersion string `json:"apiVersion,omitempty" protobuf:"bytes,5,opt,name=apiVersion"`

	ResourceVersion string `json:"resourceVersion,omitempty" protobuf:"bytes,6,opt,name=resourceVersion"`

	FieldPath string `json:"fieldPath,omitempty" protobuf:"bytes,7,opt,name=fieldPath"`
}

type OwnerReference

type OwnerReference struct {
	APIVersion string `json:"apiVersion" protobuf:"bytes,5,opt,name=apiVersion"`

	Kind string `json:"kind" protobuf:"bytes,1,opt,name=kind"`

	Name string `json:"name" protobuf:"bytes,3,opt,name=name"`

	UID string `json:"uid" protobuf:"bytes,4,opt,name=uid,casttype=k8s.io/apimachinery/pkg/types.UID"`

	Controller *bool `json:"controller,omitempty" protobuf:"varint,6,opt,name=controller"`

	BlockOwnerDeletion *bool `json:"blockOwnerDeletion,omitempty" protobuf:"varint,7,opt,name=blockOwnerDeletion"`
}

type RemediationTemplateSpec

type RemediationTemplateSpec struct {
	// 节点provider
	NodeProvider string `json:"nodeProvider"`
	// 是否暂停维修
	// +kubebuilder:validation:Optional
	Paused bool `json:"paused,omitempty"`
	// 步骤间最小间隔,每个步骤维修后,需等待大于NPD上报周期的时间后,才能判断是否真正修复
	// MinIntervalByStep int64 `json:"minIntervalByStep,omitempty"`
	// 封锁设置
	// +kubebuilder:validation:Optional
	MachineCordonConfig MachineCordonConfig `json:"machineCordonConfig,omitempty"`
	// 排水设置
	// +kubebuilder:validation:Optional
	DrainConfig DrainConfig `json:"drainConfig,omitempty"`
	// 维修设置
	// +kubebuilder:validation:Optional
	MachineRepairConfig MachineRepairConfig `json:"machineRepairConfig,omitempty"`
	// 机器 重启设置
	// +kubebuilder:validation:Optional
	MachineRebootConfig MachineRebootConfig `json:"machineRebootConfig,omitempty"`
	// 机器 重启设置
	// +kubebuilder:validation:Optional
	MachineAddConfig MachineAddConfig `json:"machineAddConfig,omitempty"`
	// 机器 下线设置
	// +kubebuilder:validation:Optional
	MachineDeleteConfig MachineDeleteConfig `json:"machineDeleteConfig,omitempty"`
	// 机器 重装设置
	// +kubebuilder:validation:Optional
	MachineReInstallConfig MachineReInstallConfig `json:"machineReInstallConfig,omitempty"`
	// 机器 扩容设置
	// +kubebuilder:validation:Optional
	MachineScaleUpConfig MachineScaleUpConfig `json:"machineScaleUpConfig,omitempty"`
	// 机器 检测故障恢复配置
	// +kubebuilder:validation:Optional
	MachineDetectRecoveryConfig MachineDetectRecoveryConfig `json:"machineDetectRecoveryConfig,omitempty"`
	// 维修步骤的通知配置
	// +kubebuilder:validation:Optional
	NotificationConfig NotificationConfig `json:"notificationConfig,omitempty"`
	// 维修步骤
	// +kubebuilder:validation:Optional
	ReconcileSteps []StepName `json:"reconcileSteps,omitempty"`
}

RemediationTemplateSpec defines the desired state of MachineRemediationTemplate

type RemedyMachine

type RemedyMachine struct {
	TypeMeta   `json:",inline"`
	ObjectMeta `json:"metadata,omitempty"`

	Spec   RemedyMachineSpec   `json:"spec,omitempty"`
	Status RemedyMachineStatus `json:"status,omitempty"`
}

RemedyMachine is the Schema for the remedyMachines API

type RemedyMachineList

type RemedyMachineList struct {
	TypeMeta `json:",inline"`
	ListMeta `json:"metadata,omitempty"`
	Items    []RemedyMachine `json:"items"`
}

RemedyMachineList contains a list of RemedyMachines

type RemedyMachineSpec

type RemedyMachineSpec struct {
	NodeProvider string `json:"nodeProvider,omitempty"`
	// 节点名称
	NodeName string `json:"nodeName"`
	// 集群名称
	ClusterName string `json:"clusterName"`
	// 是否暂停维修
	Paused bool `json:"paused"`
	// 维修步骤
	ReconcileSteps []StepName `json:"reconcileSteps,omitempty"`
	// 排水配置
	DrainConfig DrainConfig `json:"drainConfig,omitempty"`
	// 暂时未使用
	MinIntervalByStep int64 `json:"minIntervalByStep,omitempty"`
	// 维修密码
	MachineRepairConfig MachineRepairConfig `json:"machineRepairConfig,omitempty"`
	// 机器 重启设置
	MachineRebootConfig MachineRebootConfig `json:"machineRebootConfig,omitempty"`
	// 机器 下线设置
	MachineDeleteConfig MachineDeleteConfig `json:"machineDeleteConfig,omitempty"`
	// 机器 重启设置
	MachineReInstallConfig MachineReInstallConfig `json:"machineInstallConfig,omitempty"`
	// 机器 扩容设置
	MachineScaleUpConfig MachineScaleUpConfig `json:"machineScaleUpConfig,omitempty"`
}

RemedyMachineSpec defines the desired state of RemedyMachine

type RemedyMachineStatus

type RemedyMachineStatus struct {
	ReconcileSteps       map[StepName]Step `json:"reconcileSteps,omitempty"`
	ReconcileDeleteSteps map[StepName]Step `json:"reconcileDeleteSteps,omitempty"`
	//corev1.NodeStatus    `json:"nodeStatus,omitempty"`
	InstancePhase InstancePhase `json:"instancePhase,omitempty"`
	LastFinished  *Time         `json:"lastFinished,omitempty"`
	// 最近发起维修时间
	LastStarted *Time `json:"lastStarted,omitempty"`

	Message string `json:"message,omitempty" protobuf:"bytes,3,opt,name=message"`
	Healthy bool   `json:"healthy,omitempty"`
}

RemedyMachineStatus defines the observed state of RemedyMachine

type RemedyTask

type RemedyTask struct {
	TypeMeta   `json:",inline"`
	ObjectMeta `json:"metadata,omitempty"`

	Spec   RemedyTaskSpec   `json:"spec,omitempty"`
	Status RemedyTaskStatus `json:"status,omitempty"`
}

RemedyTask is the Schema for the RemedyTask API

type RemedyTaskList

type RemedyTaskList struct {
	TypeMeta `json:",inline"`
	ListMeta `json:"metadata,omitempty"`
	Items    []RemedyTask `json:"items"`
}

RemedyTaskList contains a list of RemedyTasks

type RemedyTaskSpec

type RemedyTaskSpec struct {
	NodeProvider string `json:"nodeProvider,omitempty"`
	// 节点名称
	NodeName string `json:"nodeName"`
	// 集群名称
	ClusterName string `json:"clusterName"`
	// 是否暂停维修
	Paused bool `json:"paused"`
	// Task 处理的 ConditionType 列表
	ConditionsTypes []string `json:"conditionsTypes,omitempty"`
	// 维修步骤
	ReconcileSteps []StepName `json:"reconcileSteps,omitempty"`
	// 封锁设置
	MachineCordonConfig MachineCordonConfig `json:"machineCordonConfig,omitempty"`
	// 排水配置
	MachineDrainConfig DrainConfig `json:"machineDrainConfig,omitempty"`
	// 执行步骤间的最小事件间隔
	MinIntervalByStep time.Duration `json:"minIntervalByStep,omitempty"`
	// 维修密码
	MachineRepairConfig MachineRepairConfig `json:"machineRepairConfig,omitempty"`
	// 机器 重启设置
	MachineRebootConfig MachineRebootConfig `json:"machineRebootConfig,omitempty"`
	// 机器 添加配置
	MachineAddConfig MachineAddConfig `json:"machineAddConfig,omitempty"`
	// 机器 下线设置
	MachineDeleteConfig MachineDeleteConfig `json:"machineDeleteConfig,omitempty"`
	// 机器 重启设置
	MachineReInstallConfig MachineReInstallConfig `json:"machineInstallConfig,omitempty"`
	// 机器 扩容设置
	MachineScaleUpConfig MachineScaleUpConfig `json:"machineScaleUpConfig,omitempty"`
	// 机器 检测故障恢复配置
	MachineDetectRecoveryConfig MachineDetectRecoveryConfig `json:"machineDetectRecoveryConfig,omitempty"`
	// 维修步骤的通知配置
	NotificationConfig *NotificationConfig `json:"notificationConfig,omitempty"`
}

RemedyTaskSpec defines the desired state of RemedyTask

type RemedyTaskStatus

type RemedyTaskStatus struct {
	ReconcileSteps       map[StepName]Step `json:"reconcileSteps,omitempty"`
	ReconcileDeleteSteps map[StepName]Step `json:"reconcileDeleteSteps,omitempty"`
	InstancePhase        InstancePhase     `json:"instancePhase,omitempty"`
	LastFinished         *Time             `json:"lastFinished,omitempty"`
	// 最近发起维修时间
	LastStarted   *Time  `json:"lastStarted,omitempty"`
	Message       string `json:"message,omitempty"`
	NodeIsHealthy bool   `json:"nodeIsHealthy,omitempty"`
}

RemedyTaskStatus defines the observed state of RemedyTask

type RemedyTasksByCreateTimestamp

type RemedyTasksByCreateTimestamp []RemedyTask

type RepairMachineConfig

type RepairMachineConfig struct {
	BaseStepConfig        `json:",inline"`
	AutomaticAuth         bool   `json:"automaticAuth,omitempty"`
	RequestAuthWebhookURL string `json:"requestAuthWebhookURL,omitempty"`
}

EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.

type SSHKey

type SSHKey struct {
	User     string `json:"user,omitempty"`
	Password string `json:"password,omitempty"`
}

type Step

type Step struct {
	Finish       bool          `json:"finish"`                 // 整个 step 完成,包含成功或者失败
	Successful   bool          `json:"successful"`             // 步骤是否成功,比如重启,失败或者成功
	StepStatus   InstancePhase `json:"stepStatus"`             // 当前步骤状态
	StartTime    *Time         `json:"startTime,omitempty"`    // 第一次开始时间
	FinishedTime *Time         `json:"finishedTime,omitempty"` // 最后一次成功时间
	CostSeconds  int           `json:"costSeconds,omitempty"`  // 花费时间
	RetryCount   int           `json:"retryCount,omitempty"`   // 重试次数
	ErrMsg       string        `json:"errMsg,omitempty"`       // 失败信息
	NeedCheck    bool          `json:"needCheck,omitempty"`    // 已经发起请求,需要checking执行状态
	CheckingTime *Time         `json:"checkingTime,omitempty"` // 最近一次检查时间

	// task 授权结果
	AuthorizedStatus *TaskAuthorizedStatus `json:"authorizedStatus,omitempty"`
	// 用户确认机器恢复
	UserConfirmedStatus *UserConfirmedStatus `json:"userConfirmedStatus,omitempty"`

	// 添加节点状态
	AddNodeStatus *AddNodeStatus `json:"addNodeStatus,omitempty"`
	// 删除节点状态
	DeleteNodeStatus *DeleteNodeStatus `json:"deleteNodeStatus,omitempty"`
}

Step 定义 Reconcile/ReconcileDelete 过程中耗时和状态 * 1. 发起步骤 StartTime,Ready为false 2. 步骤成功

type StepLifecycle

type StepLifecycle struct {
	// +kubebuilder:validation:Optional
	// +kubebuilder:default:false
	PreExec *StepLifecycleHandler `json:"preExec,omitempty"`

	// +kubebuilder:validation:Optional
	// +kubebuilder:default:false
	PostExec *StepLifecycleHandler `json:"postExec,omitempty"`
}

type StepLifecycleHandler

type StepLifecycleHandler struct {
	// HTTPPost specifies the http request to perform.
	// +kubebuilder:validation:Optional
	HTTPPost *HTTPostAction `json:"httpPost,omitempty"`
}

StepLifecycleHandler defines a specific action that should be taken in a lifecycle hook. One and only one of the fields.

type StepName

type StepName string

StepName 定义操作步骤名字

const (
	RemedyMachineStepCordonNode              StepName = "CordonNode"
	RemedyMachineStepCordon                  StepName = "Cordon"
	RemedyMachineStepUnCordonNode            StepName = "UnCordonNode"
	RemedyMachineStepUnCordon                StepName = "UnCordon"
	RemedyMachineStepDrainNode               StepName = "DrainNode"
	RemedyMachineStepDrain                   StepName = "Drain"
	RemedyMachineStepRebootNode              StepName = "RebootNode"
	RemedyMachineStepReboot                  StepName = "Reboot"
	RemedyMachineStepDelete                  StepName = "Delete"
	RemedyMachineStepDeleteNode              StepName = "DeleteNode"
	RemedyMachineStepReinstallNode           StepName = "ReInstallNode"
	RemedyMachineStepReinstall               StepName = "ReInstall"
	RemedyMachineStepRestartKubelet          StepName = "RestartKubelet"
	RemedyMachineStepRestartContainerRuntime StepName = "RestartContainerRuntime"
	RemedyMachineStepRepairNode              StepName = "RepairNode"
	RemedyMachineStepDetectRecovery          StepName = "DetectRecovery"
	RemedyMachineStepAddNode                 StepName = "AddNode"
)

节点维修

type TaskAuthorizedStatus

type TaskAuthorizedStatus struct {
	Authorized      bool  `json:"authorized"`
	LastRequestTime *Time `json:"lastRequestTime,omitempty"`
}

type Time

type Time struct {
	time.Time `protobuf:"-"`
}

type Type

type Type int64

Type represents the stored type of IntOrString.

const (
	Int    Type = iota // The IntOrString holds an int.
	String             // The IntOrString holds a string.
)

type TypeMeta

type TypeMeta struct {
	// Kind is a string value representing the REST resource this object represents.
	Kind string `json:"kind,omitempty" protobuf:"bytes,1,opt,name=kind"`

	// APIVersion defines the versioned schema of this representation of an object.
	APIVersion string `json:"apiVersion,omitempty" protobuf:"bytes,2,opt,name=apiVersion"`
}

type UnhealthyCondition

type UnhealthyCondition struct {
	// 故障维修优先级, 默认为 0, 0 ~ 1000 为软件故障,1000 ~ 2000 为 硬件故障;2000 以上为未定义
	// +kubebuilder:validation:Optional
	Priority int64 `json:"priority,omitempty"`
	// 配置模版类型 自定义 or 预制
	// +kubebuilder:validation:Optional
	ConfigType ConfigType `json:"configType,omitempty"`
	// 开启检测
	// +kubebuilder:validation:Optional
	EnableCheck bool `json:"enableCheck,omitempty"`
	// 开启维修
	// +kubebuilder:validation:Optional
	EnableRemediation bool `json:"enableRemediation,omitempty"`
	// node 状态类型
	// +kubebuilder:validation:Optional
	Type NodeConditionType `json:"type,omitempty"`
	// node 状态
	// +kubebuilder:validation:Optional
	Status ConditionStatus `json:"status,omitempty"`
	// 故障持续时间
	// +kubebuilder:validation:Optional
	Timeout string `json:"timeout,omitempty"`
	// 机器维修模板
	// +kubebuilder:validation:Optional
	MachineRemediationTemplate *ObjectReference `json:"machineRemediationTemplate,omitempty"`
}

Node 故障状态

type UnhealthyTarget

type UnhealthyTarget struct {
	// +kubebuilder:validation:Optional
	Name string `json:"name,omitempty"`
	// +kubebuilder:validation:Optional
	UnhealthyConditions []NodeCondition `json:"unhealthyConditions,omitempty"`
}

type UserConfirmedStatus

type UserConfirmedStatus struct {
	Confirmed bool `json:"confirmed"`
}

Jump to

Keyboard shortcuts

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