v1alpha1

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the reaper v1alpha1 API group +kubebuilder:object:generate=true +groupName=reaper.k8ssandra.io

Index

Constants

View Source
const (
	ReaperLabel     = "k8ssandra.io/reaper"
	DefaultKeyspace = "reaper_db"
)
View Source
const (
	// ReaperProgressPending is Reaper's status when it's waiting for the datacenter to become ready.
	ReaperProgressPending = ReaperProgress("Pending")
	// ReaperProgressDeploying is Reaper's status when it's waiting for the Reaper instance and its associated service
	// to become ready.
	ReaperProgressDeploying = ReaperProgress("Deploying")
	// ReaperProgressConfiguring is Reaper's status when the Reaper instance is ready for work and is being connected
	// its target datacenter.
	ReaperProgressConfiguring = ReaperProgress("Configuring")
	// ReaperProgressRunning is Reaper's status when Reaper is up and running.
	ReaperProgressRunning = ReaperProgress("Running")
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "reaper.k8ssandra.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
)

Functions

This section is empty.

Types

type AutoScheduling

type AutoScheduling struct {

	// +optional
	// +kubebuilder:default=false
	Enabled bool `json:"enabled,omitempty"`

	// RepairType is the type of repair to create:
	// - REGULAR creates a regular repair (non-adaptive and non-incremental);
	// - ADAPTIVE creates an adaptive repair; adaptive repairs are most suited for Cassandra 3.
	// - INCREMENTAL creates an incremental repair; incremental repairs should only be used with Cassandra 4+.
	// - AUTO chooses between ADAPTIVE and INCREMENTAL depending on the Cassandra server version; ADAPTIVE for Cassandra
	// 3 and INCREMENTAL for Cassandra 4+.
	// +optional
	// +kubebuilder:default="AUTO"
	// +kubebuilder:validation:Enum:=REGULAR;ADAPTIVE;INCREMENTAL;AUTO
	RepairType string `json:"repairType,omitempty"`

	// PercentUnrepairedThreshold is the percentage of unrepaired data over which an incremental repair should be
	// started. Only relevant when using repair type INCREMENTAL.
	// +optional
	// +kubebuilder:default=10
	// +kubebuilder:validation:Minimum=0
	// +kubebuilder:validation:Maximum=100
	PercentUnrepairedThreshold int `json:"percentUnrepairedThreshold,omitempty"`

	// InitialDelay is the amount of delay time before the schedule period starts. Must be a valid ISO-8601 duration
	// string. The default is "PT15S" (15 seconds).
	// +optional
	// +kubebuilder:default="PT15S"
	// +kubebuilder:validation:Pattern:="([-+]?)P(?:([-+]?[0-9]+)D)?(T(?:([-+]?[0-9]+)H)?(?:([-+]?[0-9]+)M)?(?:([-+]?[0-9]+)(?:[.,]([0-9]{0,9}))?S)?)?"
	InitialDelay string `json:"initialDelayPeriod,omitempty"`

	// PeriodBetweenPolls is the interval time to wait before checking whether to start a repair task. Must be a valid
	// ISO-8601 duration string. The default is "PT10M" (10 minutes).
	// +optional
	// +kubebuilder:default="PT10M"
	// +kubebuilder:validation:Pattern:="([-+]?)P(?:([-+]?[0-9]+)D)?(T(?:([-+]?[0-9]+)H)?(?:([-+]?[0-9]+)M)?(?:([-+]?[0-9]+)(?:[.,]([0-9]{0,9}))?S)?)?"
	PeriodBetweenPolls string `json:"periodBetweenPolls,omitempty"`

	// TimeBeforeFirstSchedule is the grace period before the first repair in the schedule is started. Must be a valid
	// ISO-8601 duration string. The default is "PT5M" (5 minutes).
	// +optional
	// +kubebuilder:default="PT5M"
	// +kubebuilder:validation:Pattern:="([-+]?)P(?:([-+]?[0-9]+)D)?(T(?:([-+]?[0-9]+)H)?(?:([-+]?[0-9]+)M)?(?:([-+]?[0-9]+)(?:[.,]([0-9]{0,9}))?S)?)?"
	TimeBeforeFirstSchedule string `json:"timeBeforeFirstSchedule,omitempty"`

	// ScheduleSpreadPeriod is the time spacing between each of the repair schedules that is to be carried out. Must be
	// a valid ISO-8601 duration string. The default is "PT6H" (6 hours).
	// +optional
	// +kubebuilder:default="PT6H"
	// +kubebuilder:validation:Pattern:="([-+]?)P(?:([-+]?[0-9]+)D)?(T(?:([-+]?[0-9]+)H)?(?:([-+]?[0-9]+)M)?(?:([-+]?[0-9]+)(?:[.,]([0-9]{0,9}))?S)?)?"
	ScheduleSpreadPeriod string `json:"scheduleSpreadPeriod,omitempty"`

	// ExcludedClusters are the clusters that are to be excluded from the repair schedule.
	// +optional
	ExcludedClusters []string `json:"excludedClusters,omitempty"`

	// ExcludedKeyspaces are the keyspaces that are to be excluded from the repair schedule.
	// +optional
	ExcludedKeyspaces []string `json:"excludedKeyspaces,omitempty"`
}

