v1beta1

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package v1beta1 contains API Schema definitions for the cassandra v1beta1 API group +k8s:deepcopy-gen=package,register +groupName=cassandra.datastax.com

Package v1beta1 contains API Schema definitions for the cassandra v1beta1 API group +k8s:deepcopy-gen=package,register +groupName=cassandra.datastax.com

Index

Constants

View Source
const (
	// ClusterLabel is the operator's label for the cluster name
	ClusterLabel = "cassandra.datastax.com/cluster"

	// DatacenterLabel is the operator's label for the datacenter name
	DatacenterLabel = "cassandra.datastax.com/datacenter"

	// SeedNodeLabel is the operator's label for the seed node state
	SeedNodeLabel = "cassandra.datastax.com/seed-node"

	// RackLabel is the operator's label for the rack name
	RackLabel = "cassandra.datastax.com/rack"

	// RackLabel is the operator's label for the rack name
	CassOperatorProgressLabel = "cassandra.datastax.com/operator-progress"

	// CassNodeState
	CassNodeState = "cassandra.datastax.com/node-state"

	// Progress states for status
	ProgressUpdating ProgressState = "Updating"
	ProgressReady    ProgressState = "Ready"
)
View Source
const (
	EnvBaseImageOs = "BASE_IMAGE_OS"
)

Variables

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

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion}
)
View Source
var AddToScheme = SchemeBuilder.AddToScheme

AddToScheme is a global function that registers this API group & version to a scheme

Functions

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

func SplitRacks

func SplitRacks(nodeCount, rackCount int) []int

func ValidateDatacenterFieldChanges

func ValidateDatacenterFieldChanges(oldDc CassandraDatacenter, newDc CassandraDatacenter) error

Ensure that no values are improperly set

func ValidateSingleDatacenter

func ValidateSingleDatacenter(dc CassandraDatacenter) error

Ensure that no values are improperly set

Types

type CassandraDatacenter

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

	Spec   CassandraDatacenterSpec   `json:"spec,omitempty"`
	Status CassandraDatacenterStatus `json:"status,omitempty"`
}

CassandraDatacenter is the Schema for the cassandradatacenters API +k8s:openapi-gen=true +kubebuilder:subresource:status +kubebuilder:resource:path=cassandradatacenters,scope=Namespaced,shortName=cassdc;cassdcs

func (*CassandraDatacenter) DeepCopy

func (in *CassandraDatacenter) DeepCopy() *CassandraDatacenter

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

func (*CassandraDatacenter) DeepCopyInto

func (in *CassandraDatacenter) DeepCopyInto(out *CassandraDatacenter)

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

func (*CassandraDatacenter) DeepCopyObject

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

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

func (*CassandraDatacenter) GetAllPodsServiceName

func (dc *CassandraDatacenter) GetAllPodsServiceName() string

func (*CassandraDatacenter) GetClusterLabels

func (dc *CassandraDatacenter) GetClusterLabels() map[string]string

GetClusterLabels returns a new map with the cluster label key and cluster name value

func (*CassandraDatacenter) GetConditionStatus

func (dc *CassandraDatacenter) GetConditionStatus(conditionType DatacenterConditionType) corev1.ConditionStatus

func (*CassandraDatacenter) GetConfigAsJSON

func (dc *CassandraDatacenter) GetConfigAsJSON() (string, error)

GetConfigAsJSON gets a JSON-encoded string suitable for passing to configBuilder

func (*CassandraDatacenter) GetConfigBuilderImage

func (dc *CassandraDatacenter) GetConfigBuilderImage() string

func (*CassandraDatacenter) GetContainerPorts

func (dc *CassandraDatacenter) GetContainerPorts() ([]corev1.ContainerPort, error)

GetContainerPorts will return the container ports for the pods in a statefulset based on the provided config

func (*CassandraDatacenter) GetDatacenterLabels

func (dc *CassandraDatacenter) GetDatacenterLabels() map[string]string

GetDatacenterLabels ...

func (*CassandraDatacenter) GetDatacenterServiceName

func (dc *CassandraDatacenter) GetDatacenterServiceName() string

func (*CassandraDatacenter) GetRackLabels

func (dc *CassandraDatacenter) GetRackLabels(rackName string) map[string]string

GetRackLabels ...

func (*CassandraDatacenter) GetRacks

func (dc *CassandraDatacenter) GetRacks() []Rack

