v1alpha1

package
v0.0.0-...-8011f81 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2021 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Overview

+groupName=core.sky.uk

Index

Constants

View Source
const (
	NodeServiceAccountName     = "cassandra-node"
	SnapshotServiceAccountName = "cassandra-snapshot"

	// DefaultDatacenterName is the default data center name which each Cassandra pod belongs to
	DefaultDatacenterName = "dc1"

	// DefaultCassandraImage is the name of the default Docker image used on Cassandra pods
	DefaultCassandraImage = "cassandra:3.11"

	// DefaultCassandraBootstrapperImageName is the name of the Docker image used to prepare the configuration for the Cassandra node before it can be started
	DefaultCassandraBootstrapperImageName = "cassandra-bootstrapper"

	// DefaultCassandraSnapshotImageName is the name of the Docker image used to make and cleanup snapshots
	DefaultCassandraSnapshotImageName = "cassandra-snapshot"

	// DefaultCassandraSidecarImageName is the name of the Docker image used to inform liveness/readiness probes
	DefaultCassandraSidecarImageName = "cassandra-sidecar"

	// DefaultSnapshotTimeoutSeconds is the default for Cassandra.Spec.Snapshot.TimeoutSeconds
	DefaultSnapshotTimeoutSeconds = 10

	// DefaultRetentionPolicyRetentionPeriodDays is the default for Cassandra.Spec.Snapshot.RetentionPolicy.RetentionPeriodDays
	DefaultRetentionPolicyRetentionPeriodDays = 7

	// DefaultRetentionPolicyCleanupTimeoutSeconds is the default for Cassandra.Spec.Snapshot.RetentionPolicy.CleanupTimeoutSeconds
	DefaultRetentionPolicyCleanupTimeoutSeconds = 10

	// DefaultStorageVolumeMountPath is the default location for Cassandra data storage
	DefaultStorageVolumeMountPath = "/var/lib/cassandra"

	// ConfigurationVolumeMountPath is the location for Cassandra configuration
	ConfigurationVolumeMountPath = "/etc/cassandra"

	// ExtraLibVolumeMountPath is the location for extra libraries required by the operator to function
	ExtraLibVolumeMountPath = "/extra-lib"
)

Variables

View Source
var (
	// SchemeGroupVersion is group version used to register these objects
	SchemeGroupVersion = schema.GroupVersion{Group: cassandra.GroupName, Version: "v1alpha1"}

	// AddToScheme is required in order to register with a clientset.
	AddToScheme = schemeBuilder.AddToScheme
)

Functions

func Kind

func Kind(kind string) schema.GroupKind

Kind takes an unqualified kind and returns back a Group qualified GroupKind

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type CassEnvVar

type CassEnvVar struct {
	// Name of the environment variable. Must be a C_IDENTIFIER.
	Name string `json:"name" protobuf:"bytes,1,opt,name=name"`

	// Variable references $(VAR_NAME) are expanded
	// using the previous defined environment variables in the container and
	// any service environment variables. If a variable cannot be resolved,
	// the reference in the input string will be unchanged. The $(VAR_NAME)
	// syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped
	// references will never be expanded, regardless of whether the variable
	// exists or not.
	// Defaults to "".
	// +optional
	Value string `json:"value,omitempty" protobuf:"bytes,2,opt,name=value"`
	// Source for the environment variable's value. Cannot be used if value is not empty.
	// +optional
	ValueFrom *CassEnvVarSource `json:"valueFrom,omitempty" protobuf:"bytes,3,opt,name=valueFrom"`
}

EnvVar represents an environment variable the operator will add to the Cassandra Container This is almost identical to coreV1.EnvVar, but replaces the type of ValueFrom.

func (*CassEnvVar) DeepCopy

func (in *CassEnvVar) DeepCopy() *CassEnvVar

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

func (*CassEnvVar) DeepCopyInto

func (in *CassEnvVar) DeepCopyInto(out *CassEnvVar)

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

func (CassEnvVar) Equal

func (cev CassEnvVar) Equal(other CassEnvVar) bool

Equal checks the equality of two CassEnvVar.

type CassEnvVarSource

