v1alpha1

package
v0.0.0-...-7d6bf39 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the kafka v1alpha1 API group +kubebuilder:object:generate=true +groupName=kafka.zncdata.dev

Index

Constants

View Source
const (
	DefaultRepository      = "quay.io/zncdatadev"
	DefaultProductVersion  = "3.7.1"
	DefaultProductName     = "kafka"
	DefaultKubedoopVersion = "0.0.0-dev"
)
View Source
const (
	Log4jFileName    = "log4j.properties"
	SecurityFileName = "security.properties"
	ServerFileName   = "server.properties"
)
View Source
const (
	ClientPortName       = "kafka"
	SecureClientPortName = "kafka-tls"
	InternalPortName     = "internal"
	MetricsPortName      = "metrics"

	ClientPort                = 9092
	SecurityClientPort        = 9093
	InternalPort              = 19092
	SecurityInternalPort      = 19093
	MetricsPort               = 9606
	PodSvcClientNodePortMin   = 30092
	PodSvcInternalNodePortMin = 31092
)
View Source
const (
	ImageRepository = "quay.io/zncdatadev/kafka"
	ImageTag        = "3.7.1-kubedoop0.0.0-dev"
	ImagePullPolicy = corev1.PullAlways

	KubedoopKafkaDataDirName = "data" // kafka log dirs
	KubedoopLogConfigDirName = "log-config"
	KubedoopConfigDirName    = "config"
	KubedoopTmpDirName       = "tmp"
	KubedoopLogDirName       = "log"

	KubedoopRoot         = "/kubedoop"
	KubedoopTmpDir       = KubedoopRoot + "/tmp"
	KubedoopDataDir      = KubedoopRoot + "/data"
	KubedoopConfigDir    = KubedoopRoot + "/config"
	KubedoopLogConfigDir = KubedoopRoot + "/log_config"
	KubedoopLogDir       = KubedoopRoot + "/log"
)
View Source
const (
	CpuMin      = "1"
	CpuMax      = "1.5"
	MemoryLimit = "1.5Gi"
)
View Source
const GroupName = "kafka.zncdata.dev"
View Source
const RootLogger string = "ROOT"
type LoggingSpec struct {
	// +kubebuilder:validation:Optional
	Containers *ContainerLoggingSpec `json:"containers,omitempty"`
}

Variables

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

func TransformImage

func TransformImage(imageSpec *ImageSpec) *util.Image

Types

type BrokersConfigSpec

type BrokersConfigSpec struct {
	// +kubebuilder:validation:Optional
	Resources *ResourcesSpec `json:"resources,omitempty"`

	// +kubebuilder:validation:Optional
	// +kubebuilder:default:="cluster-internal"
	ListenerClass string `json:"listenerClass,omitempty"`

	// +kubebuilder:validation:Optional
	SecurityContext *corev1.PodSecurityContext `json:"securityContext"`

	// +kubebuilder:validation:Optional
	Affinity *corev1.Affinity `json:"affinity"`

	// +kubebuilder:validation:Optional
	NodeSelector map[string]string `json:"nodeSelector,omitempty"`

	// +kubebuilder:validation:Optional
	Tolerations []corev1.Toleration `json:"tolerations"`

	// +kubebuilder:validation:Optional
	PodDisruptionBudget *PodDisruptionBudgetSpec `json:"podDisruptionBudget,omitempty"`

	// +kubebuilder:validation:Optional
	StorageClass string `json:"storageClass,omitempty"`

	// +kubebuilder:validation:Optional
	// +kubebuilder:default="8Gi"
	StorageSize string `json:"storageSize,omitempty"`

	// +kubebuilder:validation:Optional
	ExtraEnv map[string]string `json:"extraEnv,omitempty"`

	// +kubebuilder:validation:Optional
	ExtraSecret map[string]string `json:"extraSecret,omitempty"`

	// +kubebuilder:validation:Optional
	Logging *BrokersContainerLoggingSpec `json:"logging,omitempty"`
}

func (*BrokersConfigSpec) DeepCopy

func (in *BrokersConfigSpec) DeepCopy() *BrokersConfigSpec

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

func (*BrokersConfigSpec) DeepCopyInto

func (in *BrokersConfigSpec) DeepCopyInto(out *BrokersConfigSpec)

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

type BrokersContainerLoggingSpec

