v1alpha1

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

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

Index

Constants

View Source
const (
	// StargateLabel is the distinctive label for all objects created by the Stargate controller. The label value is
	// the Stargate resource name.
	StargateLabel = "k8ssandra.io/stargate"

	// StargateDeploymentLabel is a distinctive label for pods targeted by a deployment created by the Stargate
	// controller. The label value is the Deployment name.
	StargateDeploymentLabel = "k8ssandra.io/stargate-deployment"
)

EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.

View Source
const (
	StargateProgressPending   = StargateProgress("Pending")
	StargateProgressDeploying = StargateProgress("Deploying")
	StargateProgressRunning   = StargateProgress("Running")
)

Variables

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

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

	// Internode encryption stores which are used by Cassandra and Stargate.
	// +optional
	ServerEncryptionStores *encryption.Stores `json:"serverEncryptionStores,omitempty"`
}

Still it is required to pass the encryption stores secrets to the Stargate pods, so that they can be mounted as volumes.

func (*CassandraEncryption) DeepCopy

func (in *CassandraEncryption) DeepCopy() *CassandraEncryption

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

func (*CassandraEncryption) DeepCopyInto

func (in *CassandraEncryption) DeepCopyInto(out *CassandraEncryption)

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

type Stargate

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

	// Specification of the desired behavior of this Stargate resource.
	// +optional
	Spec StargateSpec `json:"spec,omitempty"`

	// Most recently observed status of this Stargate resource.
	// +optional
	Status StargateStatus `json:"status,omitempty"`
}

Stargate is the Schema for the stargates API

func (*Stargate) DeepCopy

func (in *Stargate) DeepCopy() *Stargate

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

func (*Stargate) DeepCopyInto

func (in *Stargate) DeepCopyInto(out *Stargate)

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

func (*Stargate) DeepCopyObject

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

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

func (*Stargate) GetRackTemplate

func (in *Stargate) GetRackTemplate(name string) *StargateRackTemplate

type StargateClusterTemplate

type StargateClusterTemplate struct {
	StargateTemplate `json:",inline"`

	// Size is the number of Stargate instances to deploy in each datacenter. They will be spread evenly across racks.
	// +kubebuilder:validation:Minimum=1
	// +kubebuilder:default=1
	Size int32 `json:"size"`
}

StargateClusterTemplate defines global rules to apply to all Stargate pods in all datacenters in the cluster. These rules will be merged with rules defined at datacenter level in a StargateDatacenterTemplate; dc-level rules have precedence over cluster-level ones.

func (*StargateClusterTemplate) DeepCopy

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

func (*StargateClusterTemplate) DeepCopyInto

func (in *StargateClusterTemplate) DeepCopyInto(out *StargateClusterTemplate)

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

type StargateCondition