type CassEnvVarSource struct {
	// Selects a key of a secret in the pod's namespace
	SecretKeyRef coreV1.SecretKeySelector `json:"secretKeyRef" protobuf:"bytes,4,name=secretKeyRef"`
}

CassEnvVarSource represents a source for the value of an CassEnvVar. This is almost identical to coreV1.EnvVarSource, but is restricted to a required SecretKeyRef

func (*CassEnvVarSource) DeepCopy

func (in *CassEnvVarSource) DeepCopy() *CassEnvVarSource

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

func (*CassEnvVarSource) DeepCopyInto

func (in *CassEnvVarSource) DeepCopyInto(out *CassEnvVarSource)

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

func (CassEnvVarSource) Equal

func (cevs CassEnvVarSource) Equal(other CassEnvVarSource) bool

Equal checks the equality of two CassEnvVarSource.

type Cassandra

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

	Spec   CassandraSpec   `json:"spec,omitempty"`
	Status CassandraStatus `json:"status,omitempty"`
}

Cassandra defines a Cassandra cluster +kubebuilder:resource:scope=Namespaced

func (*Cassandra) CustomConfigMapName

func (c *Cassandra) CustomConfigMapName() string

CustomConfigMapName returns the expected config map name for this cluster. This will return a value even if the config map does not exist.

func (*Cassandra) DeepCopy

func (in *Cassandra) DeepCopy() *Cassandra

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

func (*Cassandra) DeepCopyInto

func (in *Cassandra) DeepCopyInto(out *Cassandra)

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

func (*Cassandra) DeepCopyObject

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

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

func (*Cassandra) QualifiedName

func (c *Cassandra) QualifiedName() string

QualifiedName is the cluster fully qualified name which follows the format <namespace>.<name>

func (*Cassandra) RackName

func (c *Cassandra) RackName(rack *Rack) string

RackName is the fully qualifier name of the supplied rack within the cluster

func (*Cassandra) ServiceName

func (c *Cassandra) ServiceName() string

ServiceName is the cluster service name

func (*Cassandra) SnapshotCleanupJobName

func (c *Cassandra) SnapshotCleanupJobName() string

SnapshotCleanupJobName is the name of the snapshot cleanup job for the cluster

func (*Cassandra) SnapshotJobName

func (c *Cassandra) SnapshotJobName() string

SnapshotJobName is the name of the snapshot job for the cluster

func (*Cassandra) StorageVolumeName

func (c *Cassandra) StorageVolumeName() string

StorageVolumeName is the name of the volume used for storing Cassandra data

type CassandraList