type BrokersContainerLoggingSpec struct {
	// +kubebuilder:validation:Optional
	// +kubebuilder:default=false
	EnableVectorAgent bool `json:"enableVectorAgent,omitempty"`
	// +kubebuilder:validation:Optional
	Broker *LoggingConfigSpec `json:"broker,omitempty"`
}

func (*BrokersContainerLoggingSpec) DeepCopy

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

func (*BrokersContainerLoggingSpec) DeepCopyInto

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

type BrokersRoleGroupSpec

type BrokersRoleGroupSpec struct {
	// +kubebuilder:validation:Optional
	// +kubebuilder:default:=1
	Replicas int32 `json:"replicas,omitempty"`

	// +kubebuilder:validation:Required
	Config *BrokersConfigSpec `json:"config,omitempty"`

	// +kubebuilder:validation:Optional
	CliOverrides []string `json:"cliOverrides,omitempty"`

	// +kubebuilder:validation:Optional
	ConfigOverrides *ConfigOverridesSpec `json:"configOverrides,omitempty"`

	// +kubebuilder:validation:Optional
	EnvOverrides map[string]string `json:"envOverrides,omitempty"`
}

func (*BrokersRoleGroupSpec) DeepCopy

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

func (*BrokersRoleGroupSpec) DeepCopyInto

func (in *BrokersRoleGroupSpec) DeepCopyInto(out *BrokersRoleGroupSpec)

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

type BrokersSpec

type BrokersSpec struct {
	// +kubebuilder:validation:Optional
	Config *BrokersConfigSpec `json:"config,omitempty"`

	// +kubebuilder:validation:Optional
	RoleGroups map[string]*BrokersRoleGroupSpec `json:"roleGroups,omitempty"`

	// +kubebuilder:validation:Optional
	PodDisruptionBudget *PodDisruptionBudgetSpec `json:"podDisruptionBudget,omitempty"`

	// +kubebuilder:validation:Optional
	CliOverrides []string `json:"cliOverrides,omitempty"`

	// +kubebuilder:validation:Optional
	ConfigOverrides *ConfigOverridesSpec `json:"configOverrides,omitempty"`

	// +kubebuilder:validation:Optional
	EnvOverrides map[string]string `json:"envOverrides,omitempty"`
}

func (*BrokersSpec) DeepCopy

func (in *BrokersSpec) DeepCopy() *BrokersSpec

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

func (*BrokersSpec) DeepCopyInto

func (in *BrokersSpec) DeepCopyInto(out *BrokersSpec)

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

type CPUResource

type CPUResource struct {
	// +kubebuilder:validation:Optional
	Max *resource.Quantity `json:"max,omitempty"`

	// +kubebuilder:validation:Optional
	Min *resource.Quantity `json:"min,omitempty"`
}

func (*CPUResource) DeepCopy

func (in *CPUResource) DeepCopy() *CPUResource

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

func (*CPUResource) DeepCopyInto

func (in *CPUResource) DeepCopyInto(out *CPUResource)

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

type ClusterConfigSpec

type ClusterConfigSpec struct {
	// +kubebuilder:validation:Optional
	Service *ServiceSpec `json:"service,omitempty"`

	// +kubebuilder:validation:Optional
	// +kubebuilder:default:="cluster.local"
	ClusterDomain string `json:"clusterDomain,omitempty"`

	// +kubebuilder:validation:Optional
	Tls *TlsSpec `json:"tls,omitempty"`

	// +kubebuilder:validation:Optional
	VectorAggregatorConfigMapName string `json:"vectorAggregatorConfigMapName,omitempty"`

	// +kubebuilder:validation:required
	ZookeeperConfigMapName string `json:"zookeeperConfigMapName,omitempty"`
}

func (*ClusterConfigSpec) DeepCopy

func (in *ClusterConfigSpec) DeepCopy() *ClusterConfigSpec

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

func (*ClusterConfigSpec) DeepCopyInto

func (in *ClusterConfigSpec) DeepCopyInto(out *ClusterConfigSpec)

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

type ConfigOverridesSpec

type ConfigOverridesSpec struct {
	Log4j    map[string]string `json:"log4j.properties,omitempty"`
	Security map[string]string `json:"security.properties,omitempty"`
}

func (*ConfigOverridesSpec) DeepCopy

func (in *ConfigOverridesSpec) DeepCopy() *ConfigOverridesSpec

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

func (*ConfigOverridesSpec) DeepCopyInto