GetRacks is a getter for the Rack slice in the spec It ensures there is always at least one rack

func (*CassandraDatacenter) GetSeedServiceName

func (dc *CassandraDatacenter) GetSeedServiceName() string

func (*CassandraDatacenter) GetServerImage

func (dc *CassandraDatacenter) GetServerImage() (string, error)

GetServerImage produces a fully qualified container image to pull based on either the version, or an explicitly specified image

In the event that no valid image could be retrieved from the specified version, an error is returned.

func (*CassandraDatacenter) GetSuperuserSecretNamespacedName

func (dc *CassandraDatacenter) GetSuperuserSecretNamespacedName() types.NamespacedName

func (*CassandraDatacenter) SetCondition

func (dc *CassandraDatacenter) SetCondition(condition DatacenterCondition)

func (*CassandraDatacenter) ShouldGenerateSuperuserSecret

func (dc *CassandraDatacenter) ShouldGenerateSuperuserSecret() bool

func (*CassandraDatacenter) ValidateCreate

func (dc *CassandraDatacenter) ValidateCreate() error

func (*CassandraDatacenter) ValidateDelete

func (dc *CassandraDatacenter) ValidateDelete() error

func (*CassandraDatacenter) ValidateUpdate

func (dc *CassandraDatacenter) ValidateUpdate(old runtime.Object) error

type CassandraDatacenterList

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

CassandraDatacenterList contains a list of CassandraDatacenter

func (*CassandraDatacenterList) DeepCopy

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

func (*CassandraDatacenterList) DeepCopyInto

func (in *CassandraDatacenterList) DeepCopyInto(out *CassandraDatacenterList)

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

func (*CassandraDatacenterList) DeepCopyObject

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

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

type CassandraDatacenterSpec

type CassandraDatacenterSpec struct {

	// Desired number of Cassandra server nodes
	// +kubebuilder:validation:Minimum=1
	Size int32 `json:"size"`

	// Version string for config builder,
	// used to generate Cassandra server configuration
	// +kubebuilder:validation:Enum="6.8.0";"6.8.1";"3.11.6";"4.0.0"
	ServerVersion string `json:"serverVersion"`

	// Cassandra server image name.
	// More info: https://kubernetes.io/docs/concepts/containers/images
	ServerImage string `json:"serverImage,omitempty"`

	// Server type: "cassandra" or "dse"
	// +kubebuilder:validation:Enum=cassandra;dse
	ServerType string `json:"serverType"`

	// Config for the server, in YAML format
	Config json.RawMessage `json:"config,omitempty"`

	// Config for the Management API certificates
	ManagementApiAuth ManagementApiAuthConfig `json:"managementApiAuth,omitempty"`

	// Kubernetes resource requests and limits, per pod
	Resources corev1.ResourceRequirements `json:"resources,omitempty"`

	// A list of the named racks in the datacenter, representing independent failure domains. The
	// number of racks should match the replication factor in the keyspaces you plan to create, and
	// the number of racks cannot easily be changed once a datacenter is deployed.
	Racks []Rack `json:"racks,omitempty"`

	// Describes the persistent storage request of each server node
	StorageConfig StorageConfig `json:"storageConfig"`

	// A list of pod names that need to be replaced.
	ReplaceNodes []string `json:"replaceNodes,omitempty"`

	// The name by which CQL clients and instances will know the cluster. If the same
	// cluster name is shared by multiple Datacenters in the same Kubernetes namespace,
	// they will join together in a multi-datacenter cluster.
	// +kubebuilder:validation:MinLength=2
	ClusterName string `json:"clusterName"`

	// A stopped CassandraDatacenter will have no running server pods, like using "stop" with
	// traditional System V init scripts. Other Kubernetes resources will be left intact, and volumes
	// will re-attach when the CassandraDatacenter workload is resumed.
	Stopped bool `json:"stopped,omitempty"`

	// Container image for the config builder init container.
	ConfigBuilderImage string `json:"configBuilderImage,omitempty"`

	// Indicates that configuration and container image changes should only be pushed to
	// the first rack of the datacenter
	CanaryUpgrade bool `json:"canaryUpgrade,omitempty"`

	// Turning this option on allows multiple server pods to be created on a k8s worker node.
	// By default the operator creates just one server pod per k8s worker node using k8s
	// podAntiAffinity and requiredDuringSchedulingIgnoredDuringExecution.
	AllowMultipleNodesPerWorker bool `json:"allowMultipleNodesPerWorker,omitempty"`

	// This secret defines the username and password for the Cassandra server superuser.
	// If it is omitted, we will generate a secret instead.
	SuperuserSecretName string `json:"superuserSecretName,omitempty"`

	// The k8s service account to use for the server pods
	ServiceAccount string `json:"serviceAccount,omitempty"`

	// Whether to do a rolling restart at the next opportunity. The operator will set this back
	// to false once the restart is in progress.
	RollingRestartRequested bool `json:"rollingRestartRequested,omitempty"`

	// A map of label keys and values to restrict Cassandra node scheduling to k8s workers
	// with matchiing labels.
	// More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector
	NodeSelector map[string]string `json:"nodeSelector,omitempty"`

	// Rack names in this list are set to the latest StatefulSet configuration
	// even if Cassandra nodes are down. Use this to recover from an upgrade that couldn't
	// roll out.
	ForceUpgradeRacks []string `json:"forceUpgradeRacks,omitempty"`

	// PodTemplate provides customisation options (labels, annotations, affinity rules, resource requests, and so on) for the cassandra pods
	PodTemplateSpec *corev1.PodTemplateSpec `json:"podTemplateSpec,omitempty"`

	// Cassandra users to bootstrap
	Users []CassandraUser `json:"users,omitempty"`

	AdditionalSeeds []string `json:"additionalSeeds,omitempty"`

	Reaper *ReaperConfig `json:"reaper,omitempty"`
}