AutoScheduling includes options to configure the auto scheduling of repairs for new clusters.

func (*AutoScheduling) DeepCopy

func (in *AutoScheduling) DeepCopy() *AutoScheduling

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

func (*AutoScheduling) DeepCopyInto

func (in *AutoScheduling) DeepCopyInto(out *AutoScheduling)

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

type CassandraDatacenterRef

type CassandraDatacenterRef struct {

	// The datacenter name.
	// +kubebuilder:validation:Required
	Name string `json:"name"`

	// The datacenter namespace. If empty, the datacenter will be assumed to reside in the same namespace as the Reaper
	// instance.
	// +optional
	Namespace string `json:"namespace,omitempty"`
}

CassandraDatacenterRef references the target Cassandra DC that Reaper should manage. TODO this object could be used by Stargate too; which currently cannot locate DCs outside of its own namespace.

func (*CassandraDatacenterRef) DeepCopy

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

func (*CassandraDatacenterRef) DeepCopyInto

func (in *CassandraDatacenterRef) DeepCopyInto(out *CassandraDatacenterRef)

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

type HttpManagement added in v1.10.0

type HttpManagement struct {
	// Enable/disable the HTTP management connection between Reaper and Cassandra.
	// When enabled, HTTP will be used instead of JMX for management connectivity between Cassandra
	// and Reaper. In future, this will be true by default
	// +kubebuilder:default=false
	Enabled bool `json:"enabled,omitempty"`

	Keystores *corev1.LocalObjectReference `json:"keystores,omitempty"`
}

func (*HttpManagement) DeepCopy added in v1.10.0

func (in *HttpManagement) DeepCopy() *HttpManagement

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

func (*HttpManagement) DeepCopyInto added in v1.10.0

func (in *HttpManagement) DeepCopyInto(out *HttpManagement)

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

type Reaper

type Reaper struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   ReaperSpec   `json:"spec,omitempty"`
	Status ReaperStatus `json:"status,omitempty"`
}

Reaper is the Schema for the reapers API

func (*Reaper) DeepCopy

func (in *Reaper) DeepCopy() *Reaper

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

func (*Reaper) DeepCopyInto

func (in *Reaper) DeepCopyInto(out *Reaper)

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

func (*Reaper) DeepCopyObject

func (in *Reaper) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ReaperClusterTemplate

type ReaperClusterTemplate struct {
	ReaperTemplate `json:",inline"`

	// +optional
	// +kubebuilder:default="PER_DC"
	// +kubebuilder:validation:Enum:=PER_DC;SINGLE
	DeploymentMode string `json:"deploymentMode,omitempty"`
}

func (*ReaperClusterTemplate) DeepCopy

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

func (*ReaperClusterTemplate) DeepCopyInto

func (in *ReaperClusterTemplate) DeepCopyInto(out *ReaperClusterTemplate)

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

type ReaperCondition

type ReaperCondition struct {
	Type   ReaperConditionType    `json:"type"`
	Status corev1.ConditionStatus `json:"status"`

	// LastTransitionTime is the last time the condition transited from one status to another.
	// +optional
	LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"`
}

func (*ReaperCondition) DeepCopy

func (in *ReaperCondition) DeepCopy() *ReaperCondition

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

func (*ReaperCondition) DeepCopyInto

func (in *ReaperCondition) DeepCopyInto(out *ReaperCondition)

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

type ReaperConditionType

type ReaperConditionType string
const (
	ReaperReady ReaperConditionType = "Ready"
)

type ReaperList

type ReaperList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Reaper `json:"items"`
}

ReaperList contains a list of Reaper

func (*ReaperList) DeepCopy

func (in *ReaperList) DeepCopy() *ReaperList

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

func (*ReaperList) DeepCopyInto

func (in *ReaperList) DeepCopyInto(out *ReaperList)

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

func (*ReaperList) DeepCopyObject

