v1beta1

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: May 12, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package v1beta1 contains API Schema definitions for the kafka v1beta1 API group +kubebuilder:object:generate=true +groupName=kafka.infra.doodle.com

Index

Constants

View Source
const (
	CleanupPolicyDelete        = "delete"
	CleanupPolicyCompact       = "compact"
	CleanupPolicyDeleteCompact = "delete,compact"
)
View Source
const (
	CompressionTypeGZIP         = "gzip"
	CompressionTypeSnappy       = "snappy"
	CompressionTypeLZ4          = "lz4"
	CompressionTypeZSTD         = "zstd"
	CompressionTypeUncompressed = "uncompressed"
	CompressionTypeProducer     = "producer"
)
View Source
const (
	MessageTimestampTypeCreateTime    = "CreateTime"
	MessageTimestampTypeLogAppendTime = "LogAppendTime"
)
View Source
const (
	ReplicationFactorFailedToChangeReason = "ReplicationFactorFailedToChange"
	PartitionsFailedToRemoveReason        = "PartitionsFailedToRemove"
	PartitionsFailedToCreateReason        = "PartitionsFailedToCreate"
	TopicFailedToGetReason                = "TopicFailedToGet"
	TopicFailedToCreateReason             = "TopicFailedToCreate"
	TopicFailedToUpdateReason             = "TopicFailedToUpdate"
	TopicReadyReason                      = "TopicReadyReason"
)
View Source
const (
	ReadyCondition = "Ready"
)

Variables

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

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

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

	Spec   KafkaTopicSpec   `json:"spec,omitempty"`
	Status KafkaTopicStatus `json:"status,omitempty"`
}

KafkaTopic is the Schema for the kafkatopics API

func KafkaTopicNotReady

func KafkaTopicNotReady(topic KafkaTopic, reason, message string) KafkaTopic

KafkaTopicNotReady

func KafkaTopicReady

func KafkaTopicReady(topic KafkaTopic, reason, message string) KafkaTopic

KafkaTopicReady

func (*KafkaTopic) DeepCopy

func (in *KafkaTopic) DeepCopy() *KafkaTopic

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

func (*KafkaTopic) DeepCopyInto

func (in *KafkaTopic) DeepCopyInto(out *KafkaTopic)

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

func (*KafkaTopic) DeepCopyObject

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

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

func (*KafkaTopic) GetAddress

func (in *KafkaTopic) GetAddress() string

func (*KafkaTopic) GetCleanupPolicy

func (in *KafkaTopic) GetCleanupPolicy() *string

func (*KafkaTopic) GetCompressionType

func (in *KafkaTopic) GetCompressionType() *string

func (*KafkaTopic) GetDeleteRetentionMs

func (in *KafkaTopic) GetDeleteRetentionMs() *int64

func (*KafkaTopic) GetFileDeleteDelayMs

func (in *KafkaTopic) GetFileDeleteDelayMs() *int64

func (*KafkaTopic) GetFlushMessages

func (in *KafkaTopic) GetFlushMessages() *int64

func (*KafkaTopic) GetFlushMs

func (in *KafkaTopic) GetFlushMs() *int64

func (*KafkaTopic) GetFollowerReplicationThrottledReplicas

func (in *KafkaTopic) GetFollowerReplicationThrottledReplicas() *string

func (*KafkaTopic) GetIndexIntervalBytes

func (in *KafkaTopic) GetIndexIntervalBytes() *int64

func (*KafkaTopic) GetLeaderReplicationThrottledReplicas

func (in *KafkaTopic) GetLeaderReplicationThrottledReplicas() *string

func (*KafkaTopic) GetMaxCompactionLagMs

func (in *KafkaTopic) GetMaxCompactionLagMs() *int64

func (*KafkaTopic) GetMaxMessageBytes

func (in *KafkaTopic) GetMaxMessageBytes() *int64

func (*KafkaTopic) GetMessageDownconversionEnable

func (in *KafkaTopic) GetMessageDownconversionEnable() *bool

func (*KafkaTopic) GetMessageFormatVersion

func (in *KafkaTopic) GetMessageFormatVersion() *string

func (*KafkaTopic) GetMessageTimestampDifferenceMaxMs

func (in *KafkaTopic) GetMessageTimestampDifferenceMaxMs() *int64

func (*KafkaTopic) GetMessageTimestampType

func (in *KafkaTopic) GetMessageTimestampType() *string

func (*KafkaTopic) GetMinCleanableDirtyRatio