type CassandraList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`
	Items           []Cassandra `json:"items"`
}

CassandraList is a list of Cassandra resources

func (*CassandraList) DeepCopy

func (in *CassandraList) DeepCopy() *CassandraList

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

func (*CassandraList) DeepCopyInto

func (in *CassandraList) DeepCopyInto(out *CassandraList)

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

func (*CassandraList) DeepCopyObject

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

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

type CassandraSpec

type CassandraSpec struct {
	// The assigned datacenter name for the Cassandra cluster.
	// +optional
	Datacenter *string `json:"datacenter,omitempty"`
	Racks      []Rack  `json:"racks"`
	Pod        Pod     `json:"pod"`
	// +optional
	Snapshot *Snapshot `json:"snapshot,omitempty"`
}

CassandraSpec is the specification for the Cassandra resource

func (*CassandraSpec) DeepCopy

func (in *CassandraSpec) DeepCopy() *CassandraSpec

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

func (*CassandraSpec) DeepCopyInto

func (in *CassandraSpec) DeepCopyInto(out *CassandraSpec)

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

func (CassandraSpec) Equal

func (cs CassandraSpec) Equal(other CassandraSpec) bool

Equal checks equality of two CassandraSpecs. This is useful for checking equality with cmp.Equal

type CassandraStatus

type CassandraStatus struct {
}

CassandraStatus is the status for the Cassandra resource

func (*CassandraStatus) DeepCopy

func (in *CassandraStatus) DeepCopy() *CassandraStatus

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

func (*CassandraStatus) DeepCopyInto

func (in *CassandraStatus) DeepCopyInto(out *CassandraStatus)

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

type Pod

type Pod struct {
	// The name of the Docker image used to prepare the configuration for the Cassandra node before it can be started.
	// +optional
	BootstrapperImage *string `json:"bootstrapperImage,omitempty"`

	// The Docker image to run on each Cassandra node in the cluster. It is recommended to use one of the official Cassandra images, version 3
	// +optional
	Image     *string                     `json:"image,omitempty"`
	Resources coreV1.ResourceRequirements `json:"resources"`
	// Liveness probe for the cassandra container
	// +optional
	LivenessProbe *Probe `json:"livenessProbe,omitempty"`
	// Readiness probe for the cassandra container
	// +optional
	ReadinessProbe *Probe `json:"readinessProbe,omitempty"`
	// Env variables for the cassandra container
	// +optional
	Env *[]CassEnvVar `json:"env,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,7,rep,name=env"`
	// Sidecar container specification
	Sidecar *Sidecar `json:"sidecar"`
}

Pod corresponds to a Cassandra node.

func (*Pod) DeepCopy

func (in *Pod) DeepCopy() *Pod

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

func (*Pod) DeepCopyInto

func (in *Pod) DeepCopyInto(out *Pod)

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

func (Pod) Equal

func (p Pod) Equal(other Pod) bool

Equal checks equality of two Pods. This is useful for checking equality with cmp.Equal

type Probe

type Probe struct {
	// Minimum consecutive failures for the probe to be considered failed after having succeeded. Minimum value is 1.
	// +optional
	FailureThreshold *int32 `json:"failureThreshold,omitempty"`
	// Number of seconds after the container has started before probes are initiated.
	// +optional
	InitialDelaySeconds *int32 `json:"initialDelaySeconds,omitempty"`
	// How often (in seconds) to perform the probe. Minimum value is 1.
	// +optional
	PeriodSeconds *int32 `json:"periodSeconds,omitempty"`
	// Minimum consecutive successes for the probe to be considered successful after having failed.
	// +optional
	SuccessThreshold *int32 `json:"successThreshold,omitempty"`
	// Timeout for the probe.
	// +optional
	TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"`
}

Probe represents a scheme for monitoring cassandra nodes status.

func (*Probe) DeepCopy

func (in *Probe) DeepCopy() *Probe

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

func (*Probe) DeepCopyInto

func (in *Probe) DeepCopyInto(out *Probe)

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

type Rack

type Rack struct {
	// Name of the rack.
	Name string `json:"name"`
	// Zone in which the rack resides.
	// This is set against the `failure-domain.beta.kubernetes.io/zone` value in the node affinity rule of the corresponding `StatefulSet`.
	Zone string `json:"zone"`
	// The desired number of replicas in the rack.
	Replicas int32 `json:"replicas"`
	// The rack storage options.
	Storage []Storage `json:"storage"`
}

Rack defines the rack topology in the cluster, where a rack has a number of replicas located in the same physical grouping (e.g. zone). At least one rack must be supplied.

func (*Rack) DeepCopy

func (in *Rack) DeepCopy() *Rack

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

func (*Rack) DeepCopyInto

func (in *Rack) DeepCopyInto(out *Rack)

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

func (Rack) Equal

func (r Rack) Equal(other Rack) bool

Equal checks equality of two Racks. This is useful for testing checking equality cmp.Equal

type RetentionPolicy

type RetentionPolicy struct {
	// The period of time for which snapshots will be retained. Snapshots older than this period will be deleted.
	// +optional
	RetentionPeriodDays *int32 `json:"retentionPeriodDays,omitempty"`
	// Crontab expression specifying when snapshot cleanup will run.
	// It follows the cron format, see https://en.wikipedia.org/wiki/Cron
	CleanupSchedule string `json:"cleanupSchedule"`
	// Time limit for the cleanup command to run.
	// +optional
	CleanupTimeoutSeconds *int32 `json:"cleanupTimeoutSeconds,omitempty"`
	// Resource requirements for the Snapshot Cleanup Job
	Resources coreV1.ResourceRequirements `json:"resources"`
}

RetentionPolicy defines how long the snapshots should be kept for and how often the cleanup task should run

func (*RetentionPolicy) DeepCopy