type StargateCondition struct {
	Type   StargateConditionType  `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 (*StargateCondition) DeepCopy

func (in *StargateCondition) DeepCopy() *StargateCondition

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

func (*StargateCondition) DeepCopyInto

func (in *StargateCondition) DeepCopyInto(out *StargateCondition)

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

type StargateConditionType

type StargateConditionType string
const (
	StargateReady StargateConditionType = "Ready"
)

type StargateDatacenterTemplate

type StargateDatacenterTemplate struct {
	StargateClusterTemplate `json:",inline"`

	// Racks allow customizing Stargate characteristics for specific racks in the datacenter.
	// +optional
	Racks []StargateRackTemplate `json:"racks,omitempty"`
}

StargateDatacenterTemplate defines rules to apply to all Stargate pods in a given datacenter. These rules will be merged with rules defined at rack level in a StargateRackTemplate; rack-level rules have precedence over datacenter-level ones.

func (*StargateDatacenterTemplate) Coalesce

Coalesce compares this StargateDatacenterTemplate with the given StargateClusterTemplate and returns the first non-nil StargateDatacenterTemplate it finds. TODO revisit the merging strategy and/or find a better name for this method

func (*StargateDatacenterTemplate) DeepCopy

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

func (*StargateDatacenterTemplate) DeepCopyInto

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

type StargateList

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

StargateList contains a list of Stargate

func (*StargateList) DeepCopy

func (in *StargateList) DeepCopy() *StargateList

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

func (*StargateList) DeepCopyInto

func (in *StargateList) DeepCopyInto(out *StargateList)

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

func (*StargateList) DeepCopyObject

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

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

type StargateProgress

type StargateProgress string

StargateProgress is a word summarizing the state of a Stargate resource.

type StargateRackTemplate

type StargateRackTemplate struct {
	StargateTemplate `json:",inline"`

	// Name is the rack name. It must correspond to an existing rack name in the CassandraDatacenter resource where
	// Stargate is being deployed, otherwise it will be ignored.
	// +kubebuilder:validation:MinLength=2
	Name string `json:"name"`
}

StargateRackTemplate defines custom rules for Stargate pods in a given rack. These rules will be merged with rules defined at datacenter level in a StargateDatacenterTemplate; rack-level rules have precedence over datacenter-level ones.

func (*StargateRackTemplate) Coalesce

Coalesce compares this StargateRackTemplate with the given StargateDatacenterTemplate and returns the first non-nil StargateTemplate it finds. TODO revisit the merging strategy and/or find a better name for this method

func (*StargateRackTemplate) DeepCopy

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

func (*StargateRackTemplate) DeepCopyInto

func (in *StargateRackTemplate) DeepCopyInto(out *StargateRackTemplate)

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

type StargateSpec

type StargateSpec struct {
	StargateDatacenterTemplate `json:",inline"`

	// DatacenterRef is the namespace-local reference of a CassandraDatacenter resource where
	// Stargate should be deployed.
	// +kubebuilder:validation:Required
	DatacenterRef corev1.LocalObjectReference `json:"datacenterRef"`

	// Whether to enable authentication for Stargate. The default is true; it is highly recommended to always leave
	// authentication turned on, not only on Stargate nodes, but also on data nodes as well. Note that Stargate REST
	// APIs are currently only accessible if authentication is enabled, and if the authenticator in use in the whole
	// cluster is PasswordAuthenticator. The usage of any other authenticator will cause the REST API to become
	// inaccessible, see https://github.com/stargate/stargate/issues/792 for more. Stargate CQL API however remains
	// accessible even if authentication is disabled in the cluster, or when a custom authenticator is being used.
	// +optional
	// +kubebuilder:default=true
	Auth *bool `json:"auth,omitempty"`

	CassandraEncryption *CassandraEncryption `json:"cassandraEncryption,omitempty"`
}

StargateSpec defines the desired state of a Stargate resource.

func (*StargateSpec) DeepCopy

func (in *StargateSpec) DeepCopy() *StargateSpec

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

func (*StargateSpec) DeepCopyInto

func (in *StargateSpec) DeepCopyInto(out *StargateSpec)

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

func (StargateSpec) IsAuthEnabled

func (in StargateSpec) IsAuthEnabled() bool

type StargateStatus

type StargateStatus struct {

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

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

	// DeploymentRefs is the names of the Deployment objects that were created for this Stargate
	// object.
	// +optional
	DeploymentRefs []string `json:"deploymentRefs,omitempty"`

	// ServiceRef is the name of the Service object that was created for this Stargate
	// object.
	// +optional
	ServiceRef *string `json:"serviceRef,omitempty"`

	// ReadyReplicasRatio is a "X/Y" string representing the ratio between ReadyReplicas and
	// Replicas in the Stargate deployment.
	// +kubebuilder:validation:Pattern=\d+/\d+
	// +optional
	ReadyReplicasRatio *string `json:"readyReplicasRatio,omitempty"`

	// Total number of non-terminated pods targeted by the Stargate deployment (their labels match
	// the selector).
	// Will be zero if the deployment has not been created yet.
	Replicas int32 `json:"replicas"`

	// ReadyReplicas is the total number of ready pods targeted by the Stargate deployment.
	// Will be zero if the deployment has not been created yet.
	ReadyReplicas int32 `json:"readyReplicas"`

	// UpdatedReplicas is the total number of non-terminated pods targeted by the Stargate
	// deployment that have the desired template spec.
	// Will be zero if the deployment has not been created yet.
	UpdatedReplicas int32 `json:"updatedReplicas"`

	// Total number of available pods targeted by the Stargate deployment.
	// Will be zero if the deployment has not been created yet.
	AvailableReplicas int32 `json:"availableReplicas"`
}

StargateStatus defines the observed state of a Stargate resource.

func (*StargateStatus) DeepCopy

func (in *StargateStatus) DeepCopy() *StargateStatus

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

func (*StargateStatus) DeepCopyInto

func (in *StargateStatus) DeepCopyInto(out *StargateStatus)

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

func (*StargateStatus) GetConditionStatus

func (in *StargateStatus) GetConditionStatus(conditionType StargateConditionType) corev1.ConditionStatus

func (*StargateStatus) IsReady

func (in *StargateStatus) IsReady() bool

func (*StargateStatus) SetCondition

func (in *StargateStatus) SetCondition(condition StargateCondition)

type StargateTemplate

type StargateTemplate struct {

	// ContainerImage is the image characteristics to use for Stargate containers. Leave nil
	// to use a default image.
	// +optional
	// +kubebuilder:default={repository:"stargateio", tag:"v1.0.45"}
	ContainerImage *images.Image `json:"containerImage,omitempty"`

	// ServiceAccount is the service account name to use for Stargate pods.
	// +kubebuilder:default="default"
	// +optional
	ServiceAccount *string `json:"serviceAccount,omitempty"`

	// Resources is the Kubernetes resource requests and limits to apply, per Stargate pod. Leave
	// nil to use defaults.
	// +optional
	Resources *corev1.ResourceRequirements `json:"resources,omitempty"`

	// HeapSize sets the JVM heap size to use for Stargate. If no Resources are specified, this
	// value will also be used to set a default memory request and limit for the Stargate pods:
	// these will be set to HeapSize x2 and x4, respectively.
	// +kubebuilder:default="256Mi"
	// +optional
	HeapSize *resource.Quantity `json:"heapSize,omitempty"`

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

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

	// NodeSelector is an optional map of label keys and values to restrict the scheduling of Stargate nodes to workers
	// with matching labels.
	// Leave nil to let the controller reuse the same node selectors used for data pods in this datacenter, if any.
	// See https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector
	// +optional
	NodeSelector map[string]string `json:"nodeSelector,omitempty"`

	// Tolerations are tolerations to apply to the Stargate pods.
	// Leave nil to let the controller reuse the same tolerations used for data pods in this datacenter, if any.
	// See https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
	// +optional
	Tolerations []corev1.Toleration `json:"tolerations,omitempty"`

	// Affinity is the affinity to apply to all the Stargate pods.
	// Leave nil to let the controller reuse the same affinity rules used for data pods in this datacenter, if any.
	// See https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity
	// +optional
	Affinity *corev1.Affinity `json:"affinity,omitempty"`

	// AllowStargateOnDataNodes allows Stargate pods to be scheduled on a worker node already hosting data pods for this
	// datacenter. The default is false, which means that Stargate pods will be scheduled on separate worker nodes.
	// Note: if the datacenter pods have HostNetwork:true, then the Stargate pods will inherit of it, in which case it
	// is possible that Stargate nodes won't be allowed to sit on data nodes even if this property is set to true,
	// because of port conflicts on the same IP address.
	// +optional
	// +kubebuilder:default=false
	AllowStargateOnDataNodes bool `json:"allowStargateOnDataNodes,omitempty"`

	// CassandraConfigMapRef is a reference to a ConfigMap that holds Cassandra configuration.
	// The map should have a key named cassandra_yaml.
	// +optional
	CassandraConfigMapRef *corev1.LocalObjectReference `json:"cassandraConfigMapRef,omitempty"`

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

StargateTemplate defines a template for deploying Stargate.

func (*StargateTemplate) DeepCopy

func (in *StargateTemplate) DeepCopy() *StargateTemplate

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

func (*StargateTemplate) DeepCopyInto

func (in *StargateTemplate) DeepCopyInto(out *StargateTemplate)

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