v1alpha1

package
v0.0.0-...-b4e7bf2 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0, MIT Imports: 6 Imported by: 4

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the clickhouse v1alpha1 API group +kubebuilder:object:generate=true +groupName=clickhouse.gitlab.com

Index

Constants

View Source
const (
	// StatusInProgress when we're still waiting for cluster creation.
	StatusInProgress ClickHouseClusterStatus = "InProgress"

	// StatusComplete when the cluster is entirely available.
	StatusCompleted ClickHouseClusterStatus = "Completed"

	// StatusTerminating when the resource is being deleted.
	// Note(joe): not currently used, but likely will be if we need graceful shutdown.
	StatusTerminating ClickHouseClusterStatus = "Terminating"

	// BackendS3 maps to Amazon S3 as the object storage provider.
	BackendS3 ClickhouseObjectStorageBackend = "S3"

	// BackendGCS maps to Google Cloud Storage as the object storage provider.
	// Note(Arun): Currently not in use, as clickhouse support is absent.
	BackendGCS ClickhouseObjectStorageBackend = "GCS"
)

Variables

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

type ClickHouse struct {
	metav1.TypeMeta `json:",inline"`

	// Standard object's metadata.
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// Spec of desired behavior.
	// +optional
	Spec ClickHouseSpec `json:"spec,omitempty"`

	// Status of the ClickHouse cluster
	// +optional
	Status ClickHouseStatus `json:"status,omitempty"`
}

ClickHouse is the Schema for the clickhouses API.

func (*ClickHouse) DeepCopy

func (in *ClickHouse) DeepCopy() *ClickHouse

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

func (*ClickHouse) DeepCopyInto

func (in *ClickHouse) DeepCopyInto(out *ClickHouse)

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

func (*ClickHouse) DeepCopyObject

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

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

type ClickHouseAdmin

type ClickHouseAdmin struct {
	// Name is the username of the user.
	Name string `json:"name"`

	// SecretKeyRef points to the secret value where the admin user's password is held.
	// The secret must be in the same K8s namespace as the ClickHouse instance referencing it.
	// This only applies upon user creation and later changes are not automatically synchronized.
	SecretKeyRef corev1.SecretKeySelector `json:"secretKeyRef"`
}

ClickHouseAdmin defines a managed admin user to be configured in the ClickHouse instance. This is used to define "bootstrap" admin users that can then create other limited users.

func (*ClickHouseAdmin) DeepCopy

func (in *ClickHouseAdmin) DeepCopy() *ClickHouseAdmin

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

func (*ClickHouseAdmin) DeepCopyInto

func (in *ClickHouseAdmin) DeepCopyInto(out *ClickHouseAdmin)

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

type ClickHouseClusterStatus

type ClickHouseClusterStatus string

ClickHouseClusterStatus gives general state of cluster setup.

type ClickHouseList

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

ClickHouseList contains a list of ClickHouse.

func (*ClickHouseList) DeepCopy

func (in *ClickHouseList) DeepCopy() *ClickHouseList

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

func (*ClickHouseList) DeepCopyInto

func (in *ClickHouseList) DeepCopyInto(out *ClickHouseList)

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

func (*ClickHouseList) DeepCopyObject

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

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

type ClickHouseObjectStorage

type ClickHouseObjectStorage struct {
	// Backend provides the object storage, for example S3/GCS.
	// Default is S3.
	Backend ClickhouseObjectStorageBackend `json:"backend"`

	// EndpointURL is currently S3 endpoint URL in path or virtual hosted styles.
	// Endpoint URL should contain a bucket and root path to store data.
	// Note(Arun): GCS specific URLs should adhere to the same specification.
	EndpointURL string `json:"endpointURL"`

	// AccessKeyIDSecret refers to the secret for the access key ID.
	// The secret must be in the same K8s namespace as the ClickHouse instance referencing it.
	// This only applies upon user creation and later changes are not automatically synchronized.
	AccessKeyIDSecret *corev1.SecretKeySelector `json:"accessKeyIDSecret"`

	// AccessKeySecret refers to the secret for the access key.
	// The secret must be in the same K8s namespace as the ClickHouse instance referencing it.
	// This only applies upon user creation and later changes are not automatically synchronized.
	AccessKeySecret *corev1.SecretKeySelector `json:"accessKeySecret"`

	// Region is the S3/GCS region name where the bucket is located.
	// +optional
	Region *string `json:"region,omitempty"`

	// CustomerKey refers to the secret for the customer key for server side encryption.
	// +optional
	CustomerKey *corev1.SecretKeySelector `json:"customerKey,omitempty"`
}

ClickHouseObjectStorage describes configuration for applicable object storage backend(S3/GCS).

