Documentation
¶
Overview ¶
Package v1alpha1 contains API Schema definitions for the v1alpha1 API group +kubebuilder:object:generate=true +groupName=kwebs.cloud
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // GroupVersion is group version used to register these objects GroupVersion = schema.GroupVersion{Group: "kwebs.cloud", 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 )
Functions ¶
This section is empty.
Types ¶
type Node ¶
type Node struct { // StorageClassName references a storage class to allocate volume from StorageClassName string `json:"storageClassName"` // AccessMode allows for overriding implicit ReadWriteOnce accessmode AccessMode corev1.PersistentVolumeAccessMode `json:"accessMode,omitempty"` // Tags for Node Tags NodeTags `json:"tags,omitempty"` }
Node represents a PatroniPostgres node's configuration
func (*Node) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Node.
func (*Node) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Node) GetAccessMode ¶
func (v *Node) GetAccessMode() corev1.PersistentVolumeAccessMode
GetAccessMode returns configured access mode or the implicit ReadWriteOnce
type NodeTags ¶
type NodeTags struct { // NoSync If set to true the node will never be selected as a synchronous replica. NoSync bool `json:"nosync,omitempty"` // NoFailover controls whether this node is allowed to participate in the leader // race and become a leader. Defaults to false, meaning this node _can_ // participate in leader races. NoFailover bool `json:"nofailover,omitempty"` }
NodeTags holds a subset of Patroni tags https://patroni.readthedocs.io/en/latest/yaml_configuration.html#tags
func (*NodeTags) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeTags.
func (*NodeTags) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PatroniPostgres ¶
type PatroniPostgres struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec PatroniPostgresSpec `json:"spec,omitempty"` Status PatroniPostgresStatus `json:"status,omitempty"` }
PatroniPostgres is the Schema for the patronipostgres API
func (*PatroniPostgres) DeepCopy ¶
func (in *PatroniPostgres) DeepCopy() *PatroniPostgres
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PatroniPostgres.
func (*PatroniPostgres) DeepCopyInto ¶
func (in *PatroniPostgres) DeepCopyInto(out *PatroniPostgres)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*PatroniPostgres) DeepCopyObject ¶
func (in *PatroniPostgres) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type PatroniPostgresList ¶
type PatroniPostgresList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []PatroniPostgres `json:"items"` }
PatroniPostgresList contains a list of PatroniPostgres
func (*PatroniPostgresList) DeepCopy ¶
func (in *PatroniPostgresList) DeepCopy() *PatroniPostgresList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PatroniPostgresList.
func (*PatroniPostgresList) DeepCopyInto ¶
func (in *PatroniPostgresList) DeepCopyInto(out *PatroniPostgresList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*PatroniPostgresList) DeepCopyObject ¶
func (in *PatroniPostgresList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type PatroniPostgresSpec ¶
type PatroniPostgresSpec struct { // Ignore marks this instance to be ignored by the operator Ignore bool `json:"ignore,omitempty"` // +kubebuilder:validation:Enum:=13;15 Version int `json:"version"` // Nodes holds nodes's desired configuration. // Thus it implicitly defines the number of PostgreSQL nodes (replicas). // +kubebuilder:validation:MinItems:=1 Nodes []Node `json:"nodes"` // VolumeSize sets size for volumes VolumeSize resource.Quantity `json:"volumeSize"` // ServiceType defines primary service type // +kubebuilder:validation:Enum:=ClusterIP;NodePort;LoadBalancer // +kubebuilder:default:=ClusterIP ServiceType corev1.ServiceType `json:"serviceType,omitempty"` // Annotations will be added to PODs Annotations map[string]string `json:"annotations,omitempty"` // PodAntiAffinityTopologyKey defines topology key used for PodAntiAffinity // empty means no PodAntiAffinity // +optional PodAntiAffinityTopologyKey string `json:"podAntiAffinityTopologyKey,omitempty"` // ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. // If specified, these secrets will be passed to individual puller implementations for them to use. // More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod // +optional // +patchMergeKey=name // +patchStrategy=merge ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"` // NodeSelector is a selector which must be true for the pod to fit on a node. // Selector which must match a node's labels for the pod to be scheduled on that node. // More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ // +optional // +mapType=atomic NodeSelector map[string]string `json:"nodeSelector,omitempty"` // If specified, the pod's scheduling constraints // +optional Affinity *corev1.Affinity `json:"affinity,omitempty"` // If specified, the pod's tolerations. // +optional Tolerations []corev1.Toleration `json:"tolerations,omitempty"` // Compute Resources required by postgres and upgrade containers. // More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ // +optional Resources corev1.ResourceRequirements `json:"resources,omitempty"` // ExtraContainers lists extra containers added to pods // +optional ExtraContainers []corev1.Container `json:"extraContainers,omitempty"` // AccessControl controls access to PostgreSQL service. // If undefined, allows access from anywhere // More info: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#networkpolicyingressrule-v1-networking-k8s-io // +optional AccessControl []networking.NetworkPolicyPeer `json:"accessControl,omitempty"` // AdditionalNetworkPolicyIngress lists additional ingress rules to append to created // NetworkPolicy object. Useful for opening ports for ExtraContainers. // +optional AdditionalNetworkPolicyIngress []networking.NetworkPolicyIngressRule `json:"additionalNetworkPolicyIngress,omitempty"` }
PatroniPostgresSpec defines the desired state of PatroniPostgres
func (*PatroniPostgresSpec) DeepCopy ¶
func (in *PatroniPostgresSpec) DeepCopy() *PatroniPostgresSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PatroniPostgresSpec.
func (*PatroniPostgresSpec) DeepCopyInto ¶
func (in *PatroniPostgresSpec) DeepCopyInto(out *PatroniPostgresSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PatroniPostgresState ¶
type PatroniPostgresState string
PatroniPostgresState represents overall cluster state
const ( PatroniPostgresStateScaling PatroniPostgresState = "scaling" PatroniPostgresStateReady PatroniPostgresState = "ready" PatroniPostgresStateUpgradePreupgrade PatroniPostgresState = "upgrade-preupgrade" PatroniPostgresStateUpgradePreupgradeSync PatroniPostgresState = "upgrade-preupgrade-sync" PatroniPostgresStateUpgradeScaleDown PatroniPostgresState = "upgrade-scaledown" PatroniPostgresStateUpgradePrimary PatroniPostgresState = "upgrade-primary" PatroniPostgresStateUpgradeSecondaries PatroniPostgresState = "upgrade-secondaries" PatroniPostgresStateUpgradePrimaryMove PatroniPostgresState = "upgrade-primary-move" PatroniPostgresStateUpgradePostupgrade PatroniPostgresState = "upgrade-postupgrade" )
type PatroniPostgresStatus ¶
type PatroniPostgresStatus struct { // VolumeStatuses holds status for each allocated volume VolumeStatuses []VolumeStatus `json:"volumeStatuses"` // Ready replicas are ready Ready int32 `json:"ready"` // Version represents current cluster version Version int `json:"version"` // State represents cluster state State PatroniPostgresState `json:"state"` // UpgradeVersion represents upgrade target version UpgradeVersion int `json:"upgradeVersion,omitempty"` }
PatroniPostgresStatus defines the observed state of PatroniPostgres
func (*PatroniPostgresStatus) DeepCopy ¶
func (in *PatroniPostgresStatus) DeepCopy() *PatroniPostgresStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PatroniPostgresStatus.
func (*PatroniPostgresStatus) DeepCopyInto ¶
func (in *PatroniPostgresStatus) DeepCopyInto(out *PatroniPostgresStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type VolumeStatus ¶
type VolumeStatus struct { // ClaimName holds PersistentVolumeClaim's name ClaimName string `json:"claimName"` // Phase mirrors PersistentVolumeClaimStatus.Phase Phase corev1.PersistentVolumeClaimPhase `json:"phase,omitempty"` // Capacity mirrors PersistentVolumeClaimStatus.Capacity[ResourceStorage] Capacity resource.Quantity `json:"capacity,omitempty"` }
func (*VolumeStatus) DeepCopy ¶
func (in *VolumeStatus) DeepCopy() *VolumeStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeStatus.
func (*VolumeStatus) DeepCopyInto ¶
func (in *VolumeStatus) DeepCopyInto(out *VolumeStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.