fabric

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package fabric defines functions for generating templates for each service in a mesh.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fabric

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

Fabric contains a cue.Value that holds fabric object templates for a single mesh, defined by options passed into its factory function.

func New

func New(tmpl cue.Value, mesh *v1alpha1.Mesh) (*Fabric, error)

New returns a new *Fabric instance. It receives the meshconfigs template cue.Value and a Mesh custom resource to unify it with.

func (*Fabric) EdgeDomain

func (f *Fabric) EdgeDomain() json.RawMessage

EdgeDomain extracts the edge domain fabric object from a *Fabric's cue.Value. The edge domain is parsed individually since it is created as the root mesh domain.

func (*Fabric) Service

func (f *Fabric) Service(name string, workload runtime.Object) (Objects, error)

Service creates meshconfigs for adding a workload to a mesh.

type Objects

type Objects struct {
	Proxy    json.RawMessage   `json:"proxy"`
	Domain   json.RawMessage   `json:"domain"`
	Listener json.RawMessage   `json:"listener"`
	Clusters []json.RawMessage `json:"clusters"`
	Routes   []json.RawMessage `json:"routes"`
	// Ingresses are in the same pod as a sidecar, reached via 10808.
	// The key takes the form of '{sidecar-cluster-name}-{port}'.
	Ingresses *Objects `json:"ingresses"`
	// HTTP egresses are reached via the same listener on port 10909.
	// They can be local (in the same mesh) or external.
	HTTPEgresses *Objects `json:"httpEgresses"`
	// TCP egresses are served at 10910 and up (one listener each).
	// Note that 10910 and 10911 are reserved for internal use by Redis and NATS,
	// so any configured TCP egresses via annotations will start at 10912.
	TCPEgresses []Objects `json:"tcpEgresses"`
	// A list of keys for all local egress clusters routed to from this service.
	// Each egress's listener must be modified to reference this service's SVID in its subjects.
	LocalEgresses  []string        `json:"localEgresses"`
	CatalogService json.RawMessage `json:"catalogservice"`
}

Objects contains all fabric objects to apply for adding a workload to a mesh. It is a recursive type, enabling references from nested fabric objects to parent Objects. Objects should not be defined using Go structs, but parsed from Cue using *Fabric.Service.

Jump to

Keyboard shortcuts

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