Documentation ¶
Overview ¶
Package v1alpha1 contains API Schema definitions for the cache v1alpha1 API group +kubebuilder:object:generate=true +groupName=zk.cache.ghostbaby.io
Index ¶
- Variables
- func Int32(v int32) *int32
- func ResourceCpuString2Int(resource string) int64
- func ResourceMemString2Int(resource string) int64
- type CPUAndMem
- type ChangeBudget
- type ClusterSpec
- type ExporterSpec
- type GroupingDefinition
- type MembersStatus
- type PodAffinity
- type Resources
- type Storage
- type UpdateStrategy
- type Workload
- func (r *Workload) CheckResourceCpu(limit string, request string) *field.Error
- func (r *Workload) CheckResourceMem(limit string, request string) *field.Error
- func (in *Workload) DeepCopy() *Workload
- func (in *Workload) DeepCopyInto(out *Workload)
- func (in *Workload) DeepCopyObject() runtime.Object
- func (r *Workload) Default()
- func (r *Workload) SetupWebhookWithManager(mgr ctrl.Manager) error
- func (r *Workload) ValidateCreate() error
- func (r *Workload) ValidateDelete() error
- func (r *Workload) ValidateUpdate(old runtime.Object) error
- type WorkloadList
- type WorkloadSpec
- type WorkloadStatus
- type ZkResource
- type ZooKeeperOrchestrationPhase
Constants ¶
This section is empty.
Variables ¶
var ( // GroupVersion is group version used to register these objects GroupVersion = schema.GroupVersion{Group: "zk.cache.ghostbaby.io", Version: "v1alpha1"} // SchemeBuilder is used to add go types to the GroupVersionKind scheme SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} // AddToScheme adds the types in this group-version to the given scheme. AddToScheme = SchemeBuilder.AddToScheme )
var DefaultChangeBudget = ChangeBudget{ MaxSurge: nil, MaxUnavailable: Int32(1), }
DefaultChangeBudget is used when no change budget is provided. It might not be the most effective, but should work in most cases.
Functions ¶
func ResourceCpuString2Int ¶
func ResourceMemString2Int ¶
Types ¶
type CPUAndMem ¶
CPUAndMem defines how many cpu and ram the container will request/limit
func (*CPUAndMem) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CPUAndMem.
func (*CPUAndMem) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ChangeBudget ¶
type ChangeBudget struct { MaxSurge *int32 `json:"maxSurge"` }
ChangeBudget defines how Pods in a single group should be updated.
func (*ChangeBudget) DeepCopy ¶
func (in *ChangeBudget) DeepCopy() *ChangeBudget
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChangeBudget.
func (*ChangeBudget) DeepCopyInto ¶
func (in *ChangeBudget) DeepCopyInto(out *ChangeBudget)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ClusterSpec ¶
type ClusterSpec struct { // Name is a logical name for this set of nodes. Used as a part of the managed Elasticsearch node.name setting. // +kubebuilder:validation:Pattern=[a-zA-Z0-9-]+ // +kubebuilder:validation:MaxLength=23 Name string `json:"name"` Storage Storage `json:"storage,omitempty"` Exporter *ExporterSpec `json:"exporter,omitempty"` Resources *Resources `json:"resources,omitempty"` }
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.
type ExporterSpec ¶
type ExporterSpec struct { Exporter bool `json:"exporter,omitempty"` ExporterImage string `json:"exporterImage,omitempty"` ExporterVersion string `json:"exporterVersion,omitempty"` DisableExporterProbes bool `json:"disableExporterProbes,omitempty"` }
func (*ExporterSpec) DeepCopy ¶
func (in *ExporterSpec) DeepCopy() *ExporterSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExporterSpec.
func (*ExporterSpec) DeepCopyInto ¶
func (in *ExporterSpec) DeepCopyInto(out *ExporterSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type GroupingDefinition ¶
type GroupingDefinition struct { // Selector is the selector used to match pods. Selector metav1.LabelSelector `json:"selector,omitempty"` }
GroupingDefinition is used to select a group of pods.
func (*GroupingDefinition) DeepCopy ¶
func (in *GroupingDefinition) DeepCopy() *GroupingDefinition
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GroupingDefinition.
func (*GroupingDefinition) DeepCopyInto ¶
func (in *GroupingDefinition) DeepCopyInto(out *GroupingDefinition)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type MembersStatus ¶
MembersStatus is the status of the members of the cluster with both ready and unready node membership lists
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 PodAffinity ¶
type PodAffinity struct { TopologyKey *string `json:"antiAffinityTopologyKey,omitempty"` Advanced *corev1.Affinity `json:"advanced,omitempty"` }
func (*PodAffinity) DeepCopy ¶
func (in *PodAffinity) DeepCopy() *PodAffinity
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodAffinity.
func (*PodAffinity) DeepCopyInto ¶
func (in *PodAffinity) DeepCopyInto(out *PodAffinity)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Resources ¶
type Resources struct { Requests CPUAndMem `json:"requests,omitempty"` Limits CPUAndMem `json:"limits,omitempty"` }
RedisResources sets the limits and requests for a container
func (*Resources) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Resources.
func (*Resources) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Storage ¶
type Storage struct { KeepAfterDeletion bool `json:"keepAfterDeletion,omitempty"` EmptyDir *corev1.EmptyDirVolumeSource `json:"emptyDir,omitempty"` PersistentVolumeClaim *corev1.PersistentVolumeClaim `json:"persistentVolumeClaim,omitempty"` PersistentVolumeSize string `json:"persistentVolumeSize,omitempty"` }
RedisStorage defines the structure used to store the Redis Data
func (*Storage) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Storage.
func (*Storage) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type UpdateStrategy ¶
type UpdateStrategy struct { // Groups is a list of groups that should have their cluster mutations considered in a fair manner with a strict // change budget (not allowing any surge or unavailability) before the entire cluster is reconciled with the // full change budget. Groups []GroupingDefinition `json:"groups,omitempty"` // ChangeBudget is the change budget that should be used when performing mutations to the cluster. ChangeBudget *ChangeBudget `json:"changeBudget,omitempty"` }
func (*UpdateStrategy) DeepCopy ¶
func (in *UpdateStrategy) DeepCopy() *UpdateStrategy
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UpdateStrategy.
func (*UpdateStrategy) DeepCopyInto ¶
func (in *UpdateStrategy) DeepCopyInto(out *UpdateStrategy)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Workload ¶
type Workload struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec WorkloadSpec `json:"spec,omitempty"` Status WorkloadStatus `json:"status,omitempty"` }
Workload is the Schema for the workloads API
func (*Workload) CheckResourceCpu ¶
func (*Workload) CheckResourceMem ¶
func (*Workload) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Workload.
func (*Workload) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Workload) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*Workload) Default ¶
func (r *Workload) Default()
Default implements webhook.Defaulter so a webhook will be registered for the type
func (*Workload) SetupWebhookWithManager ¶
func (*Workload) ValidateCreate ¶
ValidateCreate implements webhook.Validator so a webhook will be registered for the type
func (*Workload) ValidateDelete ¶
ValidateDelete implements webhook.Validator so a webhook will be registered for the type
type WorkloadList ¶
type WorkloadList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []Workload `json:"items"` }
WorkloadList contains a list of Workload
func (*WorkloadList) DeepCopy ¶
func (in *WorkloadList) DeepCopy() *WorkloadList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadList.
func (*WorkloadList) DeepCopyInto ¶
func (in *WorkloadList) DeepCopyInto(out *WorkloadList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*WorkloadList) DeepCopyObject ¶
func (in *WorkloadList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type WorkloadSpec ¶
type WorkloadSpec struct { // Version represents the version of the stack Version string `json:"version,omitempty"` // Image represents the docker image that will be used. Image string `json:"image,omitempty"` Cluster ClusterSpec `json:"cluster,omitempty"` Replicas *int32 `json:"replicas,omitempty"` //PodDisruptionBudget *PodDisruptionBudgetTemplate `json:"podDisruptionBudget,omitempty"` UpdateStrategy UpdateStrategy `json:"updateStrategy,omitempty"` Affinity *PodAffinity `json:"affinity,omitempty"` NodeSelector map[string]string `json:"nodeSelector,omitempty"` Tolerations []corev1.Toleration `json:"tolerations,omitempty"` PriorityClassName string `json:"priorityClassName,omitempty"` Annotations map[string]string `json:"annotations,omitempty"` Labels map[string]string `json:"labels,omitempty"` }
WorkloadSpec defines the desired state of Workload
func (*WorkloadSpec) DeepCopy ¶
func (in *WorkloadSpec) DeepCopy() *WorkloadSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadSpec.
func (*WorkloadSpec) DeepCopyInto ¶
func (in *WorkloadSpec) DeepCopyInto(out *WorkloadSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type WorkloadStatus ¶
type WorkloadStatus struct { LeaderNode string `json:"leaderNode,omitempty"` // ReadyReplicas is the number of number of ready replicas in the cluster AvailableNodes int `json:"availableNodes,omitempty"` // Last time the condition transitioned from one status to another. // +optional LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"` Phase ZooKeeperOrchestrationPhase `json:"phase,omitempty"` // The generation observed by the appConfig controller. // +optional ObservedGeneration int64 `json:"observedGeneration"` }
WorkloadStatus defines the observed state of Workload
func (*WorkloadStatus) DeepCopy ¶
func (in *WorkloadStatus) DeepCopy() *WorkloadStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadStatus.
func (*WorkloadStatus) DeepCopyInto ¶
func (in *WorkloadStatus) DeepCopyInto(out *WorkloadStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ZkResource ¶
type ZkResource struct { RequestCpu *resource.Quantity RequestMem *resource.Quantity LimitCpu *resource.Quantity LimitMem *resource.Quantity }
func (*ZkResource) DeepCopy ¶
func (in *ZkResource) DeepCopy() *ZkResource
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ZkResource.
func (*ZkResource) DeepCopyInto ¶
func (in *ZkResource) DeepCopyInto(out *ZkResource)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ZooKeeperOrchestrationPhase ¶
type ZooKeeperOrchestrationPhase string
const ( // ElasticsearchReadyPhase is operating at the desired spec. ZooKeeperReadyPhase ZooKeeperOrchestrationPhase = "Ready" // ZooKeeperApplyingChangesPhase controller is working towards a desired state, cluster can be unavailable. ZooKeeperApplyingChangesPhase ZooKeeperOrchestrationPhase = "ApplyingChanges" // ZooKeeperMigratingDataPhase ZooKeeper is currently migrating data to another node. ZooKeeperMigratingDataPhase ZooKeeperOrchestrationPhase = "MigratingData" // ZooKeeperResourceInvalid is marking a resource as invalid, should never happen if admission control is installed correctly. ZooKeeperResourceInvalid ZooKeeperOrchestrationPhase = "Invalid" ZooKeeperDownScaling ZooKeeperOrchestrationPhase = "DownScaling" ZooKeeperUpScaling ZooKeeperOrchestrationPhase = "UpScaling" )