Documentation
¶
Index ¶
- func ConfigureKongPluginRelatedEnvVars(kongPluginNames []string) []corev1.EnvVar
- func DisableAdminAPI(env map[string]string)
- func EnvVarMapToSlice(envMap map[string]string) []corev1.EnvVar
- func FillContainerEnvs(existing []corev1.EnvVar, podTemplateSpec *corev1.PodTemplateSpec, ...)
- func KongDefaults(family ipfamily.IPFamily) (map[string]string, error)
- func KongInKonnectDefaults(dpLabels map[string]konnectv1alpha2.DataPlaneLabelValue, ...) (map[string]string, error)
- func ListenValue(family ipfamily.IPFamily, port int, options ...string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigureKongPluginRelatedEnvVars ¶
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 DisableAdminAPI ¶ added in v2.4.0
DisableAdminAPI turns off the Kong Admin API listener and drops the related admin TLS/mTLS settings from the given env map. It mutates env in place, so callers must not pass a shared map.
func EnvVarMapToSlice ¶
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 KongDefaults ¶
KongDefaults returns the baseline Kong proxy configuration options needed for the proxy to function, with its listen addresses rendered for the given IP family. It returns an error for ipfamily.Auto and any unrecognized family (see ListenValue).
func KongInKonnectDefaults ¶
func KongInKonnectDefaults( dpLabels map[string]konnectv1alpha2.DataPlaneLabelValue, konnectExtensionStatus konnectv1alpha2.KonnectExtensionStatus, ) (map[string]string, error)
KongInKonnectDefaults returns the map of Konnect-related env vars properly configured. It returns an error when a value the selected template renders cannot be used.
func ListenValue ¶ added in v2.4.0
ListenValue renders a Kong listen value for the given port, bound to the wildcard address(es) of the given IP family.
It returns an error for ipfamily.Auto and any unrecognized family: the IP family must be resolved to a concrete value (see ipfamily.Resolve) before listen values are rendered, because silently assuming a concrete family (e.g. IPv4) would render DataPlanes' Kong listens unreachable on clusters of a different family.
Types ¶
This section is empty.