func (in *RetentionPolicy) DeepCopy() *RetentionPolicy

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

func (*RetentionPolicy) DeepCopyInto

func (in *RetentionPolicy) DeepCopyInto(out *RetentionPolicy)

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

func (RetentionPolicy) Equal

func (rp RetentionPolicy) Equal(other RetentionPolicy) bool

Equal checks equality of two RetentionPolicy. This is useful for checking equality with cmp.Equal

type Sidecar

type Sidecar struct {
	// The Docker image for the sidecar container running on each Cassandra node to expose node status.
	// +optional
	Image *string `json:"image,omitempty"`
	// Resource requirements for the sidecar container
	Resources coreV1.ResourceRequirements `json:"resources"`
}

Sidecar is the specification of a sidecar attached to a Cassandra node

func (*Sidecar) DeepCopy

func (in *Sidecar) DeepCopy() *Sidecar

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

func (*Sidecar) DeepCopyInto

func (in *Sidecar) DeepCopyInto(out *Sidecar)

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

func (Sidecar) Equal

func (s Sidecar) Equal(other Sidecar) bool

Equal checks equality of two Sidecars. This is useful for checking equality with cmp.Equal

type Snapshot

type Snapshot struct {
	// The name of the Docker image used to create and cleanup snapshots.
	// +optional
	Image *string `json:"image,omitempty"`
	// Crontab expression specifying when snapshots will be taken.
	// It follows the cron format, see https://en.wikipedia.org/wiki/Cron
	Schedule string `json:"schedule"`
	// List of keyspaces to snapshot. Leave empty to snapshot all keyspaces.
	// +optional
	Keyspaces []string `json:"keyspaces,omitempty"`
	// Time limit for the snapshot command to run.
	// +optional
	TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"`
	// +optional
	RetentionPolicy *RetentionPolicy `json:"retentionPolicy,omitempty"`
	// Resource requirements for the Snapshot job
	Resources coreV1.ResourceRequirements `json:"resources"`
}

Snapshot defines the snapshot creation and deletion configuration

func (*Snapshot) DeepCopy

func (in *Snapshot) DeepCopy() *Snapshot

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

func (*Snapshot) DeepCopyInto

func (in *Snapshot) DeepCopyInto(out *Snapshot)

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

func (Snapshot) Equal

func (s Snapshot) Equal(other Snapshot) bool

Equal checks equality of two Snapshots. This is useful for testing with cmp.Equal

type Storage

type Storage struct {
	// The full path to the volume in the pod
	Path          *string `json:"path,omitempty"`
	StorageSource `json:",inline"`
}

Storage defines the storage properties shared by pods in the same rack. Multiple volume types are available such as `emptyDir` and `persistentVolumeClaim`. The volume types available are expected to be a subset of the volume types defined in `k8s.io/api/core/v1/VolumeSource`. Only one type of volume may be specified.

func (*Storage) DeepCopy

func (in *Storage) DeepCopy() *Storage

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

func (*Storage) DeepCopyInto

func (in *Storage) DeepCopyInto(out *Storage)

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

func (Storage) Equal

func (ss Storage) Equal(other Storage) bool

Equal checks equality of two Storage. This is useful for testing checking equality cmp.Equal

type StorageSource

type StorageSource struct {
	// The volume as a persistent volume of type `k8s.io/api/core/v1/PersistentVolumeClaimSpec`
	// +optional
	PersistentVolumeClaim *coreV1.PersistentVolumeClaimSpec `json:"persistentVolumeClaim,omitempty"`
	// The volume as an empty directory of type `k8s.io/api/core/v1/EmptyDirVolumeSource`
	// +optional
	EmptyDir *coreV1.EmptyDirVolumeSource `json:"emptyDir,omitempty"`
}

StorageSource represents the volume type to use as storage The volume types available are expected to be a subset of the volume types defined in 1k8s.io/api/core/v1/VolumeSource1. Only one of its members may be specified.

func (*StorageSource) DeepCopy

func (in *StorageSource) DeepCopy() *StorageSource

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

func (*StorageSource) DeepCopyInto

func (in *StorageSource) DeepCopyInto(out *StorageSource)

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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