func (in *KafkaTopic) GetMinCleanableDirtyRatio() *resource.Quantity

func (*KafkaTopic) GetMinCompactionLagMs

func (in *KafkaTopic) GetMinCompactionLagMs() *int64

func (*KafkaTopic) GetMinInsyncReplicas

func (in *KafkaTopic) GetMinInsyncReplicas() *int64

func (*KafkaTopic) GetPartitions

func (in *KafkaTopic) GetPartitions() int64

func (*KafkaTopic) GetPreallocate

func (in *KafkaTopic) GetPreallocate() *bool

func (*KafkaTopic) GetReplicationFactor

func (in *KafkaTopic) GetReplicationFactor() int64

func (*KafkaTopic) GetRetentionBytes

func (in *KafkaTopic) GetRetentionBytes() *int64

func (*KafkaTopic) GetRetentionMs

func (in *KafkaTopic) GetRetentionMs() *int64

func (*KafkaTopic) GetSegmentBytes

func (in *KafkaTopic) GetSegmentBytes() *int64

func (*KafkaTopic) GetSegmentIndexBytes

func (in *KafkaTopic) GetSegmentIndexBytes() *int64

func (*KafkaTopic) GetSegmentJitterMs

func (in *KafkaTopic) GetSegmentJitterMs() *int64

func (*KafkaTopic) GetSegmentMs

func (in *KafkaTopic) GetSegmentMs() *int64

func (*KafkaTopic) GetStatusConditions

func (in *KafkaTopic) GetStatusConditions() *[]metav1.Condition

GetStatusConditions returns a pointer to the Status.Conditions slice

func (*KafkaTopic) GetTopicName

func (in *KafkaTopic) GetTopicName() string

func (*KafkaTopic) GetUncleanLeaderElectionEnable

func (in *KafkaTopic) GetUncleanLeaderElectionEnable() *bool

type KafkaTopicConfig