func (in *ConfigOverridesSpec) DeepCopyInto(out *ConfigOverridesSpec)

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

type ImageSpec

type ImageSpec struct {
	// +kubebuilder:validation:Optional
	Custom string `json:"custom,omitempty"`

	// +kubebuilder:validation:Optional
	// +kubebuilder:default=quay.io/zncdatadev
	Repo string `json:"repository,omitempty"`

	// +kubebuilder:validation:Optional
	// +kubebuilder:default="0.0.0-dev"
	KubedoopVersion string `json:"kubedoopVersion,omitempty"`

	// +kubebuilder:validation:Optional
	// +kubebuilder:default="3.7.1"
	ProductVersion string `json:"productVersion,omitempty"`

	// +kubebuilder:validation:Optional
	// +kubebuilder:default:=IfNotPresent
	PullPolicy *corev1.PullPolicy `json:"pullPolicy,omitempty"`

	// +kubebuilder:validation:Optional
	PullSecretName string `json:"pullSecretName,omitempty"`
}

func DefaultImageSpec

func DefaultImageSpec() *ImageSpec

func (*ImageSpec) DeepCopy

func (in *ImageSpec) DeepCopy() *ImageSpec

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

func (*ImageSpec) DeepCopyInto

func (in *ImageSpec) DeepCopyInto(out *ImageSpec)

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

type KafkaAuthenticationSpec

type KafkaAuthenticationSpec struct {
	/*
	 *	 ## TLS provider
	 *
	 *	 Only affects client connections. This setting controls:
	 *	 - If clients need to authenticate themselves against the broker via TLS
	 *	 - Which ca.crt to use when validating the provided client certs
	 *
	 *	 This will override the server TLS settings (if set) in `spec.clusterConfig.tls.serverSecretClass`.
	 */
	// +kubebuilder:validation:Optional
	AuthenticationClass string `json:"authenticationClass,omitempty"`
}

func (*KafkaAuthenticationSpec) DeepCopy

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

func (*KafkaAuthenticationSpec) DeepCopyInto

func (in *KafkaAuthenticationSpec) DeepCopyInto(out *KafkaAuthenticationSpec)

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 status.Status    `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.

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 {
	// +kubebuilder:validation:Optional
	Image *ImageSpec `json:"image,omitempty"`

	// +kubebuilder:validation:Required
	ClusterConfig *ClusterConfigSpec `json:"clusterConfig,omitempty"`

	// +kubebuilder:validation:Required
	Brokers *BrokersSpec `json:"brokers,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 LogLevelSpec

type LogLevelSpec struct {
	// +kubebuilder:validation:Optional
	// +kubebuilder:default:="INFO"
	// +kubebuilder:validation:Enum=FATAL;ERROR;WARN;INFO;DEBUG;TRACE
	Level string `json:"level,omitempty"`
}

LogLevelSpec level mapping example |---------------------|-----------------| | superset log level | zds log level | |---------------------|-----------------| | CRITICAL | FATAL | | ERROR | ERROR | | WARNING | WARN | | INFO | INFO | | DEBUG | DEBUG | | DEBUG | TRACE | |---------------------|-----------------|

func (*LogLevelSpec) DeepCopy

func (in *LogLevelSpec) DeepCopy() *LogLevelSpec

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

func (*LogLevelSpec) DeepCopyInto

func (in *LogLevelSpec) DeepCopyInto(out *LogLevelSpec)

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

type LoggingConfigSpec

type LoggingConfigSpec struct {
	// +kubebuilder:validation:Optional
	Loggers map[string]*LogLevelSpec `json:"loggers,omitempty"`

	// +kubebuilder:validation:Optional
	Console *LogLevelSpec `json:"console,omitempty"`

	// +kubebuilder:validation:Optional
	File *LogLevelSpec `json:"file,omitempty"`
}

func (*LoggingConfigSpec) DeepCopy

func (in *LoggingConfigSpec) DeepCopy() *LoggingConfigSpec

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

func (*LoggingConfigSpec) DeepCopyInto

func (in *LoggingConfigSpec) DeepCopyInto(out *LoggingConfigSpec)

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

type MemoryResource

type MemoryResource struct {
	// +kubebuilder:validation:Optional
	Limit *resource.Quantity `json:"limit,omitempty"`
}

func (*MemoryResource) DeepCopy

