v1

package
v0.0.0-...-e4178af Latest Latest
Warning

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

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

Documentation

Overview

Package v1 contains API Schema definitions for the kafka v1 API group +kubebuilder:object:generate=true +groupName=kafka.nineinfra.tech

Index

Constants

View Source
const (
	ClusterConditionPodsReady ClusterConditionType = "PodsReady"
	ClusterConditionUpgrading                      = "Upgrading"
	ClusterConditionError                          = "Error"

	// UpdatingClusterReason Reasons for cluster upgrading condition
	UpdatingClusterReason = "Updating Cluster"
	UpgradeErrorReason    = "Upgrade Error"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "kafka.nineinfra.tech", Version: "v1"}

	// 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 ClusterCondition

type ClusterCondition struct {
	// Type of cluster condition.
	Type ClusterConditionType `json:"type,omitempty"`

	// Status of the condition, one of True, False, Unknown.
	Status corev1.ConditionStatus `json:"status,omitempty"`

	// The reason for the condition's last transition.
	Reason string `json:"reason,omitempty"`

	// A human-readable message indicating details about the transition.
	Message string `json:"message,omitempty"`

	// The last time this condition was updated.
	LastUpdateTime string `json:"lastUpdateTime,omitempty"`

	// Last time the condition transitioned from one status to another.
	LastTransitionTime string `json:"lastTransitionTime,omitempty"`
}

ClusterCondition shows the current condition of a cluster. Comply with k8s API conventions

func (*ClusterCondition) DeepCopy

func (in *ClusterCondition) DeepCopy() *ClusterCondition

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

func (*ClusterCondition) DeepCopyInto

func (in *ClusterCondition) DeepCopyInto(out *ClusterCondition)

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

type ClusterConditionType

type ClusterConditionType string

type ImageConfig

type ImageConfig struct {
	Repository string `json:"repository"`
	// Image tag. Usually the vesion of the cluster, default: `latest`.
	// +optional
	Tag string `json:"tag,omitempty"`
	// Image pull policy. One of `Always, Never, IfNotPresent`, default: `Always`.
	// +kubebuilder:default:=Always
	// +kubebuilder:validation:Enum=Always;Never;IfNotPresent
	// +optional
	PullPolicy string `json:"pullPolicy,omitempty"`
	// Secrets for image pull.
	// +optional
	PullSecrets string `json:"pullSecret,omitempty"`
}

func (*ImageConfig) DeepCopy

func (in *ImageConfig) DeepCopy() *ImageConfig

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

func (*ImageConfig) DeepCopyInto

func (in *ImageConfig) DeepCopyInto(out *ImageConfig)

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

type KafkaCluster

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

	Spec   KafkaClusterSpec   `json:"spec,omitempty"`
	Status KafkaClusterStatus `json:"status,omitempty"`
}

KafkaCluster is the Schema for the kafkaclusters API

func (*KafkaCluster) DeepCopy

func (in *KafkaCluster) DeepCopy() *KafkaCluster

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

func (*KafkaCluster) DeepCopyInto

func (in *KafkaCluster) DeepCopyInto(out *KafkaCluster)

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

func (*KafkaCluster) DeepCopyObject

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

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

func (*KafkaCluster) Default

func (r *KafkaCluster) Default()

Default implements webhook.Defaulter so a webhook will be registered for the type

func (*KafkaCluster) SetupWebhookWithManager

func (r *KafkaCluster) SetupWebhookWithManager(mgr ctrl.Manager) error

func (*KafkaCluster) ValidateCreate

func (r *KafkaCluster) ValidateCreate() (admission.Warnings, error)

ValidateCreate implements webhook.Validator so a webhook will be registered for the type

func (*KafkaCluster) ValidateDelete

func (r *KafkaCluster) ValidateDelete() (admission.Warnings, error)

ValidateDelete implements webhook.Validator so a webhook will be registered for the type

func (*KafkaCluster) ValidateUpdate

func (r *KafkaCluster) ValidateUpdate(old runtime.Object) (admission.Warnings, error)

ValidateUpdate implements webhook.Validator so a webhook will be registered for the type

type KafkaClusterList

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

KafkaClusterList contains a list of KafkaCluster

func (*KafkaClusterList) DeepCopy

func (in *KafkaClusterList) DeepCopy() *KafkaClusterList

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

func (*KafkaClusterList) DeepCopyInto

func (in *KafkaClusterList) DeepCopyInto(out *KafkaClusterList)

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

func (*KafkaClusterList) DeepCopyObject

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

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

type KafkaClusterSpec

type KafkaClusterSpec struct {
	// Version. version of the cluster.
	Version string `json:"version"`
	// Image. image config of the cluster.
	Image ImageConfig `json:"image"`
	// Resource. resouce config of the cluster.
	// +optional
	Resource ResourceConfig `json:"resource,omitempty"`
	// Conf. k/v configs for the server.properties.
	// +optional
	Conf map[string]string `json:"conf,omitempty"`
	// K8sConf. k/v configs for the cluster in k8s.such as the cluster domain
	// +optional
	K8sConf map[string]string `json:"k8sConf,omitempty"`
}