CassandraDatacenterSpec defines the desired state of a CassandraDatacenter +k8s:openapi-gen=true

func (*CassandraDatacenterSpec) DeepCopy

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

func (*CassandraDatacenterSpec) DeepCopyInto

func (in *CassandraDatacenterSpec) DeepCopyInto(out *CassandraDatacenterSpec)

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

type CassandraDatacenterStatus

type CassandraDatacenterStatus struct {
	Conditions []DatacenterCondition `json:"conditions,omitempty"`

	// Deprecated. Use usersUpserted instead. The timestamp at
	// which CQL superuser credentials were last upserted to the
	// management API
	// +optional
	SuperUserUpserted metav1.Time `json:"superUserUpserted,omitempty"`

	// The timestamp at which managed cassandra users' credentials
	// were last upserted to the management API
	// +optional
	UsersUpserted metav1.Time `json:"usersUpserted,omitempty"`

	// The timestamp when the operator last started a Server node
	// with the management API
	// +optional
	LastServerNodeStarted metav1.Time `json:"lastServerNodeStarted,omitempty"`

	// Last known progress state of the Cassandra Operator
	// +optional
	CassandraOperatorProgress ProgressState `json:"cassandraOperatorProgress,omitempty"`

	// +optional
	LastRollingRestart metav1.Time `json:"lastRollingRestart,omitempty"`

	// +optional
	NodeStatuses CassandraStatusMap `json:"nodeStatuses"`

	// +optional
	NodeReplacements []string `json:"nodeReplacements"`
}

CassandraDatacenterStatus defines the observed state of CassandraDatacenter +k8s:openapi-gen=true

func (*CassandraDatacenterStatus) DeepCopy

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

func (*CassandraDatacenterStatus) DeepCopyInto

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

func (*CassandraDatacenterStatus) GetConditionStatus

func (status *CassandraDatacenterStatus) GetConditionStatus(conditionType DatacenterConditionType) corev1.ConditionStatus

func (*CassandraDatacenterStatus) SetCondition

func (status *CassandraDatacenterStatus) SetCondition(condition DatacenterCondition)

type CassandraNodeStatus

type CassandraNodeStatus struct {
	HostID string `json:"hostID,omitempty"`
}

func (*CassandraNodeStatus) DeepCopy

func (in *CassandraNodeStatus) DeepCopy() *CassandraNodeStatus

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

func (*CassandraNodeStatus) DeepCopyInto

func (in *CassandraNodeStatus) DeepCopyInto(out *CassandraNodeStatus)

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

type CassandraStatusMap

type CassandraStatusMap map[string]CassandraNodeStatus

func (CassandraStatusMap) DeepCopy

func (in CassandraStatusMap) DeepCopy() CassandraStatusMap

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

func (CassandraStatusMap) DeepCopyInto