func (in *ReaperList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ReaperProgress

type ReaperProgress string

ReaperProgress is a word summarizing the state of a Reaper resource.

type ReaperSpec

type ReaperSpec struct {
	ReaperTemplate `json:",inline"`

	// DatacenterRef is the reference of a CassandraDatacenter resource that this Reaper instance should manage. It will
	// also be used as the backend for persisting Reaper's state. Reaper must be able to access the JMX port (7199 by
	// default) and the CQL port (9042 by default) on this DC.
	// +kubebuilder:validation:Required
	DatacenterRef CassandraDatacenterRef `json:"datacenterRef"`

	// DatacenterAvailability indicates to Reaper its deployment in relation to the target datacenter's network.
	// For single-DC clusters, the default (ALL) is fine. For multi-DC clusters, it is recommended to use EACH,
	// provided that there is one Reaper instance managing each DC in the cluster; otherwise, if one single Reaper
	// instance is going to manage more than one DC in the cluster, use ALL.
	// See https://cassandra-reaper.io/docs/usage/multi_dc/.
	// +optional
	// +kubebuilder:default="ALL"
	// +kubebuilder:validation:Enum:=LOCAL;ALL;EACH
	DatacenterAvailability string `json:"datacenterAvailability,omitempty"`

	// Client encryption stores which are used by Cassandra and Reaper.
	// +optional
	ClientEncryptionStores *encryption.Stores `json:"clientEncryptionStores,omitempty"`

	// Whether to skip schema migration. Schema migration is done in an init container on every Reaper deployment and
	// can slow down Reaper's startup time. Besides, schema migration requires reading data at QUORUM. It can be skipped
	// if you know that the schema is already up-to-date, or if you know upfront that QUORUM cannot be achieved (for
	// example, because a DC is down).
	// +optional
	// +kubebuilder:default=false
	SkipSchemaMigration bool `json:"skipSchemaMigration,omitempty"`
}

ReaperSpec defines the desired state of Reaper

func (*ReaperSpec) DeepCopy

func (in *ReaperSpec) DeepCopy() *ReaperSpec

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

func (*ReaperSpec) DeepCopyInto

func (in *ReaperSpec) DeepCopyInto(out *ReaperSpec)

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

type ReaperStatus

type ReaperStatus struct {

	// Progress is the progress of this Reaper object.
	// +kubebuilder:validation:Enum=Pending;Deploying;Configuring;Running
	// +optional
	Progress ReaperProgress `json:"progress,omitempty"`

	// +optional
	Conditions []ReaperCondition `json:"conditions,omitempty"`
}

ReaperStatus defines the observed state of Reaper

func (*ReaperStatus) DeepCopy

func (in *ReaperStatus) DeepCopy() *ReaperStatus

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

func (*ReaperStatus) DeepCopyInto

func (in *ReaperStatus) DeepCopyInto(out *ReaperStatus)

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

func (*ReaperStatus) GetConditionStatus

func (in *ReaperStatus) GetConditionStatus(conditionType ReaperConditionType) corev1.ConditionStatus

func (*ReaperStatus) IsReady

func (in *ReaperStatus) IsReady() bool

func (*ReaperStatus) SetCondition

func (in *ReaperStatus) SetCondition(condition ReaperCondition)

func (*ReaperStatus) SetNotReady

func (in *ReaperStatus) SetNotReady()

func (*ReaperStatus) SetReady

func (in *ReaperStatus) SetReady()

type ReaperTemplate

type ReaperTemplate struct {

	// The keyspace to use to store Reaper's state. Will default to "reaper_db" if unspecified. Will be created if it
	// does not exist, and if this Reaper resource is managed by K8ssandra.
	// +kubebuilder:default="reaper_db"
	// +optional
	Keyspace string `json:"keyspace,omitempty"`

	// Defines the username and password that Reaper will use to authenticate CQL connections to Cassandra clusters.
	// These credentials will be automatically turned into CQL roles by cass-operator when bootstrapping the datacenter,
	// then passed to the Reaper instance, so that it can authenticate against nodes in the datacenter using CQL. If CQL
	// authentication is not required, leave this field empty. The secret must be in the same namespace as Reaper itself
	// and must contain two keys: "username" and "password".
	// +optional
	CassandraUserSecretRef corev1.LocalObjectReference `json:"cassandraUserSecretRef,omitempty"`

	// Deprecated: JMX security is now based on CQL roles. Reaper will use cassandraUsefSecretRef for authentication,
	// this field is ignored.
	JmxUserSecretRef corev1.LocalObjectReference `json:"jmxUserSecretRef,omitempty"`

	// Defines the secret which contains the username and password for the Reaper UI and REST API authentication. When UiUserSecretRef.Name == "", authentication is turned off in the front-end only.
	// +optional
	UiUserSecretRef *corev1.LocalObjectReference `json:"uiUserSecretRef,omitempty"`

	// SecretsProvider defines whether the secrets used for credentials and certs will be backed
	// by an external secret backend. This moves the responsibility of generating and storing
	// secrets from the operators to the user and will rely on a mutating webhook to inject
	// the secrets into the necessary resources
	// +kubebuilder:validation:Enum=internal;external
	// +kubebuilder:default=internal
	SecretsProvider string `json:"secretsProvider,omitempty"`

	// The image to use for the Reaper pod main container.
	// The default is "thelastpickle/cassandra-reaper:3.6.0".
	// +optional
	// TODO: update with real release version.
	// +kubebuilder:default={repository:"thelastpickle",name:"cassandra-reaper",tag:"3.6.0"}
	ContainerImage *images.Image `json:"containerImage,omitempty"`

	// Deprecated: The main container image will be used for the init container as well.
	// +optional
	InitContainerImage *images.Image `json:"initContainerImage,omitempty"`

	// +kubebuilder:default="default"
	// +optional
	ServiceAccountName string `json:"ServiceAccountName,omitempty"`

	// Auto scheduling properties. When you enable the auto-schedule feature, Reaper dynamically schedules repairs for
	// all non-system keyspaces in a cluster. A cluster's keyspaces are monitored and any modifications (additions or
	// removals) are detected. When a new keyspace is created, a new repair schedule is created automatically for that
	// keyspace. Conversely, when a keyspace is removed, the corresponding repair schedule is deleted.
	// +optional
	AutoScheduling AutoScheduling `json:"autoScheduling,omitempty"`

	// LivenessProbe sets the Reaper liveness probe. Leave nil to use defaults.
	// +optional
	LivenessProbe *corev1.Probe `json:"livenessProbe,omitempty"`

	// ReadinessProbe sets the Reaper readiness probe. Leave nil to use defaults.
	// +optional
	ReadinessProbe *corev1.Probe `json:"readinessProbe,omitempty"`

	// Affinity applied to the Reaper pods.
	// +optional
	Affinity *corev1.Affinity `json:"affinity,omitempty"`

	// Tolerations applied to the Reaper pods.
	// +optional
	Tolerations []corev1.Toleration `json:"tolerations,omitempty"`

	// PodSecurityContext contains a pod-level SecurityContext to apply to Reaper pods.
	// +optional
	PodSecurityContext *corev1.PodSecurityContext `json:"podSecurityContext,omitempty"`

	// SecurityContext applied to the Reaper main container.
	// +optional
	SecurityContext *corev1.SecurityContext `json:"securityContext,omitempty"`

	// InitContainerSecurityContext is the SecurityContext applied to the Reaper init container, used to perform schema
	// migrations.
	// +optional
	InitContainerSecurityContext *corev1.SecurityContext `json:"initContainerSecurityContext,omitempty"`

	// HeapSize sets the JVM heap size to use for Reaper.
	// +kubebuilder:default="2Gi"
	// +optional
	HeapSize *resource.Quantity `json:"heapSize,omitempty"`

	// Main Container resources.
	// +optional
	Resources *corev1.ResourceRequirements `json:"resources,omitempty"`

	// Init Container resources.
	// +optional
	InitContainerResources *corev1.ResourceRequirements `json:"initContainerResources,omitempty"`

	// Telemetry defines the desired telemetry integrations to deploy targeting the Reaper pods for all DCs in this cluster
	// (unless overridden by DC specific settings)
	// +optional
	Telemetry *telemetryapi.TelemetrySpec `json:"telemetry,omitempty"`

	// labels and annotations for Reaper resources
	// +optional
	ResourceMeta *meta.ResourceMeta `json:"metadata,omitempty"`

	// +kubebuilder:default={enabled: false}
	// +optional
	HttpManagement HttpManagement `json:"httpManagement"`
}

func (*ReaperTemplate) DeepCopy

func (in *ReaperTemplate) DeepCopy() *ReaperTemplate

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

func (*ReaperTemplate) DeepCopyInto

func (in *ReaperTemplate) DeepCopyInto(out *ReaperTemplate)

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

func (ReaperTemplate) UseExternalSecrets added in v1.5.0

func (in ReaperTemplate) UseExternalSecrets() bool

UseExternalSecrets defines whether the user has specified if credentials and certs will be backed by an external secrets store

Jump to

Keyboard shortcuts

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