manager

package
v1.34.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type VoltronRouteConfig

type VoltronRouteConfig struct {
	// contains filtered or unexported fields
}

VoltronRouteConfig contains everything needed to configure the voltron pod / container with routes via a mounted file. It contains the volumes and volume mounts needed to mount the config map with the routes, as well as the CA, certs, keys.

It provides functions for getting an annotation based of the mounted config maps / secrets to detect changes, as well as the env variables needed to configure the file paths to tell voltron where to look for the routes.

func (*VoltronRouteConfig) Annotations

func (cfg *VoltronRouteConfig) Annotations() map[string]string

func (*VoltronRouteConfig) EnvVars

func (cfg *VoltronRouteConfig) EnvVars() []corev1.EnvVar

EnvVars returns a list of env vars that contain the paths to the route files that routes Config Map is mounted to.

func (*VoltronRouteConfig) RoutesConfigMap

func (cfg *VoltronRouteConfig) RoutesConfigMap(namespace string) *corev1.ConfigMap

RoutesConfigMap returns the config map the contains the routes that voltron is to be configured with. This has been parsed from the TLSTerminatedRoute and the TLSPassThroughRoute CRs.

The namespace parameter is used to assign the namespace that the ConfigMap should be created in.

func (*VoltronRouteConfig) VolumeMounts

func (cfg *VoltronRouteConfig) VolumeMounts() []corev1.VolumeMount

VolumeMounts returns the volume mounts that Voltron needs to be configured with (references to ConfigMaps and Secrets in the TLSTerminatedRoute CRs).

func (*VoltronRouteConfig) Volumes

func (cfg *VoltronRouteConfig) Volumes() []corev1.Volume

Volumes returns the volumes that Voltron needs to be configured with (references to ConfigMaps and Secrets in the TLSTerminatedRoute CRs).

type VoltronRouteConfigBuilder

type VoltronRouteConfigBuilder interface {
	// AddTLSTerminatedRoute adds TLSTerminatedRoutes to the config builder. When Build is called, the route is parsed
	// and validated and the route is added to the ConfigMap mounted to voltron to configure the tls terminated routes.
	//
	// If CAs or MTLS certs / keys are referenced in the spec the Config Maps and Secrets containing
	// those values must be added through AddConfigMap or AddSecret. This is so we can track when these values change.
	AddTLSTerminatedRoute(routes operatorv1.TLSTerminatedRoute)

	// AddTLSPassThroughRoute adds AddTLSPassThroughRoutes to the config builder. When Build is called, the route is parsed
	// and validated and the route is added to the ConfigMap mounted to voltron to configure the tls pass through routes.
	AddTLSPassThroughRoute(routes operatorv1.TLSPassThroughRoute)

	// AddConfigMap accepts a Config Map referenced by a TLS terminated route. This is used to detect changes to ConfigMaps
	// that will be mounted by the VoltronRouteConfig so Voltron can be restarted if the value changes.
	AddConfigMap(configMap *corev1.ConfigMap)

	// AddSecret accepts a Secret referenced by a TLS terminated route. This is used to detect changes to Secrets
	// that will be mounted by the VoltronRouteConfig so Voltron can be restarted if the value changes.
	AddSecret(secret *corev1.Secret)
	Build() (*VoltronRouteConfig, error)
}

VoltronRouteConfigBuilder is an interface that provides methods to build a VoltronRouteConfig. Implementations of this interface should provide methods to add different types of routes, such as TLSTerminatedRoute and TLSPassThroughRoute, as well as methods to add ConfigMaps and Secrets to the route configuration to generate annotations that change when the contents of objects change (used to restart Voltron). The Build method should be used to create the final VoltronRouteConfig object.

func NewVoltronRouteConfigBuilder

func NewVoltronRouteConfigBuilder() VoltronRouteConfigBuilder

Jump to

Keyboard shortcuts

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