shared

package
v0.0.0-...-df89844 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

+k8s:deepcopy-gen=package,register +kubebuilder:object:generate=true +groupName=kdb.com

Index

Constants

View Source
const (
	InstanceStatusRunning = "Running"
	InstanceStatusPending = "Pending"
	InstanceStatusFailed  = "Failed"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerSpec

type ContainerSpec struct {

	// +optional
	Image string `json:"image"`

	// +optional
	Command []string `json:"command,omitempty"`

	// +optional
	Args []string `json:"args,omitempty"`

	// +optional
	Env []corev1.EnvVar `json:"env,omitempty"`

	// +optional
	Resources corev1.ResourceRequirements `json:"resources,omitempty"`
}

ContainerSpec defines the configuration of a container

func (*ContainerSpec) DeepCopy

func (in *ContainerSpec) DeepCopy() *ContainerSpec

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

func (*ContainerSpec) DeepCopyInto

func (in *ContainerSpec) DeepCopyInto(out *ContainerSpec)

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

type InstanceSetSpec

type InstanceSetSpec struct {
	// +optional
	Metadata *Metadata `json:"metadata,omitempty"`

	// Number of desired KDB db pods.
	// +optional
	// +kubebuilder:default=1
	// +kubebuilder:validation:Minimum=1
	Replicas *int32 `json:"replicas,omitempty"`

	// RuntimeClassName refers to a RuntimeClass object in the node.k8s.io group, which should be used
	// to run this pod.  If no RuntimeClass resource matches the named class, the pod will not be run.
	// If unset or empty, the "legacy" RuntimeClass will be used, which is an implicit class with an
	// empty definition that uses the default runtime handler.
	// More info: https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class
	// +optional
	RuntimeClassName *string `json:"runtimeClassName,omitempty"`

	// Priority class name for the KDB pod. Changing this value causes
	// KDB pod to restart.
	// More info: https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/
	// +optional
	PriorityClassName *string `json:"priorityClassName,omitempty"`

	// Scheduling constraints of a KDB pod. Changing this value causes
	// instance to restart.
	// More info: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node
	// +optional
	Affinity *corev1.Affinity `json:"affinity,omitempty"`

	// Tolerations of a KDB pod. Changing this value causes KDB pod to restart.
	// More info: https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration
	// +optional
	Tolerations []corev1.Toleration `json:"tolerations,omitempty"`

	// pod initcontainer
	// +optional
	InitContainer ContainerSpec `json:"initContainer"`

	// pod mysqld container
	// +optional
	MainContainer ContainerSpec `json:"mainContainer"`

	// pod sidecar container
	// +optional
	SidecarContainer ContainerSpec `json:"sidecarContainer"`

	// The specification of monitoring tools that connect to KDB
	// +optional
	MonitorContainer ContainerSpec `json:"monitoring,omitempty"`

	// Defines a PersistentVolumeClaim for KDB db data.
	// More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes
	// +kubebuilder:validation:Required
	DataVolumeClaimSpec PVCSpec `json:"dataVolumeClaimSpec"`

	// Defines a separate PersistentVolumeClaim for KDB's write-ahead log.
	// ep.More info: https://www.postgresql.org/docs/current/wal.html
	// +optional
	LogVolumeClaimSpec *PVCSpec `json:"logVolumeClaimSpec,omitempty"`

	// Topology spread constraints of a KDB pod. Changing this value causes
	// KDB pod to restart.
	// More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/
	// +optional
	TopologySpreadConstraints []corev1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"`
}

func (*InstanceSetSpec) DeepCopy

func (in *InstanceSetSpec) DeepCopy() *InstanceSetSpec

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

func (*InstanceSetSpec) DeepCopyInto

func (in *InstanceSetSpec) DeepCopyInto(out *InstanceSetSpec)

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

func (*InstanceSetSpec) Default

func (s *InstanceSetSpec) Default(i int)

Default sets the default values for an instance set spec, including the name suffix and number of replicas.

type InstanceSetStatus

type InstanceSetStatus struct {
	// Total number of ready pods.
	// +optional
	ReadyReplicas int32 `json:"readyReplicas,omitempty"`

	// Total number of pods.
	// +optional
	Replicas int32 `json:"replicas,omitempty"`

	// Total number of pods that have the desired specification.
	// +optional
	UpdatedReplicas int32 `json:"updatedReplicas,omitempty"`

	// PodInfos contains information about the working pod of mysql instance
	// +optional
	PodInfos []PodStatusInfo `json:"podInfos,omitempty"`
}

InstanceSetStatus instance status

func (*InstanceSetStatus) DeepCopy

func (in *InstanceSetStatus) DeepCopy() *InstanceSetStatus

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

func (*InstanceSetStatus) DeepCopyInto

func (in *InstanceSetStatus) DeepCopyInto(out *InstanceSetStatus)

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

type Metadata

type Metadata struct {
	// +optional
	Labels map[string]string `json:"labels,omitempty"`

	// +optional
	Annotations map[string]string `json:"annotations,omitempty"`
}

Metadata contains metadata for custom resources

func (*Metadata) DeepCopy

func (in *Metadata) DeepCopy() *Metadata

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

func (*Metadata) DeepCopyInto

func (in *Metadata) DeepCopyInto(out *Metadata)

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

func (*Metadata) GetAnnotationsOrNil

func (meta *Metadata) GetAnnotationsOrNil() map[string]string

GetAnnotationsOrNil gets annotations from a Metadata pointer, if Metadata hasn't been set return nil

func (*Metadata) GetLabelsOrNil

func (meta *Metadata) GetLabelsOrNil() map[string]string

GetLabelsOrNil gets labels from a Metadata pointer, if Metadata hasn't been set return nil

type PVCSpec

type PVCSpec struct {
	// +optional
	Metadata *Metadata `json:"metadata,omitempty"`

	// +optional
	StorageClass string `json:"storageClass"`

	Size resource.Quantity `json:"size"`
}

func (*PVCSpec) DeepCopy

func (in *PVCSpec) DeepCopy() *PVCSpec

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

func (*PVCSpec) DeepCopyInto

func (in *PVCSpec) DeepCopyInto(out *PVCSpec)

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

type PodStatusInfo

type PodStatusInfo struct {
	// +optional
	PodName string `json:"podName,omitempty"`

	// PodStatus
	// +optional
	PodPhase corev1.PodPhase `json:"podPhase,omitempty"`

	// +optional
	PodIP string `json:"podIP,omitempty"`

	// +optional
	NodeName string `json:"nodeName,omitempty"`

	// +optional
	HostIP string `json:"hostIP,omitempty"`
}

func (*PodStatusInfo) DeepCopy

func (in *PodStatusInfo) DeepCopy() *PodStatusInfo

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

func (*PodStatusInfo) DeepCopyInto

func (in *PodStatusInfo) DeepCopyInto(out *PodStatusInfo)

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

type SchemalessObject

type SchemalessObject map[string]interface{}

SchemalessObject is a map compatible with JSON object.

Use with the following markers: - kubebuilder:pruning:PreserveUnknownFields - kubebuilder:validation:Schemaless - kubebuilder:validation:Type=object

func (*SchemalessObject) DeepCopy

func (in *SchemalessObject) DeepCopy() *SchemalessObject

DeepCopy creates a new SchemalessObject by copying the receiver.

func (SchemalessObject) DeepCopyInto

func (in SchemalessObject) DeepCopyInto(out *SchemalessObject)

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

type ServiceSpec

type ServiceSpec struct {
	// +optional
	Metadata *Metadata `json:"metadata,omitempty"`

	// The port on which this service is exposed when type is NodePort or
	// LoadBalancer. Value must be in-range and not in use or the operation will
	// fail. If unspecified, a port will be allocated if this Service requires one.
	// - https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport
	// +optional
	NodePort *int32 `json:"nodePort,omitempty"`

	// More info: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types
	//
	// +optional
	// +kubebuilder:default=ClusterIP
	// +kubebuilder:validation:Enum={ClusterIP,NodePort,LoadBalancer}
	Type string `json:"type"`
}

func (*ServiceSpec) DeepCopy

func (in *ServiceSpec) DeepCopy() *ServiceSpec

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

func (*ServiceSpec) DeepCopyInto

func (in *ServiceSpec) DeepCopyInto(out *ServiceSpec)

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

Jump to

Keyboard shortcuts

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