dataplane

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: Apache-2.0 Imports: 57 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// ControllerName is the name used for logging and event recording.
	ControllerName = "keg-dataplane"

	// DefaultKafkaPort is the default port exposed by the Kafka listener.
	DefaultKafkaPort int32 = 9092

	// DefaultHealthPort is the default port used for the keg health endpoint.
	DefaultHealthPort int32 = 8080

	// KonnectCertVolumeName is the name of the volume that holds the Konnect mTLS certificate.
	KonnectCertVolumeName = shareddataplane.KonnectCertVolumeName

	// KonnectCertMountPath is the path where the Konnect certificate Secret is mounted in the keg container.
	KonnectCertMountPath = shareddataplane.KonnectCertMountPath
)
View Source
const (
	// EnvKonnectRegion is the keg environment variable for the Konnect region.
	EnvKonnectRegion = "KONG_KONNECT_REGION"
	// EnvKonnectGatewayClusterID is the keg environment variable for the Konnect gateway cluster ID.
	EnvKonnectGatewayClusterID = "KONG_KONNECT_GATEWAY_CLUSTER_ID"
	// EnvKonnectClientCertPath is the keg environment variable for the Konnect mTLS client certificate path.
	EnvKonnectClientCertPath = "KONG_KONNECT_CLIENT_CERT_PATH"
	// EnvKonnectClientKeyPath is the keg environment variable for the Konnect mTLS client key path.
	EnvKonnectClientKeyPath = "KONG_KONNECT_CLIENT_KEY_PATH"
	// EnvKonnectDomain is the keg environment variable for the Konnect domain override.
	EnvKonnectDomain = "KONG_KONNECT_DOMAIN"
	// EnvKonnectAPIRequestTimeout is the keg environment variable for the Konnect API request timeout.
	EnvKonnectAPIRequestTimeout = "KONG_KONNECT_API_REQUEST_TIMEOUT"
	// EnvKonnectInsecureSkipVerify is the keg environment variable to skip TLS verification.
	// For testing only.
	EnvKonnectInsecureSkipVerify = "KONG_KONNECT_INSECURE_SKIP_VERIFY"

	// EnvSSLCertFile is the file of the certificate authorities keg trusts
	// for every TLS connection. The keg image sets it to its system trust
	// store (see onPremEnvVars).
	EnvSSLCertFile = "SSL_CERT_FILE"

	// EnvSSLCertDir is a directory of certificate authorities keg trusts for
	// every TLS connection, in addition to those of EnvSSLCertFile, e.g. the
	// cp server CA bundle of the GWAdmin of an OnPremEventGateway (see
	// onPremEnvVars).
	EnvSSLCertDir = "SSL_CERT_DIR"

	// SystemTrustStorePath is the system trust store of the keg image, the
	// value it sets EnvSSLCertFile to.
	SystemTrustStorePath = "/etc/ssl/certs/ca-certificates.crt"

	// EnvConfigPollInterval is the keg environment variable for the config poll interval.
	EnvConfigPollInterval = "KEG__CONFIG_POLL_INTERVAL"
	// EnvEnableDebugEndpoints is the keg environment variable to enable debug endpoints.
	EnvEnableDebugEndpoints = "KEG__ENABLE_DEBUG_ENDPOINTS"

	// EnvObsLogFlags is the keg environment variable for log level flags.
	EnvObsLogFlags = "KEG__OBSERVABILITY__LOG_FLAGS"
	// EnvObsLogFormat is the keg environment variable for the log output format.
	EnvObsLogFormat = "KEG__OBSERVABILITY__LOG_FORMAT"
	// EnvObsMetricsRollupAllowMap is the keg environment variable for the metrics rollup allow map.
	EnvObsMetricsRollupAllowMap = "KEG__OBSERVABILITY__METRICS_ROLLUP_ALLOW_MAP"
	// EnvObsPolicyErrorsInfoLogInterval is the keg environment variable for the policy errors info log interval.
	EnvObsPolicyErrorsInfoLogInterval = "KEG__OBSERVABILITY__POLICY_ERRORS_INFO_LOG_INTERVAL"

	// EnvRuntimeHealthAddr is the keg environment variable for the health listener address and port.
	EnvRuntimeHealthAddr = "KEG__RUNTIME__HEALTH_LISTENER_ADDRESS_PORT"
	// EnvRuntimeDrainDuration is the keg environment variable for the drain duration.
	EnvRuntimeDrainDuration = "KEG__RUNTIME__DRAIN_DURATION"
	// EnvRuntimeShutdownTimeout is the keg environment variable for the graceful shutdown timeout.
	EnvRuntimeShutdownTimeout = "KEG__RUNTIME__SHUTDOWN_TIMEOUT"
)
View Source
const (
	// DefaultDrainDurationSeconds is the drain duration keg defaults to: how
	// long it keeps serving its connections once asked to stop.
	DefaultDrainDurationSeconds = 5
	// DefaultShutdownTimeoutSeconds is the graceful shutdown timeout keg
	// defaults to: the time between the shutdown signal and keg forcing its
	// exit. The termination grace period adds it to the drain, which is
	// longer than needed if the drain counts toward it, never shorter.
	DefaultShutdownTimeoutSeconds = 10
	// DefaultTerminationGracePeriodSeconds is the termination grace period of
	// a pod Kubernetes defaults to.
	DefaultTerminationGracePeriodSeconds = 30
	// TerminationGracePeriodMarginSeconds is the time added to the drain and
	// the shutdown of keg in the termination grace period of its pods, for
	// the signal to be delivered and the process to exit.
	TerminationGracePeriodMarginSeconds = 5
)