func (in CassandraStatusMap) DeepCopyInto(out *CassandraStatusMap)

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

type CassandraUser added in v1.3.0

type CassandraUser struct {
	SecretName string `json:"secretName"`
	Superuser  bool   `json:"superuser"`
}

func (*CassandraUser) DeepCopy added in v1.3.0

func (in *CassandraUser) DeepCopy() *CassandraUser

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

func (*CassandraUser) DeepCopyInto added in v1.3.0

func (in *CassandraUser) DeepCopyInto(out *CassandraUser)

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

type DatacenterCondition

type DatacenterCondition struct {
	Type               DatacenterConditionType `json:"type"`
	Status             corev1.ConditionStatus  `json:"status"`
	LastTransitionTime metav1.Time             `json:"lastTransitionTime,omitempty"`
}

func NewDatacenterCondition

func NewDatacenterCondition(conditionType DatacenterConditionType, status corev1.ConditionStatus) *DatacenterCondition

func (*DatacenterCondition) DeepCopy

func (in *DatacenterCondition) DeepCopy() *DatacenterCondition

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

func (*DatacenterCondition) DeepCopyInto

func (in *DatacenterCondition) DeepCopyInto(out *DatacenterCondition)

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

type DatacenterConditionType

type DatacenterConditionType string
const (
	DatacenterReady          DatacenterConditionType = "Ready"
	DatacenterInitialized    DatacenterConditionType = "Initialized"
	DatacenterReplacingNodes DatacenterConditionType = "ReplacingNodes"
	DatacenterScalingUp      DatacenterConditionType = "ScalingUp"
	DatacenterUpdating       DatacenterConditionType = "Updating"
	DatacenterStopped        DatacenterConditionType = "Stopped"
	DatacenterResuming       DatacenterConditionType = "Resuming"
	DatacenterRollingRestart DatacenterConditionType = "RollingRestart"
)

type ManagementApiAuthConfig

type ManagementApiAuthConfig struct {
	Insecure *ManagementApiAuthInsecureConfig `json:"insecure,omitempty"`
	Manual   *ManagementApiAuthManualConfig   `json:"manual,omitempty"`
}

func (*ManagementApiAuthConfig) DeepCopy

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

func (*ManagementApiAuthConfig) DeepCopyInto

func (in *ManagementApiAuthConfig) DeepCopyInto(out *ManagementApiAuthConfig)

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

type ManagementApiAuthInsecureConfig

type ManagementApiAuthInsecureConfig struct {
}

func (*ManagementApiAuthInsecureConfig) DeepCopy

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

func (*ManagementApiAuthInsecureConfig) DeepCopyInto

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

type ManagementApiAuthManualConfig

type ManagementApiAuthManualConfig struct {
	ClientSecretName string `json:"clientSecretName"`
	ServerSecretName string `json:"serverSecretName"`
	// +optional
	SkipSecretValidation bool `json:"skipSecretValidation,omitempty"`
}

func (*ManagementApiAuthManualConfig) DeepCopy

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

func (*ManagementApiAuthManualConfig) DeepCopyInto

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

type ProgressState

type ProgressState string

This type exists so there's no chance of pushing random strings to our progress status

type Rack

type Rack struct {
	// The rack name
	// +kubebuilder:validation:MinLength=2
	Name string `json:"name"`
	// Zone name to pin the rack, using node affinity
	Zone string `json:"zone,omitempty"`
}

Rack ...

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.

type ReaperConfig added in v1.3.0

type ReaperConfig struct {
	Enabled bool `json:"enabled,omitempty"`

	Image string `json:"image,omitempty"`

	ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`
}

func (*ReaperConfig) DeepCopy added in v1.3.0

func (in *ReaperConfig) DeepCopy() *ReaperConfig

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

func (*ReaperConfig) DeepCopyInto added in v1.3.0

func (in *ReaperConfig) DeepCopyInto(out *ReaperConfig)

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

type StorageConfig

type StorageConfig struct {
	CassandraDataVolumeClaimSpec *corev1.PersistentVolumeClaimSpec `json:"cassandraDataVolumeClaimSpec,omitempty"`
}

func (*StorageConfig) DeepCopy

func (in *StorageConfig) DeepCopy() *StorageConfig

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

func (*StorageConfig) DeepCopyInto

func (in *StorageConfig) DeepCopyInto(out *StorageConfig)

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