Documentation ¶
Overview ¶
+k8s:deepcopy-gen=package +groupName=clusterlabs.org
Index ¶
- Constants
- Variables
- func GetGeneratedDeepCopyFuncs() []conversion.GeneratedDeepCopyFuncdeprecated
- func Resource(resource string) schema.GroupResource
- type ClusterCondition
- type ClusterConditionType
- type ClusterPhase
- type ClusterSpec
- type ClusterStatus
- func (cs *ClusterStatus) ClearCondition(t ClusterConditionType)
- func (cs *ClusterStatus) Control()
- func (in *ClusterStatus) DeepCopy() *ClusterStatus
- func (in *ClusterStatus) DeepCopyInto(out *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) SetRecoveringCondition()
- func (cs *ClusterStatus) SetScalingDownCondition(from, to int32)
- func (cs *ClusterStatus) SetScalingUpCondition(from, to int32)
- func (cs *ClusterStatus) SetUpgradingCondition(to string)
- func (cs *ClusterStatus) SetVersion(v string)
- func (cs *ClusterStatus) UpgradeVersionTo(v string)
- type MemberSecret
- type MembersStatus
- type PodPolicy
- type ReplicatedStatefulSet
- func (rss *ReplicatedStatefulSet) AsOwner() metav1.OwnerReference
- func (in *ReplicatedStatefulSet) DeepCopy() *ReplicatedStatefulSet
- func (in *ReplicatedStatefulSet) DeepCopyInto(out *ReplicatedStatefulSet)
- func (in *ReplicatedStatefulSet) DeepCopyObject() runtime.Object
- func (rss *ReplicatedStatefulSet) ServiceName() string
- func (rss *ReplicatedStatefulSet) Validate() error
- type ReplicatedStatefulSetList
- type ReplicationCommand
- type StaticTLS
- type TLSPolicy
Constants ¶
const ( StatusCommandKey = "status" SequenceCommandKey = "sequence" StopCommandKey = "stop" SeedCommandKey = "seed" PrimaryCommandKey = "primary" SecondaryCommandKey = "secondary" )
const ( ReplicatedStatefulSetResourceKind = "ReplicatedStatefulSet" ReplicatedStatefulSetResourcePlural = "replicatedstatefulsets" ReplicatedStatefulSetResourceShort = "rss" )
const ( ClusterPhaseNone ClusterPhase = "" ClusterPhaseCreating = "Creating" ClusterPhaseRunning = "Running" ClusterPhasePaused = "Paused" ClusterPhaseFailed = "Failed" // See ./doc/user/conditions_and_events.md ClusterConditionAvailable ClusterConditionType = "Available" ClusterConditionRecovering = "Recovering" ClusterConditionScaling = "Scaling" ClusterConditionUpgrading = "Upgrading" )
Variables ¶
var ( SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) AddToScheme = SchemeBuilder.AddToScheme SchemeGroupVersion = schema.GroupVersion{Group: groupName, Version: "v1alpha1"} ReplicatedStatefulSetCRDName = ReplicatedStatefulSetResourcePlural + "." + groupName )
var ( // TODO: move validation code into separate package. ErrBackupUnsetRestoreSet = errors.New("spec: backup policy must be set if restore policy is set") )
Functions ¶
func GetGeneratedDeepCopyFuncs
deprecated
func GetGeneratedDeepCopyFuncs() []conversion.GeneratedDeepCopyFunc
GetGeneratedDeepCopyFuncs returns the generated funcs, since we aren't registering them.
Deprecated: deepcopy registration will go away when static deepcopy is fully implemented.
func Resource ¶
func Resource(resource string) schema.GroupResource
Resource gets an ReplicatedStatefulSet GroupResource for a specified resource
Types ¶
type ClusterCondition ¶
type ClusterCondition struct { // Type of cluster condition. Type ClusterConditionType `json:"type"` // Status of the condition, one of True, False, Unknown. Status v1.ConditionStatus `json:"status"` // The last time this condition was updated. LastUpdateTime string `json:"lastUpdateTime,omitempty"` // Last time the condition transitioned from one status to another. LastTransitionTime string `json:"lastTransitionTime,omitempty"` // The reason for the condition's last transition. Reason string `json:"reason,omitempty"` // A human readable message indicating details about the transition. Message string `json:"message,omitempty"` }
ClusterCondition represents one current condition of an galera cluster. A condition might not show up if it is not happening. For example, if a cluster is not upgrading, the Upgrading condition would not show up. If a cluster is upgrading and encountered a problem that prevents the upgrade, the Upgrading condition's status will would be False and communicate the problem back.
func (*ClusterCondition) DeepCopy ¶
func (in *ClusterCondition) DeepCopy() *ClusterCondition
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterCondition.
func (*ClusterCondition) DeepCopyInto ¶
func (in *ClusterCondition) DeepCopyInto(out *ClusterCondition)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ClusterConditionType ¶
type ClusterConditionType string
type ClusterPhase ¶
type ClusterPhase string
type ClusterSpec ¶
type ClusterSpec struct { // Size is the expected size of the galera cluster. // The rss-operator will eventually make the size of the running // cluster equal to the expected size. Replicas *int32 `json:"replicas"` Primaries *int32 `json:"primaries,omitempty"` ReconcileInterval *string `json:"reconcileInterval,omitempty"` // An optional list of references to secrets in the same namespace // to use for pulling prometheus and alertmanager images from registries // see http://kubernetes.io/docs/user-guide/images#specifying-imagepullsecrets-on-a-pod ImagePullSecrets []v1.LocalObjectReference `json:"imagePullSecrets,omitempty"` // Paused is to pause the control of the operator for the galera cluster. Paused bool `json:"paused,omitempty"` ChaosLevel *int `json:"chaosLevel"` // Pod defines the policy to create pod for the galera pod. // // Updating Pod does not take effect on any existing galera pods. Pod PodPolicy `json:"pod"` ServicePorts []v1.ServicePort `json:"servicePorts,omitempty"` // galera cluster TLS configuration TLS *TLSPolicy `json:"TLS,omitempty"` // A selector to select which ConfigMaps to mount for loading rule files from. RuleSelector *metav1.LabelSelector `json:"ruleSelector,omitempty"` // Define resources requests and limits for single Pods. Resources v1.ResourceRequirements `json:"resources,omitempty"` // Define which Nodes the Pods are scheduled on. NodeSelector map[string]string `json:"nodeSelector,omitempty"` // ServiceAccountName is the name of the ServiceAccount to use to run the // application Pods. ServiceAccountName string `json:"serviceAccountName,omitempty"` // Secrets is a list of Secrets in the same namespace as the Prometheus // object, which shall be mounted into the Prometheus Pods. // The Secrets are mounted into /etc/prometheus/secrets/<secret-name>. // Secrets changes after initial creation of a Prometheus object are not // reflected in the running Pods. To change the secrets mounted into the // Prometheus Pods, the object must be deleted and recreated with the new list // of secrets. Secrets []string `json:"secrets,omitempty"` // If specified, the pod's scheduling constraints. Affinity *v1.Affinity `json:"affinity,omitempty"` // If specified, the pod's tolerations. Tolerations []v1.Toleration `json:"tolerations,omitempty"` }
func (*ClusterSpec) Cleanup ¶
func (c *ClusterSpec) Cleanup()
Cleanup cleans up user passed spec, e.g. defaulting, transforming fields. TODO: move this to admission controller
func (*ClusterSpec) DeepCopy ¶
func (in *ClusterSpec) DeepCopy() *ClusterSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterSpec.
func (*ClusterSpec) DeepCopyInto ¶
func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ClusterSpec) GetNumPrimaries ¶
func (c *ClusterSpec) GetNumPrimaries() int32
func (*ClusterSpec) GetNumReplicas ¶
func (c *ClusterSpec) GetNumReplicas() int32
func (*ClusterSpec) GetServicePorts ¶
func (c *ClusterSpec) GetServicePorts() []v1.ServicePort
type ClusterStatus ¶
type ClusterStatus struct { // Phase is the cluster running phase Phase ClusterPhase `json:"phase"` Reason string `json:"reason,omitempty"` // ControlPuased indicates the operator pauses the control of the cluster. ControlPaused bool `json:"controlPaused,omitempty"` // Condition keeps track of all cluster conditions, if they exist. Conditions []ClusterCondition `json:"conditions,omitempty"` // Size is the current size of the cluster Replicas int `json:"replicas"` RestoreReplicas int `json:"restoreReplicas"` // ServiceName is the LB service for accessing galera nodes. ServiceName string `json:"serviceName,omitempty"` // ClientPort is the port for galera client to access. // It's the same on client LB service and galera nodes. ClientPort int `json:"clientPort,omitempty"` // Members are the galera members in the cluster Members MembersStatus `json:"members"` // 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) ClearCondition ¶
func (cs *ClusterStatus) ClearCondition(t ClusterConditionType)
func (*ClusterStatus) Control ¶
func (cs *ClusterStatus) Control()
func (*ClusterStatus) DeepCopy ¶
func (in *ClusterStatus) DeepCopy() *ClusterStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterStatus.
func (*ClusterStatus) DeepCopyInto ¶
func (in *ClusterStatus) DeepCopyInto(out *ClusterStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ClusterStatus) IsFailed ¶
func (cs *ClusterStatus) IsFailed() bool
func (*ClusterStatus) PauseControl ¶
func (cs *ClusterStatus) PauseControl()
func (*ClusterStatus) SetPhase ¶
func (cs *ClusterStatus) SetPhase(p ClusterPhase)
func (*ClusterStatus) SetReadyCondition ¶
func (cs *ClusterStatus) SetReadyCondition()
func (*ClusterStatus) SetReason ¶
func (cs *ClusterStatus) SetReason(r string)
func (*ClusterStatus) SetRecoveringCondition ¶
func (cs *ClusterStatus) SetRecoveringCondition()
func (*ClusterStatus) SetScalingDownCondition ¶
func (cs *ClusterStatus) SetScalingDownCondition(from, to int32)
func (*ClusterStatus) SetScalingUpCondition ¶
func (cs *ClusterStatus) SetScalingUpCondition(from, to int32)
func (*ClusterStatus) SetUpgradingCondition ¶
func (cs *ClusterStatus) SetUpgradingCondition(to string)
func (*ClusterStatus) SetVersion ¶
func (cs *ClusterStatus) SetVersion(v string)
func (*ClusterStatus) UpgradeVersionTo ¶
func (cs *ClusterStatus) UpgradeVersionTo(v string)
type MemberSecret ¶
type MemberSecret struct { // PeerSecret is the secret containing TLS certs used by each galera member pod // for the communication between galera peers. PeerSecret string `json:"peerSecret,omitempty"` // ServerSecret is the secret containing TLS certs used by each galera member pod // for the communication between galera server and its clients. ServerSecret string `json:"serverSecret,omitempty"` }
func (*MemberSecret) DeepCopy ¶
func (in *MemberSecret) DeepCopy() *MemberSecret
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MemberSecret.
func (*MemberSecret) DeepCopyInto ¶
func (in *MemberSecret) DeepCopyInto(out *MemberSecret)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type MembersStatus ¶
type MembersStatus struct { // Ready are the galera members that are ready to serve requests // The member names are the same as the galera pod names Ready []string `json:"ready,omitempty"` // Unready are the galera members not ready to serve requests Unready []string `json:"unready,omitempty"` Primary []string `json:"primary,omitempty"` Secondary []string `json:"secondary,omitempty"` Failed []string `json:"failed,omitempty"` }
func (*MembersStatus) DeepCopy ¶
func (in *MembersStatus) DeepCopy() *MembersStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MembersStatus.
func (*MembersStatus) DeepCopyInto ¶
func (in *MembersStatus) DeepCopyInto(out *MembersStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PodPolicy ¶
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 rss-operator tries to avoid putting // the galera members in the same cluster onto the same node. AntiAffinity bool `json:"antiAffinity"` // By default, kubernetes will mount a service account token into the galera pods. // AutomountServiceAccountToken indicates whether pods running with the service account should have an API token automatically mounted. AutomountServiceAccountToken *bool `json:"automountServiceAccountToken,omitempty"` Containers []v1.Container `json:"containers"` Volumes []v1.Volume `json:"volumes,omitempty"` VolumeClaimTemplates []v1.PersistentVolumeClaim `json:"volumeClaimTemplates,omitempty"` Commands map[string]ReplicationCommand `json:"commands"` SecurityContext *v1.PodSecurityContext `json:"securityContext"` }
func (*PodPolicy) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodPolicy.
func (*PodPolicy) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ReplicatedStatefulSet ¶
type ReplicatedStatefulSet struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec ClusterSpec `json:"spec"` Status ClusterStatus `json:"status"` }
func (*ReplicatedStatefulSet) AsOwner ¶
func (rss *ReplicatedStatefulSet) AsOwner() metav1.OwnerReference
func (*ReplicatedStatefulSet) DeepCopy ¶
func (in *ReplicatedStatefulSet) DeepCopy() *ReplicatedStatefulSet
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReplicatedStatefulSet.
func (*ReplicatedStatefulSet) DeepCopyInto ¶
func (in *ReplicatedStatefulSet) DeepCopyInto(out *ReplicatedStatefulSet)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ReplicatedStatefulSet) DeepCopyObject ¶
func (in *ReplicatedStatefulSet) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*ReplicatedStatefulSet) ServiceName ¶
func (rss *ReplicatedStatefulSet) ServiceName() string
func (*ReplicatedStatefulSet) Validate ¶
func (rss *ReplicatedStatefulSet) Validate() error
type ReplicatedStatefulSetList ¶
type ReplicatedStatefulSetList struct { metav1.TypeMeta `json:",inline"` // Standard list metadata // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata metav1.ListMeta `json:"metadata,omitempty"` Items []ReplicatedStatefulSet `json:"items"` }
ReplicatedStatefulSetList is a list of galera clusters.
func (*ReplicatedStatefulSetList) DeepCopy ¶
func (in *ReplicatedStatefulSetList) DeepCopy() *ReplicatedStatefulSetList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReplicatedStatefulSetList.
func (*ReplicatedStatefulSetList) DeepCopyInto ¶
func (in *ReplicatedStatefulSetList) DeepCopyInto(out *ReplicatedStatefulSetList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ReplicatedStatefulSetList) DeepCopyObject ¶
func (in *ReplicatedStatefulSetList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type ReplicationCommand ¶
type ReplicationCommand struct { Timeout *string `json:"timeout,omitempty"` Command []string `json:"command"` }
func (*ReplicationCommand) DeepCopy ¶
func (in *ReplicationCommand) DeepCopy() *ReplicationCommand
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReplicationCommand.
func (*ReplicationCommand) DeepCopyInto ¶
func (in *ReplicationCommand) DeepCopyInto(out *ReplicationCommand)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type StaticTLS ¶
type StaticTLS struct { // Member contains secrets containing TLS certs used by each galera member pod. Member *MemberSecret `json:"member,omitempty"` // OperatorSecret is the secret containing TLS certs used by operator to // talk securely to this cluster. OperatorSecret string `json:"operatorSecret,omitempty"` }
func (*StaticTLS) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StaticTLS.
func (*StaticTLS) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type TLSPolicy ¶
type TLSPolicy struct { // StaticTLS enables user to generate static x509 certificates and keys, // put them into Kubernetes secrets, and specify them into here. Static *StaticTLS `json:"static,omitempty"` }
TLSPolicy defines the TLS policy of an galera cluster
func (*TLSPolicy) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TLSPolicy.
func (*TLSPolicy) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.