type KafkaTopicConfig struct {

	// Designates the retention policy to use on old log segments.
	// Either "delete" or "compact" or both ("delete,compact").
	// The default policy ("delete") will discard old segments when their retention time or size limit has been reached.
	// The "compact" setting will enable log compaction on the topic.
	// +optional
	CleanupPolicy *string `json:"cleanupPolicy,omitempty"`

	// Final compression type for a given topic.
	// Supported are standard compression codecs: 'gzip', 'snappy', 'lz4', 'zstd').
	// It additionally accepts 'uncompressed' which is equivalent to no compression; and 'producer' which means retain the original compression codec set by the producer.
	// +optional
	CompressionType *string `json:"compressionType,omitempty"`

	// The amount of time to retain delete tombstone markers for log compacted topics. Specified in milliseconds.
	// This setting also gives a bound on the time in which a consumer must complete a read if they begin from offset 0
	// to ensure that they get a valid snapshot of the final stage (otherwise delete tombstones may be collected before they complete their scan).
	// +optional
	DeleteRetentionMs *int64 `json:"deleteRetentionMs,omitempty"`

	// The time to wait before deleting a file from the filesystems
	// +optional
	FileDeleteDelayMs *int64 `json:"fileDeleteDelayMs,omitempty"`

	// This setting allows specifying an interval at which there will be a force if an fsync of data written to the log.
	// For example, if this was set to 1 there would be a fsync after every message; if it were 5 there would be a fsync after every five messages.
	// In general, it is recommended not to set this and use replication for durability and allow the operating system's background flush capabilities as it is more efficient.
	// +optional
	FlushMessages *int64 `json:"flushMessages,omitempty"`

	// This setting allows specifying a time interval at which there will be a force of an fsync of data written to the log.
	// For example if this was set to 1000 there would be a fsync after 1000 ms had passed.
	// In general, it is not recommended to set this and instead use replication for durability and allow the operating system's background flush capabilities as it is more efficient.
	// +optional
	FlushMs *int64 `json:"flushMs,omitempty"`

	// A list of replicas for which log replication should be throttled on the follower side.
	// The list should describe a set of replicas in the form [PartitionId]:[BrokerId],[PartitionId]:[BrokerId]:... or alternatively the wildcard '*' can be used to throttle all replicas for this topic.
	// +optional
	FollowerReplicationThrottledReplicas *string `json:"followerReplicationThrottledReplicas,omitempty"`

	// This setting controls how frequently Kafka adds an index entry to its offset index.
	// The default setting ensures that a messages is indexed roughly every 4096 bytes.
	// More indexing allows reads to jump closer to the exact position in the log but makes the index larger. You probably don't need to change this.
	// +optional
	IndexIntervalBytes *int64 `json:"indexIntervalBytes,omitempty"`

	// A list of replicas for which log replication should be throttled on the leader side.
	// The list should describe a set of replicas in the form [PartitionId]:[BrokerId],[PartitionId]:[BrokerId]:... or alternatively the wildcard '*' can be used to throttle all replicas for this topic.
	// +optional
	LeaderReplicationThrottledReplicas *string `json:"leaderReplicationThrottledReplicas,omitempty"`

	// The largest record batch size allowed by Kafka.
	// If this is increased and there are consumers older than 0.10.2, the consumers' fetch size must also be increased so that the they can fetch record batches this large.
	// In the latest message format version, records are always grouped into batches for efficiency.
	// In previous message format versions, uncompressed records are not grouped into batches and this limit only applies to a single record in that case.
	// +optional
	MaxMessageBytes *int64 `json:"maxMessageBytes,omitempty"`

	// This configuration controls whether down-conversion of message formats is enabled to satisfy consume requests.
	// When set to false, broker will not perform down-conversion for consumers expecting an older message format.
	// The broker responds with UNSUPPORTED_VERSION error for consume requests from such older clients.
	// This configuration does not apply to any message format conversion that might be required for replication to followers.
	// +optional
	MessageDownconversionEnable *bool `json:"messageDownconversionEnable,omitempty"`

	// Specify the message format version the broker will use to append messages to the logs.
	// The value should be a valid ApiVersion. Some examples are: 0.8.2, 0.9.0.0, 0.10.0, check ApiVersion for more details.
	// By setting a particular message format version, the user is certifying that all the existing messages on disk are smaller or equal than the specified version.
	// Setting this value incorrectly will cause consumers with older versions to break as they will receive messages with a format that they don't understand.
	// +optional
	MessageFormatVersion *string `json:"messageFormatVersion,omitempty"`

	// The maximum difference allowed between the timestamp when a broker receives a message and the timestamp specified in the message.
	// If MessageTimestampType=CreateTime, a message will be rejected if the difference in timestamp exceeds this threshold.
	// This configuration is ignored if MessageTimestampType=LogAppendTime.
	// +optional
	MessageTimestampDifferenceMaxMs *int64 `json:"messageTimestampDifferenceMaxMs,omitempty"`

	// Define whether the timestamp in the message is message create time or log append time.
	// The value should be either `CreateTime` or `LogAppendTime`
	// +optional
	MessageTimestampType *string `json:"messageTimestampType,omitempty"`

	// This configuration controls how frequently the log compactor will attempt to clean the log (assuming LogCompaction is enabled).
	// By default we will avoid cleaning a log where more than 50% of the log has been compacted.
	// This ratio bounds the maximum space wasted in the log by duplicates (at 50% at most 50% of the log could be duplicates).
	// A higher ratio will mean fewer, more efficient cleanings but will mean more wasted space in the log.
	// If the MaxCompactionLagMs or the MinCompactionLagMs configurations are also specified, then the log compactor considers the log to be eligible for compaction as soon as either:
	// (i) the dirty ratio threshold has been met and the log has had dirty (uncompacted) records for at least the MinCompactionLagMs duration,
	// or (ii) if the log has had dirty (uncompacted) records for at most the MaxCompactionLagMs period.
	// +optional
	MinCleanableDirtyRatio *resource.Quantity `json:"minCleanableDirtyRatio,omitempty"`

	// The minimum time a message will remain uncompacted in the log. Only applicable for logs that are being compacted.
	// +optional
	MinCompactionLagMs *int64 `json:"minCompactionLagMs,omitempty"`

	// The maximum time a message will remain ineligible for compaction in the log. Only applicable for logs that are being compacted.
	// +optional
	MaxCompactionLagMs *int64 `json:"maxCompactionLagMs,omitempty"`

	// When a producer sets acks to "all" (or "-1"), this configuration specifies the minimum number of replicas that must acknowledge a write for the write to be considered successful.
	// If this minimum cannot be met, then the producer will raise an exception (either NotEnoughReplicas or NotEnoughReplicasAfterAppend).
	// When used together, MinInsyncReplicas and acks allow you to enforce greater durability guarantees.
	// A typical scenario would be to create a topic with a replication factor of 3, set MinInsyncReplicas to 2, and produce with ack of "all".
	// This will ensure that the producer raises an exception if a majority of replicas do not receive a write.
	// +optional
	MinInsyncReplicas *int64 `json:"minInsyncReplicas,omitempty"`

	// True if we should preallocate the file on disk when creating a new log segment.
	// +optional
	Preallocate *bool `json:"preallocate,omitempty"`

	// This configuration controls the maximum size a partition (which consists of log segments) can grow to before we will discard old log segments to free up space if we are using the "delete" retention policy.
	// By default there is no size limit only a time limit. Since this limit is enforced at the partition level, multiply it by the number of partitions to compute the topic retention in bytes.
	// +optional
	RetentionBytes *int64 `json:"retentionBytes,omitempty"`

	// This configuration controls the maximum time we will retain a log before we will discard old log segments to free up space if we are using the "delete" retention policy.
	// This represents an SLA on how soon consumers must read their data. If set to -1, no time limit is applied.
	// +optional
	RetentionMs *int64 `json:"retentionMs,omitempty"`

	// This configuration controls the segment file size for the log. Retention and cleaning is always done a file at a time so a larger segment size means fewer files but less granular control over retention.
	// +optional
	SegmentBytes *int64 `json:"segmentBytes,omitempty"`

	// This configuration controls the size of the index that maps offsets to file positions. We preallocate this index file and shrink it only after log rolls.
	// You generally should not need to change this setting.
	// +optional
	SegmentIndexBytes *int64 `json:"segmentIndexBytes,omitempty"`

	// The maximum random jitter subtracted from the scheduled segment roll time to avoid thundering herds of segment rolling
	// +optional
	SegmentJitterMs *int64 `json:"segmentJitterMs,omitempty"`

	// This configuration controls the period of time after which Kafka will force the log to roll even if the segment file isn't full to ensure that retention can delete or compact old data.
	// +optional
	SegmentMs *int64 `json:"segmentMs,omitempty"`

	// Indicates whether to enable replicas not in the ISR set to be elected as leader as a last resort, even though doing so may result in data loss.
	// +optional
	UncleanLeaderElectionEnable *bool `json:"uncleanLeaderElectionEnable,omitempty"`
}

