deployment

package
v0.0.0-...-7929486 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExternalSvc      = "external"
	ExternalHostname = "fake.external.com"
)
View Source
const (
	ASvc             = "a"
	BSvc             = "b"
	CSvc             = "c"
	DSvc             = "d"
	ESvc             = "e"
	TproxySvc        = "tproxy"
	VMSvc            = "vm"
	HeadlessSvc      = "headless"
	StatefulSetSvc   = "statefulset"
	ProxylessGRPCSvc = "proxyless-grpc"
	NakedSvc         = "naked"
	SotwSvc          = "sotw"
	WaypointSvc      = "waypoint"
	CapturedSvc      = "captured"
)

Variables

This section is empty.

Functions

func DeployExternalServiceEntry

func DeployExternalServiceEntry(cfg config.Factory, deployedNamespace, externalNamespace namespace.Instance, manuallyAllocate bool) config.Plan

func Setup

func Setup(apps *Echos, cfg Config) resource.SetupFn

Setup function for writing to a global deployment variable.

func SetupSingleNamespace

func SetupSingleNamespace(view *SingleNamespaceView, cfg Config) resource.SetupFn

SetupSingleNamespace calls Setup and returns a SingleNamespaceView.

func SetupTwoNamespaces

func SetupTwoNamespaces(view *TwoNamespaceView, cfg Config) resource.SetupFn

SetupTwoNamespaces calls Setup and returns a TwoNamespaceView.

Types

type Config

type Config struct {
	// Echos is the target Echos for the newly created echo apps. If nil, a new Echos
	// instance will be created.
	Echos *Echos

	// NamespaceCount indicates the number of echo namespaces to be generated.
	// Ignored if Namespaces is non-empty. Defaults to 1.
	NamespaceCount int

	// Namespaces is the user-provided list of echo namespaces. If empty, NamespaceCount
	// namespaces will be generated.
	Namespaces []namespace.Getter

	// NoExternalNamespace if true, no external namespace will be generated and no external echo
	// instance will be deployed. Ignored if ExternalNamespace is non-nil.
	NoExternalNamespace bool

	// ExternalNamespace the namespace to use for the external deployment. If nil, a namespace
	// will be generated unless NoExternalNamespace is specified.
	ExternalNamespace namespace.Getter

	// IncludeExtAuthz if enabled, an additional ext-authz container will be included in the deployment.
	// This is mainly used to test the CUSTOM authorization policy when the ext-authz server is deployed
	// locally with the application container in the same pod.
	IncludeExtAuthz bool

	// Custom allows for configuring custom echo deployments. If a deployment's namespace
	// is nil, it will be created in all namespaces. Otherwise, it must match one of the
	// namespaces configured above.
	//
	// Custom echo instances will be accessible from the `All` field in the namespace(s) under which they
	// were created.
	Configs echo.ConfigGetter
}

Config for new echo deployment.

func (*Config) AddConfigs

func (c *Config) AddConfigs(configs []echo.Config) *Config

AddConfigs appends to the configs to be deployed

func (*Config) DefaultEchoConfigs

func (c *Config) DefaultEchoConfigs(t resource.Context) []echo.Config

type EchoNamespace

type EchoNamespace struct {
	// Namespace where the services are deployed.
	Namespace namespace.Instance

	// Standard echo app to be used by tests
	A echo.Instances
	// Standard echo app to be used by tests
	B echo.Instances
	// Standard echo app to be used by tests
	C echo.Instances
	// Dual-stack echo app to be used by tests if running in dual-stack mode
	D echo.Instances
	// IPv6 only echo app to be used by tests if running in dual-stack mode
	E echo.Instances
	// Standard echo app with TPROXY interception mode to be used by tests
	Tproxy echo.Instances
	// Headless echo app to be used by tests
	Headless echo.Instances
	// StatefulSet echo app to be used by tests
	StatefulSet echo.Instances
	// ProxylessGRPC echo app to be used by tests
	ProxylessGRPC echo.Instances
	// Echo app to be used by tests, with no sidecar injected
	Naked echo.Instances
	// A virtual machine echo app (only deployed to one cluster)
	VM echo.Instances
	// Sotw echo app uses the sotw XDS protocol. This should be functionally equivalent to A.
	Sotw echo.Instances
	// All echo apps in this namespace
	All echo.Services
}

EchoNamespace contains the echo instances for a single namespace.

type Echos

type Echos struct {
	// NS is the list of echo namespaces.
	NS []EchoNamespace

	// External (out-of-mesh) deployments
	External External

	// All echo instances.
	All echo.Services
}

Echos is a common set of echo deployments to support integration testing.

func New

func New(ctx resource.Context, cfg Config) (*Echos, error)

New echo deployment with the given configuration.

func NewOrFail

func NewOrFail(t resource.ContextFailer, cfg Config) *Echos

NewOrFail calls New and fails if an error is returned.

func (*Echos) Echos

func (e *Echos) Echos() *Echos

func (*Echos) SingleNamespaceView

func (e *Echos) SingleNamespaceView() SingleNamespaceView

SingleNamespaceView converts this Echos into a SingleNamespaceView.

func (*Echos) TwoNamespaceView

func (e *Echos) TwoNamespaceView() TwoNamespaceView

TwoNamespaceView converts this Echos into a TwoNamespaceView.

type External

type External struct {
	// Namespace where external echo app will be deployed
	Namespace namespace.Instance

	// All external echo instances with no sidecar injected
	All echo.Instances
}

func (External) Build

func (*External) LoadValues

func (e *External) LoadValues(echos echo.Instances)

type SingleNamespaceView

type SingleNamespaceView struct {
	// Include the echos at the top-level, so there is no need for accessing sub-structures.
	EchoNamespace

	// External (out-of-mesh) deployments
	External External

	// All echo instances
	All echo.Services
	// contains filtered or unexported fields
}

SingleNamespaceView is a simplified view of Echos for tests that only require a single namespace.

func (*SingleNamespaceView) Echos

func (v *SingleNamespaceView) Echos() *Echos

type TwoNamespaceView

type TwoNamespaceView struct {
	// Ns1 contains the echo deployments in the first namespace
	Ns1 EchoNamespace

	// Ns2 contains the echo deployments in the second namespace
	Ns2 EchoNamespace

	// Ns1AndNs2 contains just the echo services in Ns1 and Ns2 (excludes External).
	Ns1AndNs2 echo.Services

	// External (out-of-mesh) deployments
	External External

	// All echo instances
	All echo.Services
	// contains filtered or unexported fields
}

TwoNamespaceView is a simplified view of Echos for tests that require 2 namespaces.

func (*TwoNamespaceView) Echos

func (v *TwoNamespaceView) Echos() *Echos

type View

type View interface {
	// Echos returns the underlying Echos deployment for this view.
	Echos() *Echos
}

View of an Echos deployment.

Jump to

Keyboard shortcuts

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