Documentation
¶
Index ¶
- Constants
- Variables
- func TPRName() string
- type BackupPolicy
- type BackupStorageType
- type ClusterCondition
- type ClusterConditionType
- type ClusterPhase
- type ClusterSpec
- type ClusterStatus
- func (cs *ClusterStatus) AppendRecoveringCondition()
- func (cs *ClusterStatus) AppendRemovingDeadMember(name string)
- func (cs *ClusterStatus) AppendScalingDownCondition(from, to int)
- func (cs *ClusterStatus) AppendScalingUpCondition(from, to int)
- func (cs *ClusterStatus) AppendUpgradingCondition(to string, member string)
- func (cs *ClusterStatus) Control()
- func (cs ClusterStatus) Copy() ClusterStatus
- func (cs *ClusterStatus) IsFailed() bool
- func (cs *ClusterStatus) PauseControl()
- func (cs *ClusterStatus) SetPhase(p ClusterPhase)
- func (cs *ClusterStatus) SetReadyCondition()
- func (cs *ClusterStatus) SetReason(r string)
- func (cs *ClusterStatus) SetVersion(v string)
- func (cs *ClusterStatus) UpgradeVersionTo(v string)
- type EtcdCluster
- type EtcdClusterList
- type PVSource
- type PodPolicy
- type RestorePolicy
- type S3Source
- type SelfHostedPolicy
- type StorageSource
Constants ¶
View Source
const ( BackupStorageTypeDefault = "" BackupStorageTypePersistentVolume = "PersistentVolume" BackupStorageTypeS3 = "S3" )
View Source
const ( TPRKind = "cluster" TPRGroup = "etcd.coreos.com" TPRVersion = "v1beta1" )
View Source
const ( ClusterPhaseNone ClusterPhase = "" ClusterPhaseCreating = "Creating" ClusterPhaseRunning = "Running" ClusterPhaseFailed = "Failed" )
View Source
const ( ClusterConditionReady = "Ready" ClusterConditionRemovingDeadMember = "RemovingDeadMember" ClusterConditionRecovering = "Recovering" ClusterConditionScalingUp = "ScalingUp" ClusterConditionScalingDown = "ScalingDown" ClusterConditionUpgrading = "Upgrading" )
Variables ¶
View Source
var (
ErrBackupUnsetRestoreSet = errors.New("spec: backup policy must be set if restore policy is set")
)
Functions ¶
Types ¶
type BackupPolicy ¶
type BackupPolicy struct {
// StorageType specifies the type of storage device to store backup files.
// If it's not set by user, the default is "PersistentVolume".
StorageType BackupStorageType `json:"storageType"`
StorageSource `json:",inline"`
// BackupIntervalInSecond specifies the interval between two backups.
// The default interval is 1800 seconds.
BackupIntervalInSecond int `json:"backupIntervalInSecond"`
// MaxBackups is the maximum number of backup files to retain. 0 is disable backup.
// If backup is disabled, the etcd cluster cannot recover from a
// disaster failure (lose more than half of its members at the same
// time).
MaxBackups int `json:"maxBackups"`
// CleanupBackupsOnClusterDelete tells whether to cleanup backup data if cluster is deleted.
// By default, operator will keep the backup data.
CleanupBackupsOnClusterDelete bool `json:"cleanupBackupsOnClusterDelete"`
}
type ClusterCondition ¶ added in v0.2.0
type ClusterCondition struct {
Type ClusterConditionType `json:"type"`
Reason string `json:"reason"`
TransitionTime time.Time `json:"transitionTime"`
}
type ClusterConditionType ¶ added in v0.2.0
type ClusterConditionType string
type ClusterPhase ¶ added in v0.2.0
type ClusterPhase string
type ClusterSpec ¶
type ClusterSpec struct {
// Size is the expected size of the etcd cluster.
// The etcd-operator will eventually make the size of the running
// cluster equal to the expected size.
// The vaild range of the size is from 1 to 7.
Size int `json:"size"`
// Version is the expected version of the etcd cluster.
// The etcd-operator will eventually make the etcd cluster version
// equal to the expected version.
//
// The version must follow the [semver]( http://semver.org) format, for example "3.1.0".
// Only etcd released versions are supported: https://github.com/coreos/etcd/releases
Version string `json:"version"`
// Paused is to pause the control of the operator for the etcd cluster.
Paused bool `json:"paused,omitempty"`
// Pod defines the policy to create pod for the etcd container.
Pod *PodPolicy `json:"pod,omitempty"`
// Backup defines the policy to backup data of etcd cluster if not nil.
// If backup policy is set but restore policy not, and if a previous backup exists,
// this cluster would face conflict and fail to start.
Backup *BackupPolicy `json:"backup,omitempty"`
// Restore defines the policy to restore cluster form existing backup if not nil.
// It's not allowed if restore policy is set and backup policy not.
Restore *RestorePolicy `json:"restore,omitempty"`
// SelfHosted determines if the etcd cluster is used for a self-hosted
// Kubernetes cluster.
SelfHosted *SelfHostedPolicy `json:"selfHosted,omitempty"`
}
func (*ClusterSpec) Cleanup ¶ added in v0.2.0
func (c *ClusterSpec) Cleanup()
Cleanup cleans up user passed spec, e.g. defaulting, transforming fields. TODO: move this to admission controller
func (*ClusterSpec) Validate ¶ added in v0.2.0
func (c *ClusterSpec) Validate() error
type ClusterStatus ¶ added in v0.2.0
type ClusterStatus struct {
// Phase is the cluster running phase
Phase ClusterPhase `json:"phase"`
Reason string `json:"reason"`
// ControlPuased indicates the operator pauses the control of the cluster.
ControlPaused bool `json:"controlPaused"`
// Condition keeps ten most recent cluster conditions
Conditions []ClusterCondition `json:"conditions"`
// Size is the current size of the cluster
Size int `json:"size"`
// CurrentVersion is the current cluster version
CurrentVersion string `json:"currentVersion"`
// TargetVersion is the version the cluster upgrading to.
// If the cluster is not upgrading, TargetVersion is empty.
TargetVersion string `json:"targetVersion"`
}
func (*ClusterStatus) AppendRecoveringCondition ¶ added in v0.2.0
func (cs *ClusterStatus) AppendRecoveringCondition()
func (*ClusterStatus) AppendRemovingDeadMember ¶ added in v0.2.0
func (cs *ClusterStatus) AppendRemovingDeadMember(name string)
func (*ClusterStatus) AppendScalingDownCondition ¶ added in v0.2.0
func (cs *ClusterStatus) AppendScalingDownCondition(from, to int)
func (*ClusterStatus) AppendScalingUpCondition ¶ added in v0.2.0
func (cs *ClusterStatus) AppendScalingUpCondition(from, to int)
func (*ClusterStatus) AppendUpgradingCondition ¶ added in v0.2.0
func (cs *ClusterStatus) AppendUpgradingCondition(to string, member string)
func (*ClusterStatus) Control ¶ added in v0.2.0
func (cs *ClusterStatus) Control()
func (ClusterStatus) Copy ¶ added in v0.2.0
func (cs ClusterStatus) Copy() ClusterStatus
func (*ClusterStatus) IsFailed ¶ added in v0.2.0
func (cs *ClusterStatus) IsFailed() bool
func (*ClusterStatus) PauseControl ¶ added in v0.2.0
func (cs *ClusterStatus) PauseControl()
func (*ClusterStatus) SetPhase ¶ added in v0.2.0
func (cs *ClusterStatus) SetPhase(p ClusterPhase)
func (*ClusterStatus) SetReadyCondition ¶ added in v0.2.0
func (cs *ClusterStatus) SetReadyCondition()
func (*ClusterStatus) SetReason ¶ added in v0.2.0
func (cs *ClusterStatus) SetReason(r string)
func (*ClusterStatus) SetVersion ¶ added in v0.2.0
func (cs *ClusterStatus) SetVersion(v string)
func (*ClusterStatus) UpgradeVersionTo ¶ added in v0.2.0
func (cs *ClusterStatus) UpgradeVersionTo(v string)
type EtcdCluster ¶
type EtcdCluster struct {
unversioned.TypeMeta `json:",inline"`
v1.ObjectMeta `json:"metadata,omitempty"`
Spec ClusterSpec `json:"spec"`
Status ClusterStatus `json:"status"`
}
func (*EtcdCluster) AsOwner ¶ added in v0.2.0
func (e *EtcdCluster) AsOwner() metatypes.OwnerReference
type EtcdClusterList ¶ added in v0.2.0
type EtcdClusterList struct {
unversioned.TypeMeta `json:",inline"`
// Standard list metadata
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
unversioned.ListMeta `json:"metadata,omitempty"`
// Items is a list of third party objects
Items []EtcdCluster `json:"items"`
}
EtcdClusterList is a list of etcd clusters.
type PVSource ¶ added in v0.2.0
type PVSource struct {
// VolumeSizeInMB specifies the required volume size to perform backups.
// Operator will claim the required size before creating the etcd cluster for backup
// purpose.
// If the snapshot size is larger than the size specified, backup fails.
VolumeSizeInMB int `json:"volumeSizeInMB"`
}
type PodPolicy ¶ added in v0.2.0
type PodPolicy struct {
// NodeSelector specifies a map of key-value pairs. For the pod to be eligible
// to run on a node, the node must have each of the indicated key-value pairs as
// labels.
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
// AntiAffinity determines if the etcd-operator tries to avoid putting
// the etcd members in the same cluster onto the same node.
AntiAffinity bool `json:"antiAffinity"`
}
PodPolicy defines the policy to create pod for the etcd container.
type RestorePolicy ¶ added in v0.2.0
type RestorePolicy struct {
// BackupClusterName is the cluster name of the backup to recover from.
BackupClusterName string `json:"backupClusterName"`
// StorageType specifies the type of storage device to store backup files.
// If not set, the default is "PersistentVolume".
StorageType BackupStorageType `json:"storageType"`
}
RestorePolicy defines the policy to restore cluster form existing backup if not nil.
type SelfHostedPolicy ¶ added in v0.2.0
type SelfHostedPolicy struct {
// BootMemberClientEndpoint specifies a bootstrap member for the cluster.
// If there is no bootstrap member, a completely new cluster will be created.
// The boot member will be removed from the cluster once the self-hosted cluster
// setup successfully.
BootMemberClientEndpoint string `json:"bootMemberClientEndpoint"`
}
type StorageSource ¶ added in v0.2.0
Click to show internal directories.
Click to hide internal directories.