xstore

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Condition

type Condition struct {
	// Type is the type of the condition
	Type ConditionType `json:"type"`

	// Status is the status of the condition
	Status corev1.ConditionStatus `json:"status"`

	// Last time we probed the condition.
	// +optional
	LastProbeTime *metav1.Time `json:"lastProbeTime,omitempty"`

	// Last time the condition transition from one status to another.
	LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`

	// Unique, one-word, CamelCase reason for the condition's last transition.
	// +optional
	Reason string `json:"reason,omitempty"`

	// Human-readable message indicating details about last transition.
	// +optional
	Message string `json:"message,omitempty"`
}

func (*Condition) DeepCopy

func (in *Condition) DeepCopy() *Condition

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Condition.

func (*Condition) DeepCopyInto

func (in *Condition) DeepCopyInto(out *Condition)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ConditionType

type ConditionType string
const (
	// PodsReady indicates whether all pods in the cluster are ready.
	PodsReady ConditionType = "PodsReady"

	// LeaderReady indicates whether leader is elected in the cluster and ready for requests.
	LeaderReady ConditionType = "LeaderReady"

	// BinlogPurged indicates whether older binlog files are purged.
	BinlogPurged ConditionType = "BinlogPurged"

	// Restorable indicates whether the cluster is restorable.
	Restorable ConditionType = "Restorable"
)

Valid xstore condition types.

type Config

type Config struct {
	Dynamic ControllerConfig `json:"controller,omitempty"`
	Engine  EngineConfig     `json:"engine,omitempty"`
}

func (*Config) DeepCopy

func (in *Config) DeepCopy() *Config

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Config.

func (*Config) DeepCopyInto

func (in *Config) DeepCopyInto(out *Config)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ControllerConfig

type ControllerConfig struct {
	LogPurgeInterval *metav1.Duration `json:"logPurgeInterval,omitempty"`

	// DiskQuota is the limit of data current node can use. This is a soft limit.
	// +optional
	DiskQuota *resource.Quantity `json:"diskQuota,omitempty"`
}

func (*ControllerConfig) DeepCopy

func (in *ControllerConfig) DeepCopy() *ControllerConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControllerConfig.

func (*ControllerConfig) DeepCopyInto

func (in *ControllerConfig) DeepCopyInto(out *ControllerConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type EngineConfig

type EngineConfig struct {
	Template *common.Value `json:"template,omitempty"`
	Override *common.Value `json:"override,omitempty"`
}

func (*EngineConfig) DeepCopy

func (in *EngineConfig) DeepCopy() *EngineConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EngineConfig.

func (*EngineConfig) DeepCopyInto

func (in *EngineConfig) DeepCopyInto(out *EngineConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type HostPathVolume

type HostPathVolume struct {
	// Host or node name if the volume is bound to some node.
	Host string `json:"host,omitempty"`

	// Pod if the volume is bound to some pod.
	Pod string `json:"pod,omitempty"`

	// HostPath of the file/dir.
	HostPath string `json:"hostPath,omitempty"`

	// Type of the host path.
	Type corev1.HostPathType `json:"type,omitempty"`

	// Size of the volume.
	Size int64 `json:"size,omitempty"`
}

func (*HostPathVolume) DeepCopy

func (in *HostPathVolume) DeepCopy() *HostPathVolume

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HostPathVolume.

func (*HostPathVolume) DeepCopyInto

func (in *HostPathVolume) DeepCopyInto(out *HostPathVolume)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type NodeRole

type NodeRole string
const (
	// RoleLeader means it can handle read and write requests both. It's logs are distributed
	// by consensus protocols.
	RoleLeader NodeRole = "Leader"

	// RoleFollower keeps in consistent with leader in either logs and materialized data.
	// It can handle consistent reads but can not handle write requests.
	RoleFollower NodeRole = "Follower"

	// RoleLogger means voter below.
	RoleLogger NodeRole = "logger"

	// RoleLearner means that it just learns the logs and never guarantees to
	// catch up at any given time.
	RoleLearner NodeRole = "Learner"

	// RoleCandidate means that can either be leader or follower.
	RoleCandidate NodeRole = "Candidate"

	// RoleVoter means that it's a logger, keep in consistent with candidates in log but can
	// never be voted to be a leader.
	RoleVoter NodeRole = "Voter"
)

func FromNodeRoleValue

func FromNodeRoleValue(val string) NodeRole

type NodeSet

type NodeSet struct {
	// Name is the name of this node set. Must be unique in specification.
	Name string `json:"name,omitempty"`

	// Role is the role of nodes defined by this node set.
	Role NodeRole `json:"role,omitempty"`

	// Replicas is the number of nodes in this node set.
	// +kubebuilder:validation:Minimum=1
	Replicas int32 `json:"replicas,omitempty"`

	// Template defines the customized template of nodes in current node set. If not
	// specified, controller should use the global template instead. If partially
	// specified, the value used is merged with determined strategy.
	// +optional
	Template *NodeTemplate `json:"template,omitempty"`
}

NodeSet defines a set of xstore nodes shares the same role and template.

func (*NodeSet) DeepCopy

func (in *NodeSet) DeepCopy() *NodeSet

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeSet.

func (*NodeSet) DeepCopyInto

func (in *NodeSet) DeepCopyInto(out *NodeSet)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type NodeSpec

type NodeSpec struct {
	// Image is the image of xstore engine. Controller should fill a default image
	// if not specified.
	Image string `json:"image,omitempty"`

	// ImagePullPolicy describes a policy for if/when to pull a container image (especially
	// for the engine container).
	ImagePullPolicy v1.PullPolicy `json:"imagePullPolicy,omitempty"`

	// ImagePullSecrets represents the secrets for pulling private images.
	ImagePullSecrets []v1.LocalObjectReference `json:"imagePullSecrets,omitempty"`

	// HostNetwork defines whether the node uses the host network. Default is true.
	HostNetwork *bool `json:"hostNetwork,omitempty"`

	// Affinity defines the affinity of the node (pod).
	// +optional
	Affinity *v1.Affinity `json:"affinity,omitempty"`

	// Resources is the requested resources of the node.
	Resources *common.ExtendedResourceRequirements `json:"resources,omitempty"`
}

NodeSpec defines the specification of a xstore node.

func (*NodeSpec) DeepCopy

func (in *NodeSpec) DeepCopy() *NodeSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeSpec.

func (*NodeSpec) DeepCopyInto

func (in *NodeSpec) DeepCopyInto(out *NodeSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type NodeTemplate

type NodeTemplate struct {
	// ObjectMeta is the metadata template only contains labels and annotations.
	ObjectMeta common.PartialObjectMeta `json:"metadata,omitempty"`

	// Spec is the specification of xstore node.
	Spec NodeSpec `json:"spec,omitempty"`
}

NodeTemplate defines the template of a xstore node.

func (*NodeTemplate) DeepCopy

func (in *NodeTemplate) DeepCopy() *NodeTemplate

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeTemplate.

func (*NodeTemplate) DeepCopyInto

func (in *NodeTemplate) DeepCopyInto(out *NodeTemplate)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Phase

type Phase string
const (
	PhaseNew       Phase = ""
	PhasePending   Phase = "Pending"
	PhaseCreating  Phase = "Creating"
	PhaseRunning   Phase = "Running"
	PhaseLocked    Phase = "Locked"
	PhaseUpgrading Phase = "Upgrading"
	PhaseRestoring Phase = "Restoring"
	PhaseRepairing Phase = "Repairing"
	PhaseDeleting  Phase = "Deleting"
	PhaseFailed    Phase = "Failed"
	PhaseUnknown   Phase = "Unknown"
)

Valid phases of xstore.

type PodPorts

type PodPorts map[string]int32

func (PodPorts) DeepCopy

func (in PodPorts) DeepCopy() PodPorts

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodPorts.

func (PodPorts) DeepCopyInto

func (in PodPorts) DeepCopyInto(out *PodPorts)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (PodPorts) ToMap

func (ports PodPorts) ToMap() map[string]int

type Privilege

type Privilege struct {
	// Username is the username of account.
	Username string `json:"username,omitempty"`

	// Password is the password of account. If empty, the controller should
	// generate a random password.
	// +optional
	Password string `json:"password,omitempty"`

	// Host is the host of account. Default is '%' which represents any host.
	// +optional
	Host string `json:"host,omitempty"`
}

func (*Privilege) DeepCopy

func (in *Privilege) DeepCopy() *Privilege

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Privilege.

func (*Privilege) DeepCopyInto

func (in *Privilege) DeepCopyInto(out *Privilege)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Stage

type Stage string
const (
	StageEmpty   Stage = ""
	StageLocking Stage = "Locking"
	StageClean   Stage = "Clean"
)

Valid stages of xstore.

type Topology

type Topology struct {
	// Template is the global node template of xstore.
	Template NodeTemplate `json:"template,omitempty"`

	// NodeSets is the total node sets of xstore.
	NodeSets []NodeSet `json:"nodeSets,omitempty"`
}

Topology defines the topology of xstore, consisting of a global node template and multiple node sets.

func (*Topology) DeepCopy

func (in *Topology) DeepCopy() *Topology

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Topology.

func (*Topology) DeepCopyInto

func (in *Topology) DeepCopyInto(out *Topology)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type UpgradeStrategy

type UpgradeStrategy string
const (
	UpgradeStrategyForce      UpgradeStrategy = "Force"
	UpgradeStrategyBestEffort UpgradeStrategy = "BestEffort"
)

Valid upgrade strategies.

Jump to

Keyboard shortcuts

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