func (in *MemoryResource) DeepCopy() *MemoryResource

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

func (*MemoryResource) DeepCopyInto

func (in *MemoryResource) DeepCopyInto(out *MemoryResource)

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

type PodDisruptionBudgetSpec

type PodDisruptionBudgetSpec struct {
	// +kubebuilder:validation:Optional
	MinAvailable int32 `json:"minAvailable,omitempty"`

	// +kubebuilder:validation:Optional
	MaxUnavailable int32 `json:"maxUnavailable,omitempty"`
}

func (*PodDisruptionBudgetSpec) DeepCopy

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

func (*PodDisruptionBudgetSpec) DeepCopyInto

func (in *PodDisruptionBudgetSpec) DeepCopyInto(out *PodDisruptionBudgetSpec)

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

type ResourcesSpec

type ResourcesSpec struct {
	// +kubebuilder:validation:Optional
	CPU *CPUResource `json:"cpu,omitempty"`

	// +kubebuilder:validation:Optional
	Memory *MemoryResource `json:"memory,omitempty"`

	// +kubebuilder:validation:Optional
	Storage *StorageResource `json:"storage,omitempty"`
}

func (*ResourcesSpec) DeepCopy

func (in *ResourcesSpec) DeepCopy() *ResourcesSpec

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

func (*ResourcesSpec) DeepCopyInto

func (in *ResourcesSpec) DeepCopyInto(out *ResourcesSpec)

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

type ServiceSpec

type ServiceSpec struct {
	// +kubebuilder:validation:Optional
	Annotations map[string]string `json:"annotations,omitempty"`

	// +kubebuilder:validation:Optional
	// +kubebuilder:validation:enum=ClusterIP;NodePort;LoadBalancer;ExternalName
	// +kubebuilder:default=ClusterIP
	Type corev1.ServiceType `json:"type,omitempty"`

	// +kubebuilder:validation:Optional
	// +kubebuilder:validation:Minimum=1
	// +kubebuilder:validation:Maximum=65535
	// +kubebuilder:default=18080
	Port int32 `json:"port,omitempty"`
}

func (*ServiceSpec) DeepCopy

func (in *ServiceSpec) DeepCopy() *ServiceSpec

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

func (*ServiceSpec) DeepCopyInto

func (in *ServiceSpec) DeepCopyInto(out *ServiceSpec)

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

type StorageResource

type StorageResource struct {
	// +kubebuilder:validation:Optional
	// +kubebuilder:default="10Gi"
	Capacity resource.Quantity `json:"capacity,omitempty"`

	// +kubebuilder:validation:Optional
	StorageClass string `json:"storageClass,omitempty"`
}

func (*StorageResource) DeepCopy

func (in *StorageResource) DeepCopy() *StorageResource

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

func (*StorageResource) DeepCopyInto

func (in *StorageResource) DeepCopyInto(out *StorageResource)

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

type StorageResourceSpec

type StorageResourceSpec struct {
	Data *StorageResource `json:"data"`
}

func (*StorageResourceSpec) DeepCopy

func (in *StorageResourceSpec) DeepCopy() *StorageResourceSpec

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

func (*StorageResourceSpec) DeepCopyInto

func (in *StorageResourceSpec) DeepCopyInto(out *StorageResourceSpec)

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

type TlsSpec

type TlsSpec struct {
	// The SecretClass to use for internal broker communication. Use mutual verification between brokers (mandatory).
	// This setting controls: - Which cert the brokers should use to authenticate themselves against other brokers -
	// Which ca.crt to use when validating the other brokers Defaults to tls
	//
	// +kubebuilder:validation:Optional
	ServerSecretClass string `json:"serverSecretClass,omitempty"`
	// The SecretClass to use for client connections. This setting controls: - If TLS encryption is used at all -
	// Which cert the servers should use to authenticate themselves against the client Defaults to tls.
	//
	// +kubebuilder:validation:Optional
	InternalSecretClass string `json:"internalSecretClass,omitempty"`

	// todo: use secret resource
	// +kubebuilder:validation:Optional
	// +kubebuilder:default="chageit"
	SSLStorePassword string `json:"sslStorePassword,omitempty"`
}

func (*TlsSpec) DeepCopy

func (in *TlsSpec) DeepCopy() *TlsSpec

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

func (*TlsSpec) DeepCopyInto

func (in *TlsSpec) DeepCopyInto(out *TlsSpec)

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