The graceful shutdown of keg, which its pods need the time for.

Variables

This section is empty.

Functions

func OnPremAvailable added in v2.4.0

func OnPremAvailable(crdExists func(schema.GroupVersionResource) (bool, error)) (bool, error)

OnPremAvailable reports whether the cluster serves every resource the OnPremEventGateway control plane kind needs.

func OnPremGroupVersionResources added in v2.4.0

func OnPremGroupVersionResources() []schema.GroupVersionResource

OnPremGroupVersionResources returns the resources the OnPremEventGateway control plane kind needs: the gateways, the GWAdmins serving them, and the KongReferenceGrants allowing a gateway to use a GWAdmin in another namespace. Unlike those of the Konnect kind, they are optional: without them, the kind is disabled.

Types

type Reconciler

type Reconciler struct {
	client.Client

	// LoggingMode controls the format of log output.
	LoggingMode logging.Mode

	ClusterCASecretName      string
	ClusterCASecretNamespace string
	SecretLabelSelector      string
	CertTTL                  time.Duration

	// OperatorNamespace is the namespace the GWAdmin controller publishes the
	// cp client CA of a GWAdmin in, which the client certificates of the data
	// planes of an OnPremEventGateway are issued from.
	OperatorNamespace string
	// GWAdminCertTTL is the validity of the certificates the GWAdmin controller
	// issues, which caps the one of those client certificates.
	GWAdminCertTTL time.Duration

	// TypeConverter is injected via the TypeConverterProvider at controller
	// registration time.  It is used for both diff-before-apply and
	// structured-merge-diff based PodTemplateSpec merging.
	TypeConverter managedfields.TypeConverter

	// OnPremUnavailable disables the OnPremEventGateway control plane kind:
	// the manager sets it when the cluster doesn't serve every resource of
	// OnPremGroupVersionResources at startup, and registers the indexes of
	// the kind otherwise, so the watches and the indexes always agree.
	OnPremUnavailable bool
	// contains filtered or unexported fields
}

Reconciler reconciles a KegDataPlane object.

func (*Reconciler) SetupWithManager

func (r *Reconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager. The OnPremEventGateway control plane kind is only enabled when the cluster serves its resources: an operator managing Konnect data planes only doesn't need them.

Jump to

Keyboard shortcuts

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