Documentation

Index

Constants

View Source
const (
	DeploymentLabelKey   string = "app"
	DeploymentLabelValue string = "nginx"
	PodLabelKey          string = "app"
	PodLabelValue        string = "testPod"
)

Variables

This section is empty.

Functions

func ClusterWithEdsV2

func ClusterWithEdsV2(clusterName string) (string, *envoy_api_v2.Cluster)

func ClusterWithEdsV3

func ClusterWithEdsV3(clusterName string) (string, *envoy_config_cluster_v3.Cluster)

func ClusterWithStrictDNSV2

func ClusterWithStrictDNSV2(clusterName, host string, port uint32) (string, *envoy_api_v2.Cluster)

func ClusterWithStrictDNSV3

func ClusterWithStrictDNSV3(clusterName, host string, port uint32) (string, *envoy_config_cluster_v3.Cluster)

func DirectResponseRouteV2

func DirectResponseRouteV2(routeName, msg string) (string, *envoy_api_v2.RouteConfiguration)

func DirectResponseRouteV3

func DirectResponseRouteV3(routeName, msg string) (string, *envoy_config_route_v3.RouteConfiguration)

func EndpointV2

func EndpointV2(clusterName, host string, port uint32) (string, *envoy_api_v2.ClusterLoadAssignment)

func EndpointV3

func EndpointV3(clusterName, host string, port uint32) (string, *envoy_config_endpoint_v3.ClusterLoadAssignment)

func GenerateDeployment

func GenerateDeployment(key types.NamespacedName) *appsv1.Deployment

func GenerateDeploymentWithInjection

func GenerateDeploymentWithInjection(key types.NamespacedName, nodeID, envoyAPI, envoyVersion string, envoyPort uint32) *appsv1.Deployment

func GenerateEnvoyConfig

func GenerateEnvoyConfig(key types.NamespacedName, nodeID string, envoyAPI envoy.APIVersion,
	endpointsGenFn, clustersGenFn, routesGenFn, listenersGenFn func() map[string]envoy.Resource, secrets map[string]string) *marin3rv1alpha1.EnvoyConfig

func GenerateHeadlessService

func GenerateHeadlessService(key types.NamespacedName) *corev1.Service

func GenerateTLSSecret

func GenerateTLSSecret(k8skey types.NamespacedName, commonName, duration string) (*corev1.Secret, error)

func GetAddressV2

func GetAddressV2(host string, port uint32) *envoy_api_v2_core.Address

func GetAddressV3

func GetAddressV3(host string, port uint32) *envoy_config_core_v3.Address

func GetPodCondition

func GetPodCondition(conditions []corev1.PodCondition, conditionType corev1.PodConditionType) *corev1.PodCondition

func HTTPListenerWithRdsV2

func HTTPListenerWithRdsV2(listenerName, routeName string, address, transportSocket proto.Message) (string, *envoy_api_v2.Listener)

func HTTPListenerWithRdsV3

func HTTPListenerWithRdsV3(listenerName, routeName string, address, transportSocket proto.Message) (string, *envoy_config_listener_v3.Listener)

func NewTestPortForwarder

func NewTestPortForwarder(cfg *rest.Config, pod corev1.Pod, localPort, podPort uint32,
	out io.Writer, stopCh chan struct{}, readyCh chan struct{}) (*portforward.PortForwarder, error)

func ProxyPassRouteV2

func ProxyPassRouteV2(routeName, clusterName string) (string, *envoy_api_v2.RouteConfiguration)

func ProxyPassRouteV3

func ProxyPassRouteV3(routeName, clusterName string) (string, *envoy_config_route_v3.RouteConfiguration)

func ReadyReplicas

func ReadyReplicas(k8sClient client.Client, namespace string, matchingLabels client.MatchingLabels) int

func TransportSocketV2

func TransportSocketV2(secretName string) *envoy_api_v2_core.TransportSocket

func TransportSocketV3

func TransportSocketV3(secretName string) *envoy_config_core_v3.TransportSocket

Types

type TestPod

type TestPod struct {
	Pod            *corev1.Pod
	EnvoyBootstrap *marin3rv1alpha1.EnvoyBootstrap
}

func GeneratePodWithBootstrap

func GeneratePodWithBootstrap(key types.NamespacedName, nodeID, envoyAPI, envoyVersion, discoveryService string) TestPod