KafkaClusterSpec defines the desired state of KafkaCluster

func (*KafkaClusterSpec) DeepCopy

func (in *KafkaClusterSpec) DeepCopy() *KafkaClusterSpec

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

func (*KafkaClusterSpec) DeepCopyInto

func (in *KafkaClusterSpec) DeepCopyInto(out *KafkaClusterSpec)

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

type KafkaClusterStatus

type KafkaClusterStatus struct {
	// Members is the members in the cluster
	Members MembersStatus `json:"members,omitempty"`

	// Replicas is the number of desired replicas in the cluster
	Replicas int32 `json:"replicas,omitempty"`

	// ReadyReplicas is the number of ready replicas in the cluster
	ReadyReplicas int32 `json:"readyReplicas,omitempty"`

	// InternalClientEndpoint is the internal client IP and port
	InternalClientEndpoint string `json:"internalClientEndpoint,omitempty"`

	// ExternalClientEndpoint is the internal client IP and port
	ExternalClientEndpoint string `json:"externalClientEndpoint,omitempty"`

	// CurrentVersion is the current cluster version
	CurrentVersion string `json:"currentVersion,omitempty"`

	TargetVersion string `json:"targetVersion,omitempty"`

	// Conditions list all the applied conditions
	Conditions []ClusterCondition `json:"conditions,omitempty"`
}

KafkaClusterStatus defines the observed state of KafkaCluster

func (*KafkaClusterStatus) DeepCopy

func (in *KafkaClusterStatus) DeepCopy() *KafkaClusterStatus

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

func (*KafkaClusterStatus) DeepCopyInto

func (in *KafkaClusterStatus) DeepCopyInto(out *KafkaClusterStatus)

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

func (*KafkaClusterStatus) GetClusterCondition

func (zs *KafkaClusterStatus) GetClusterCondition(t ClusterConditionType) (int, *ClusterCondition)

func (*KafkaClusterStatus) GetLastCondition

func (zs *KafkaClusterStatus) GetLastCondition() (lastCondition *ClusterCondition)

func (*KafkaClusterStatus) Init

func (zs *KafkaClusterStatus) Init()

func (*KafkaClusterStatus) IsClusterInReadyState

func (zs *KafkaClusterStatus) IsClusterInReadyState() bool

func (*KafkaClusterStatus) IsClusterInUpgradeFailedState

func (zs *KafkaClusterStatus) IsClusterInUpgradeFailedState() bool

func (*KafkaClusterStatus) IsClusterInUpgradingState

func (zs *KafkaClusterStatus) IsClusterInUpgradingState() bool

func (*KafkaClusterStatus) SetErrorConditionFalse

func (zs *KafkaClusterStatus) SetErrorConditionFalse()

func (*KafkaClusterStatus) SetErrorConditionTrue

func (zs *KafkaClusterStatus) SetErrorConditionTrue(reason, message string)

func (*KafkaClusterStatus) SetPodsReadyConditionFalse

func (zs *KafkaClusterStatus) SetPodsReadyConditionFalse()

func (*KafkaClusterStatus) SetPodsReadyConditionTrue

func (zs *KafkaClusterStatus) SetPodsReadyConditionTrue()

func (*KafkaClusterStatus) SetUpgradingConditionFalse

func (zs *KafkaClusterStatus) SetUpgradingConditionFalse()

func (*KafkaClusterStatus) SetUpgradingConditionTrue

func (zs *KafkaClusterStatus) SetUpgradingConditionTrue(reason, message string)

func (*KafkaClusterStatus) UpdateProgress

func (zs *KafkaClusterStatus) UpdateProgress(reason, updatedReplicas string)

type MembersStatus

type MembersStatus struct {
	//+nullable
	Ready []string `json:"ready,omitempty"`
	//+nullable
	Unready []string `json:"unready,omitempty"`
}

MembersStatus is the status of the members of the cluster with both ready and unready node membership lists

func (*MembersStatus) DeepCopy

func (in *MembersStatus) DeepCopy() *MembersStatus

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

func (*MembersStatus) DeepCopyInto

func (in *MembersStatus) DeepCopyInto(out *MembersStatus)

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

type ResourceConfig

type ResourceConfig struct {
	// The replicas of the cluster workload.Default value is 1
	// +optional
	Replicas int32 `json:"replicas"`
	// num of the disks. default value is 1
	// +optional
	Disks int32 `json:"disks"`
	// the storage class. default value is nineinfra-default
	// +optional
	StorageClass string `json:"storageClass"`
	// The resource requirements of the cluster workload.
	// +optional
	ResourceRequirements corev1.ResourceRequirements `json:"resourceRequirements"`
}

func (*ResourceConfig) DeepCopy

func (in *ResourceConfig) DeepCopy() *ResourceConfig

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

func (*ResourceConfig) DeepCopyInto

func (in *ResourceConfig) DeepCopyInto(out *ResourceConfig)

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