config

package
v0.24.1 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2021 License: Apache-2.0 Imports: 15 Imported by: 2

Documentation

Index

Constants

View Source
const (
	TlsEnabled   = "tls.enabled"
	TlsCacert    = "ca.crt"
	TlsUsercert  = "user.crt"
	TlsUserkey   = "user.key"
	SaslUser     = "user"
	SaslType     = "saslType"
	SaslPassword = "password"
)

Variables

This section is empty.

Functions

func ConfigmapDataCheckSum added in v0.23.0

func ConfigmapDataCheckSum(configMapData map[string]string) string

func GetAuthConfigFromKubernetes added in v0.24.0

func GetAuthConfigFromKubernetes(ctx context.Context, secretName string, secretNamespace string) *client.KafkaAuthConfig

GetAuthConfigFromKubernetes Looks Up And Returns Kafka Auth ConfigAnd Brokers From Named Secret

func GetAuthConfigFromSecret added in v0.24.0

func GetAuthConfigFromSecret(secret *corev1.Secret) *client.KafkaAuthConfig

GetAuthConfigFromSecret Looks Up And Returns Kafka Auth Config And Brokers From Provided Secret

func InitializeKafkaConfigMapWatcher

func InitializeKafkaConfigMapWatcher(ctx context.Context, watcher configmap.Watcher, logger *zap.SugaredLogger, handler LoggingObserver, namespace string) error

Initialize The Specified Context With A ConfigMap Watcher Much Of This Function Is Taken From The knative.dev sharedmain Package

func NumPartitions added in v0.24.0

func NumPartitions(channel *kafkav1beta1.KafkaChannel, configuration *EventingKafkaConfig, logger *zap.SugaredLogger) int32

NumPartitions Gets The NumPartitions - First From Channel Spec And Then From ConfigMap-Provided Settings

func ReplicationFactor added in v0.24.0

func ReplicationFactor(channel *kafkav1beta1.KafkaChannel, configuration *EventingKafkaConfig, logger *zap.SugaredLogger) int16

ReplicationFactor Gets The ReplicationFactor - First From Channel Spec And Then From ConfigMap-Provided Settings

Types

type EKChannelConfig added in v0.24.0

type EKChannelConfig struct {
	Dispatcher EKDispatcherConfig `json:"dispatcher,omitempty"` // Consolidated and Distributed channels
	Receiver   EKReceiverConfig   `json:"receiver,omitempty"`   // Distributed channel only
	AdminType  string             `json:"adminType,omitempty"`  // Distributed channel only
}

EKChannelConfig contains items relevant to the eventing-kafka channels NOTE: Currently the consolidated channel type does not make use of most of these fields

type EKCloudEventConfig

type EKCloudEventConfig struct {
	MaxIdleConns        int `json:"maxIdleConns,omitempty"`
	MaxIdleConnsPerHost int `json:"maxIdleConnsPerHost,omitempty"`
}

EKCloudEventConfig contains the values send to the Knative cloudevents' ConfigureConnectionArgs function If they are not provided in the configmap, the DefaultMaxIdleConns and DefaultMaxIdleConnsPerHost constants are used

type EKDispatcherConfig

type EKDispatcherConfig struct {
	EKKubernetesConfig
}

EKDispatcherConfig has the base Kubernetes fields (Cpu, Memory, Replicas) only

type EKKafkaConfig

type EKKafkaConfig struct {
	Brokers             string             `json:"brokers,omitempty"`
	AuthSecretName      string             `json:"authSecretName,omitempty"`
	AuthSecretNamespace string             `json:"authSecretNamespace,omitempty"`
	Topic               EKKafkaTopicConfig `json:"topic,omitempty"`
}

EKKafkaConfig contains items relevant to Kafka specifically

type EKKafkaTopicConfig

type EKKafkaTopicConfig struct {
	DefaultNumPartitions     int32 `json:"defaultNumPartitions,omitempty"`
	DefaultReplicationFactor int16 `json:"defaultReplicationFactor,omitempty"`
	DefaultRetentionMillis   int64 `json:"defaultRetentionMillis,omitempty"`
}

EKKafkaTopicConfig contains some defaults that are only used if not provided by the channel spec

type EKKubernetesConfig

type EKKubernetesConfig struct {
	CpuLimit      resource.Quantity `json:"cpuLimit,omitempty"`
	CpuRequest    resource.Quantity `json:"cpuRequest,omitempty"`
	MemoryLimit   resource.Quantity `json:"memoryLimit,omitempty"`
	MemoryRequest resource.Quantity `json:"memoryRequest,omitempty"`
	Replicas      int               `json:"replicas,omitempty"`
}

EKKubernetesConfig and these EK sub-structs contain our custom configuration settings, stored in the config-kafka configmap. The sub-structs are explicitly declared so that they can have their own JSON tags in the overall EventingKafkaConfig

type EKReceiverConfig

type EKReceiverConfig struct {
	EKKubernetesConfig
}

EKReceiverConfig has the base Kubernetes fields (Cpu, Memory, Replicas) only

type EKSaramaConfig added in v0.24.0

type EKSaramaConfig struct {
	EnableLogging bool           `json:"enableLogging,omitempty"`
	Config        *sarama.Config `json:"-"` // Sarama config string is converted to sarama.Config struct, stored here
}

EKSaramaConfig holds the sarama.Config struct (populated separately), and the global Sarama debug logging flag

type EKSourceConfig added in v0.24.0

type EKSourceConfig struct {
}

EKSourceConfig is reserved for configuration fields needed by the Kafka Source component

type EventingKafkaConfig

type EventingKafkaConfig struct {
	Channel     EKChannelConfig         `json:"channel,omitempty"`
	CloudEvents EKCloudEventConfig      `json:"cloudevents,omitempty"`
	Kafka       EKKafkaConfig           `json:"kafka,omitempty"`
	Sarama      EKSaramaConfig          `json:"sarama,omitempty"`
	Source      EKSourceConfig          `json:"source,omitempty"`
	Auth        *client.KafkaAuthConfig `json:"-"` // Not directly part of the configmap; loaded from the secret
}

EventingKafkaConfig is the main struct that holds the Receiver, Dispatcher, and Kafka sub-items

type LoggingObserver

type LoggingObserver func(ctx context.Context, configMap *corev1.ConfigMap)

This function type is for a shim so that we can pass our own logger to the Observer function

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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