func (*ClickHouseObjectStorage) DeepCopy

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

func (*ClickHouseObjectStorage) DeepCopyInto

func (in *ClickHouseObjectStorage) DeepCopyInto(out *ClickHouseObjectStorage)

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

type ClickHouseSpec

type ClickHouseSpec struct {
	// Image is the ClickHouse docker image to be used for nodes.
	Image string `json:"image"`

	// KeeperImage is the ClickHouse keeper image to use.
	// Optional: keeper image is by default derived from the `Image` value.
	// +optional
	KeeperImage *string `json:"keeperImage,omitempty"`

	// Replicas is the number of desired nodes to run.
	// The instance will always be deployed in distributed mode, even if replicas=1.
	// Optional to discriminate between explicit zero and not set.
	// Defaults to 1.
	// +optional
	// +kubebuilder:default=1
	Replicas *int32 `json:"replicas,omitempty"`

	// ServerResourceRequirements is the description of resource requests & limits
	// for the ClickHouse server application container.
	// +optional
	ServerResourceRequirements *corev1.ResourceRequirements `json:"resources,omitempty"`

	// StorageSize is the amount of block storage capacity to allocate per replica.
	StorageSize resource.Quantity `json:"storageSize"`

	// NodeSelector applies pod template NodeSelector to the ClickHouse StatefulSets.
	// More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
	// +optional
	// +mapType=atomic
	NodeSelector map[string]string `json:"nodeSelector,omitempty"`

	// Affinity has any restrictions on replica placement in the cluster.
	// This is copied through to the nodes.
	// +optional
	Affinity *corev1.Affinity `json:"affinity,omitempty"`

	// Tolerations are optional pod template Tolerations for ClickHouse StatefulSets.
	// More info: https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/
	// +optional
	Tolerations []corev1.Toleration `json:"tolerations,omitempty"`

	// StorageClass is the storage class to use for data volumes
	// +optional
	StorageClass *string `json:"storageClass,omitempty"`

	// InternalSSL is a flag to enable ssl between server/clients of the Clickhouse deployment.
	// Defaults to false. Assumes that certmanager is installed in the cluster.
	// +optional
	// +kubebuilder:default=false
	InternalSSL *bool `json:"internalSSL,omitempty"`

	// AdminUsers contains one or more admin users (access_management=1) to create in the instance.
	// Additional non-admin users may be added via ClickHouse APIs using these credentials.
	// +optional
	AdminUsers []ClickHouseAdmin `json:"adminUsers,omitempty"`

	// ObjectStorage is the configuration for the object storage that will be used by ClickHouse.
	// +optional
	ObjectStorage *ClickHouseObjectStorage `json:"objectStorage,omitempty"`
}

ClickHouseSpec defines the desired state of ClickHouse.

func (*ClickHouseSpec) DeepCopy

func (in *ClickHouseSpec) DeepCopy() *ClickHouseSpec

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

func (*ClickHouseSpec) DeepCopyInto

func (in *ClickHouseSpec) DeepCopyInto(out *ClickHouseSpec)

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

type ClickHouseStatus

type ClickHouseStatus struct {
	// Status is general status of cluster availability.
	// +optional
	Status ClickHouseClusterStatus `json:"status,omitempty"`

	// ReadyShards is the number of StatefulSet shards that have a ready condition.
	// A Single shard is comprised of a number of replicas.
	// +optional
	ReadyShards int32 `json:"readyShards"`

	// ReadyStorage is the number of PersistentVolumeClaims which finished all
	// resizing operations and are in sync with storage defined in the CR.
	// +optional
	ReadyStorage int32 `json:"readyStorage"`

	// ReadyReplicas is the number of StatefulSet cluster replicas that have a ready condition.
	// Considered ready when the StatefulSet readyReplicas equals its spec.replicas.
	// +optional
	ReadyReplicas int32 `json:"readyReplicas"`

	// ObservedGeneration is the value of the object's Generation field when
	// controller was reconiling the object the last time
	// +optional
	ObservedGeneration int64 `json:"observedGeneration"`
}

ClickHouseStatus defines the observed state of ClickHouse.

func (*ClickHouseStatus) DeepCopy

func (in *ClickHouseStatus) DeepCopy() *ClickHouseStatus

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

func (*ClickHouseStatus) DeepCopyInto

func (in *ClickHouseStatus) DeepCopyInto(out *ClickHouseStatus)

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

type ClickhouseObjectStorageBackend

type ClickhouseObjectStorageBackend string

ClickhouseObjectStorageBackend defines the backend for the object storage to be used by Clickhouse. By Default it is S3. +kubebuilder:validation:Enum=S3;GCS

Jump to

Keyboard shortcuts

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