config

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: May 22, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var KongDefaults = map[string]string{
	"KONG_ADMIN_ACCESS_LOG":       "/dev/stdout",
	"KONG_ADMIN_ERROR_LOG":        "/dev/stderr",
	"KONG_ADMIN_GUI_ACCESS_LOG":   "/dev/stdout",
	"KONG_ADMIN_GUI_ERROR_LOG":    "/dev/stderr",
	"KONG_CLUSTER_LISTEN":         "off",
	"KONG_DATABASE":               "off",
	"KONG_NGINX_WORKER_PROCESSES": "2",

	"KONG_PORTAL_API_ACCESS_LOG": "/dev/stdout",
	"KONG_PORTAL_API_ERROR_LOG":  "/dev/stderr",
	"KONG_PORT_MAPS":             "80:8000, 443:8443",
	"KONG_PROXY_ACCESS_LOG":      "/dev/stdout",
	"KONG_PROXY_ERROR_LOG":       "/dev/stderr",
	"KONG_PROXY_LISTEN":          fmt.Sprintf("0.0.0.0:%d reuseport backlog=16384, 0.0.0.0:%d http2 ssl reuseport backlog=16384", consts.DataPlaneProxyPort, consts.DataPlaneProxySSLPort),
	"KONG_STATUS_LISTEN":         fmt.Sprintf("0.0.0.0:%d", consts.DataPlaneStatusPort),

	"KONG_ADMIN_LISTEN": fmt.Sprintf("0.0.0.0:%d ssl reuseport backlog=16384", consts.DataPlaneAdminAPIPort),

	"KONG_ADMIN_SSL_CERT":                     "/var/cluster-certificate/tls.crt",
	"KONG_ADMIN_SSL_CERT_KEY":                 "/var/cluster-certificate/tls.key",
	"KONG_NGINX_ADMIN_SSL_CLIENT_CERTIFICATE": "/var/cluster-certificate/ca.crt",
	"KONG_NGINX_ADMIN_SSL_VERIFY_CLIENT":      "on",
	"KONG_NGINX_ADMIN_SSL_VERIFY_DEPTH":       "3",
	// contains filtered or unexported fields
}

KongDefaults are the baseline Kong proxy configuration options needed for the proxy to function.

Functions

func ConfigureKongPluginRelatedEnvVars

func ConfigureKongPluginRelatedEnvVars(kongPluginNames []string) []corev1.EnvVar

ConfigureKongPluginRelatedEnvVars returns the environment variables needed for configuring the Kong Gateway with the provided Kong Plugin names. If kongPluginNames is nil or empty, nil is returned. Kong will use bundled plugins by default if we do not override `KONG_PLUGINS`.

func EnvVarMapToSlice

func EnvVarMapToSlice(envMap map[string]string) []corev1.EnvVar

EnvVarMapToSlice converts a map[string]string to a slice of environment variables. Note: this function should be used only when the env var slice is made of simple key-value pairs. in case of more complex env vars, don't rely on maps.

func FillContainerEnvs

func FillContainerEnvs(existing []corev1.EnvVar, podTemplateSpec *corev1.PodTemplateSpec, containerName string, envSet []corev1.EnvVar)

FillContainerEnvMap updates the environment variables in the provided PodTemplateSpec's container by taking a slice of env vars as an input.

func KICInKonnectDefaults

func KICInKonnectDefaults(konnectExtensionStatus konnectv1alpha1.KonnectExtensionStatus) ([]corev1.EnvVar, error)

KongInKonnectDefaults returns the slice of Konnect-related env vars properly configured.

func KongInKonnectDefaults

func KongInKonnectDefaults(
	dpLabels map[string]konnectv1alpha1.DataPlaneLabelValue,
	konnectExtensionStatus konnectv1alpha1.KonnectExtensionStatus,
) map[string]string

KongInKonnectDefaults returns the map of Konnect-related env vars properly configured.

Types

This section is empty.

Jump to

Keyboard shortcuts

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