config

package
v0.41.8 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EKChannelConfig added in v0.36.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 added in v0.36.0

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 added in v0.36.0

type EKDispatcherConfig struct {
	EKKubernetesConfig
}

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

type EKKafkaConfig added in v0.36.0

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

EKKafkaConfig contains items relevant to Kafka specifically

type EKKubernetesConfig added in v0.36.0

type EKKubernetesConfig struct {
	DeploymentAnnotations map[string]string `json:"deploymentAnnotations,omitempty"`
	DeploymentLabels      map[string]string `json:"deploymentLabels,omitempty"`
	PodAnnotations        map[string]string `json:"podAnnotations,omitempty"`
	PodLabels             map[string]string `json:"podLabels,omitempty"`
	ServiceAnnotations    map[string]string `json:"serviceAnnotations,omitempty"`
	ServiceLabels         map[string]string `json:"serviceLabels,omitempty"`
	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. The user is responsible for providing valid values depending on use case (e.g. respecting Kubernetes label naming conventions) or the reconciliation of the respective resource will fail.

type EKReceiverConfig added in v0.36.0

type EKReceiverConfig struct {
	EKKubernetesConfig
}

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

type EKSaramaConfig added in v0.36.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.36.0

type EKSourceConfig struct {
}

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

type Env

type Env struct {
	// DataPlaneConfigMapNamespace is the namespace of the configmap that holds the contract between the control plane
	// and the data plane. Might be ignored in some cases such as the configmap is expected to be in the resource
	// namespace
	DataPlaneConfigMapNamespace string `required:"true" split_words:"true"`

	// ContractConfigMapName is the name of the configmap that holds the contract between the control plane
	// and the data plane.
	ContractConfigMapName string `required:"true" split_words:"true"` // example: kafka-broker-brokers-triggers

	// DataPlaneConfigConfigMapName is the name of the configmap that holds the data plane configurations.
	DataPlaneConfigConfigMapName string `required:"true" split_words:"true"` // example: config-kafka-broker-data-plane

	// GeneralConfigMapName is the name of the configmap that holds configuration that affects the control plane
	// and the data plane. For example, Kafka bootstrap server information could be in here for broker configuration.
	GeneralConfigMapName string `required:"true" split_words:"true"` // example: kafka-broker-config

	IngressName             string `required:"true" split_words:"true"` // example: kafka-broker-ingress
	IngressPodPort          string `required:"false" split_words:"true"`
	IngressPodTlsPort       string `required:"false" split_words:"true"`
	SystemNamespace         string `required:"true" split_words:"true"`
	ContractConfigMapFormat string `required:"true" split_words:"true"`
	DefaultBackoffDelayMs   uint64 `required:"false" split_words:"true"`
}

func GetEnvConfig

func GetEnvConfig(prefix string, validations ...ValidationOption) (*Env, error)

func (*Env) DataPlaneConfigMapAsString

func (c *Env) DataPlaneConfigMapAsString() string

type EventingKafkaConfig added in v0.36.0

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"`
}

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

type ValidationOption added in v0.19.0

type ValidationOption func(env Env) error

ValidationOption represents a function to validate the Env configurations.

Jump to

Keyboard shortcuts

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