KafkaTopicConfig defines additional topic configuration

func (*KafkaTopicConfig) DeepCopy

func (in *KafkaTopicConfig) DeepCopy() *KafkaTopicConfig

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

func (*KafkaTopicConfig) DeepCopyInto

func (in *KafkaTopicConfig) DeepCopyInto(out *KafkaTopicConfig)

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

type KafkaTopicList

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

KafkaTopicList contains a list of KafkaTopic

func (*KafkaTopicList) DeepCopy

func (in *KafkaTopicList) DeepCopy() *KafkaTopicList

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

func (*KafkaTopicList) DeepCopyInto

func (in *KafkaTopicList) DeepCopyInto(out *KafkaTopicList)

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

func (*KafkaTopicList) DeepCopyObject

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

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

type KafkaTopicSpec

type KafkaTopicSpec struct {

	// The connect URI
	// +required
	Address string `json:"address"`

	// Name is by default the same as metata.name
	// +optional
	Name string `json:"name"`

	// Number of partitions
	// +optional
	Partitions *int64 `json:"partitions,omitempty"`

	// Replication factor
	// +optional
	ReplicationFactor *int64 `json:"replicationFactor,omitempty"`

	// Additional topic configuration
	// +optional
	KafkaTopicConfig *KafkaTopicConfig `json:"config,omitempty"`
}

KafkaTopicSpec defines the desired state of KafkaTopic

func (*KafkaTopicSpec) DeepCopy

func (in *KafkaTopicSpec) DeepCopy() *KafkaTopicSpec

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

func (*KafkaTopicSpec) DeepCopyInto

func (in *KafkaTopicSpec) DeepCopyInto(out *KafkaTopicSpec)

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

type KafkaTopicStatus

type KafkaTopicStatus struct {
	// Conditions holds the conditions for the KafkaTopic.
	// +optional
	Conditions []metav1.Condition `json:"conditions,omitempty"`
}

KafkaTopicStatus defines the observed state of KafkaTopic

func (*KafkaTopicStatus) DeepCopy

func (in *KafkaTopicStatus) DeepCopy() *KafkaTopicStatus

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

func (*KafkaTopicStatus) DeepCopyInto

func (in *KafkaTopicStatus) DeepCopyInto(out *KafkaTopicStatus)

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