appmesh

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Type                                   = "AppMesh"
	ErrVirtualServiceNotUsingVirtualRouter = "Virtual-service is not associated with virtual-router"
	ErrVirtualServiceMissing               = "Virtual-service is missing"
	ErrVirtualRouterMissing                = "Virtual-router is missing"
	ErrVirtualNodeMissing                  = "Virtual-node is missing"
	ErrNotWellFormed                       = "not well-formed"
)

Variables

This section is empty.

Functions

func GetRouteRule

func GetRouteRule(route map[string]interface{}) (map[string]interface{}, string, error)

Types

type Reconciler

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

Reconciler holds required fields to reconcile AppMesh resources

func NewReconciler

func NewReconciler(cfg ReconcilerConfig) *Reconciler

NewReconciler returns a trafficrouting reconciler to work with services using App Mesh custom resources such as virtual-services, virtual-routers and virtual-nodes to perform traffic-splitting functionality. This reconciler only works with appmesh.k8s.aws/v1beta2 custom resources. This reconciler uses dynamic client to avoid hard dependency on App Mesh controller.

func (*Reconciler) RemoveManagedRoutes added in v1.3.0

func (r *Reconciler) RemoveManagedRoutes() error

func (*Reconciler) SetHeaderRoute added in v1.3.0

func (r *Reconciler) SetHeaderRoute(headerRouting *v1alpha1.SetHeaderRoute) error

func (*Reconciler) SetMirrorRoute added in v1.3.0

func (r *Reconciler) SetMirrorRoute(setMirrorRoute *v1alpha1.SetMirrorRoute) error

func (*Reconciler) SetWeight

func (r *Reconciler) SetWeight(desiredWeight int32, additionalDestinations ...v1alpha1.WeightDestination) error

SetWeight sets the canary weight to the desired weight. SetWeight relates to a step in rollout process where traffic-routing shifts weight to/from stable and canary (traffic-splitting) based on the configuration. In the context of App Mesh, traffic-splitting is performed by adding a virtual-router with route(s) for virtual-service. This route includes a match condition and an action. Action is defined as weighted-targets where each target is a virtual-node. SetWeight adjusts the weights on this route.

func (*Reconciler) Type

func (r *Reconciler) Type() string

Type returns the type of the traffic routing reconciler

func (*Reconciler) UpdateHash

func (r *Reconciler) UpdateHash(canaryHash, stableHash string, additionalDestinations ...v1alpha1.WeightDestination) error

UpdateHash informs a traffic routing reconciler about new canary/stable pod hashes. UpdateHash initializes virtual-nodes with appropriate match-labels in pod-selector. It will mutate the pod-selector in two ways. Firstly it will update a label with name v1alpha1.DefaultRolloutUniqueLabelKey if one exists. Secondly it will add a new label with name v1alpha1.DefaultRolloutUniqueLabelKey if one does not exist.

func (*Reconciler) VerifyWeight

func (r *Reconciler) VerifyWeight(desiredWeight int32, additionalDestinations ...v1alpha1.WeightDestination) (*bool, error)

VerifyWeight returns true if the canary is at the desired weight and additonalDestinations are at the weights specified Returns nil if weight verification is not supported or not applicable

type ReconcilerConfig

type ReconcilerConfig struct {
	Rollout  *v1alpha1.Rollout
	Client   dynamic.Interface
	Recorder record.EventRecorder
}

ReconcilerConfig describes static configuration data for the AppMesh reconciler

type ResourceClient

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

func NewResourceClient

func NewResourceClient(client dynamic.Interface) *ResourceClient

func (*ResourceClient) GetVirtualNodeCR

func (rc *ResourceClient) GetVirtualNodeCR(ctx context.Context, namespace string, name string) (*unstructured.Unstructured, error)

func (*ResourceClient) GetVirtualRouterCR

func (rc *ResourceClient) GetVirtualRouterCR(ctx context.Context, namespace string, name string) (*unstructured.Unstructured, error)

func (*ResourceClient) GetVirtualRouterCRForVirtualService

func (rc *ResourceClient) GetVirtualRouterCRForVirtualService(ctx context.Context, uVsvc *unstructured.Unstructured) (*unstructured.Unstructured, error)

func (*ResourceClient) GetVirtualServiceCR

func (rc *ResourceClient) GetVirtualServiceCR(ctx context.Context, namespace string, name string) (*unstructured.Unstructured, error)

func (*ResourceClient) UpdateVirtualNodeCR

func (rc *ResourceClient) UpdateVirtualNodeCR(ctx context.Context, obj *unstructured.Unstructured) (*unstructured.Unstructured, error)

func (*ResourceClient) UpdateVirtualRouterCR

func (rc *ResourceClient) UpdateVirtualRouterCR(ctx context.Context, obj *unstructured.Unstructured) (*unstructured.Unstructured, error)

Jump to

Keyboard shortcuts

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