spec

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RegistryTypeConsul is the consul registry type.
	RegistryTypeConsul = "consul"
	// RegistryTypeEureka is the eureka registry type.
	RegistryTypeEureka = "eureka"
	// RegistryTypeNacos is the eureka registry type.
	RegistryTypeNacos = "nacos"

	// GlobalTenant is the reserved name of the system scope tenant,
	// its services can be accessible in mesh wide.
	GlobalTenant = "global"

	// ServiceStatusUp indicates this service instance can accept ingress traffic
	ServiceStatusUp = "UP"

	// ServiceStatusOutOfService indicates this service instance can't accept ingress traffic
	ServiceStatusOutOfService = "OUT_OF_SERVICE"

	// WorkerAPIPort is the default port for worker's API server
	WorkerAPIPort = 13009

	// IngressPort is the default port for ingress controller
	IngressPort = 13010

	// HeartbeatInterval is the default heartbeat interval for checking service heartbeat
	HeartbeatInterval = "5s"

	// SecurityLevelPermissive is the level for not enabling mTLS.
	SecurityLevelPermissive = "permissive"

	// SecurityLevelStrict is the level for enabling mTLS.
	SecurityLevelStrict = "strict"

	// DefaultCommonName is the name of root ca cert.
	DefaultCommonName = "mesh-root-ca"

	// CertProviderSelfSign is the in-memory, self-sign cert provider.
	CertProviderSelfSign = "selfSign"

	// IngressControllerName is the name of easemesh ingress controller.
	IngressControllerName = "ingresscontroller"

	// PodEnvHostname is the name of the pod in environment variable.
	PodEnvHostname = "HOSTNAME"

	// PodEnvApplicationIP is the IP of the pod in environment variable.
	PodEnvApplicationIP = "APPLICATION_IP"

	// ServiceCanaryHeaderKey is the http header key of service canary.
	ServiceCanaryHeaderKey = "X-Mesh-Service-Canary"
)

Variables

View Source
var (
	// ErrParamNotMatch means RESTful request URL's object name or other fields are not matched in this request's body
	ErrParamNotMatch = fmt.Errorf("param in url and body's spec not matched")
	// ErrAlreadyRegistered indicates this instance has already been registered
	ErrAlreadyRegistered = fmt.Errorf("service already registered")
	// ErrNoRegisteredYet indicates this instance haven't registered successfully yet
	ErrNoRegisteredYet = fmt.Errorf("service not registered yet")
	// ErrServiceNotFound indicates could find target service in its tenant or in global tenant
	ErrServiceNotFound = fmt.Errorf("can't find service in its tenant or in global tenant")
	// ErrServiceNotavailable indicates could find target service's available instances.
	ErrServiceNotavailable = fmt.Errorf("can't find service available instances")
)
View Source
var NoopServiceSelector = &ServiceSelector{}

NoopServiceSelector selects none of services or instances.

Functions

func IngressHTTPServerSpec

func IngressHTTPServerSpec(port int, rules []*IngressRule) (*supervisor.Spec, error)

IngressHTTPServerSpec generates HTTP server spec for ingress. as ingress does not belong to a service, it is not a method of 'Service'

Types

type Admin

type Admin struct {
	// HeartbeatInterval is the interval for one service instance reporting its heartbeat.
	HeartbeatInterval string `yaml:"heartbeatInterval" jsonschema:"required,format=duration"`
	// RegistryTime indicates which protocol the registry center accepts.
	RegistryType string `yaml:"registryType" jsonschema:"required"`

	// APIPort is the port for worker's API server
	APIPort int `yaml:"apiPort" jsonschema:"required"`

	// IngressPort is the port for http server in mesh ingress
	IngressPort int `yaml:"ingressPort" jsonschema:"required"`

	ExternalServiceRegistry string `yaml:"externalServiceRegistry" jsonschema:"omitempty"`

	CleanExternalRegistry bool `yaml:"cleanExternalRegistry"`

	Security *Security `yaml:"security" jsonschema:"omitempty"`

	// Sidecar injection relevant config.
	ImageRegistryURL          string `yaml:"imageRegistryURL" jsonschema:"omitempty"`
	ImagePullPolicy           string `yaml:"imagePullPolicy" jsonschema:"omitempty"`
	SidecarImageName          string `yaml:"sidecarImageName" jsonschema:"omitempty"`
	AgentInitializerImageName string `yaml:"agentInitializerImageName" jsonschema:"omitempty"`
	Log4jConfigName           string `yaml:"log4jConfigName" jsonschema:"omitempty"`

	MonitorMTLS *MonitorMTLS `yaml:"monitorMTLS" jsonschema:"omitempty"`
	WorkerSpec  *WorkerSpec  `yaml:"workerSpec" jsonschema:"omitempty"`
}

Admin is the spec of MeshController.

func (Admin) EnablemTLS added in v1.3.1

func (a Admin) EnablemTLS() bool

EnablemTLS indicates whether we should enable mTLS in mesh or not.

func (Admin) Validate

func (a Admin) Validate() error

Validate validates Spec.

type Canary

type Canary struct {
	CanaryRules []*CanaryRule `yaml:"canaryRules" jsonschema:"omitempty"`
}

Canary is the spec of service canary. Deprecated: replaced by ServiceCanary.

type CanaryRule

type CanaryRule struct {
	ServiceInstanceLabels map[string]string               `yaml:"serviceInstanceLabels" jsonschema:"required"`
	Headers               map[string]*urlrule.StringMatch `yaml:"headers" jsonschema:"required"`
	URLs                  []*urlrule.URLRule              `yaml:"urls" jsonschema:"required"`
}

CanaryRule is one matching rule for canary.

type Certificate added in v1.3.1

type Certificate struct {
	IP          string `yaml:"ip" jsonschema:"required"`
	ServiceName string `yaml:"servieName" jsonschema:"required"`
	CertBase64  string `yaml:"certBase64" jsonschema:"required"`
	KeyBase64   string `yaml:"keyBase64" jsonschema:"required"`
	TTL         string `yaml:"ttl" jsonschema:"required,format=duration"`
	SignTime    string `yaml:"signTime" jsonschema:"required,format=timerfc3339"`
	HOST        string `yaml:"host" jsonschema:"required"`
}

Certificate is one cert for mesh service instance or root CA.

type CustomResource added in v1.3.0

type CustomResource = customdata.Data

CustomResource defines the spec of a custom resource

type CustomResourceKind added in v1.3.0

type CustomResourceKind = customdata.Kind

CustomResourceKind defines the spec of a custom resource kind

type EgressServerSpec added in v1.5.3

type EgressServerSpec struct {
	KeepAlive        bool   `yaml:"keepAlive" jsonschema:"omitempty"`
	KeepAliveTimeout string `yaml:"keepAliveTimeout" jsonschema:"omitempty,format=duration"`
}

EgressServerSpec is the spec of egress httpserver in worker

type GlobalCanaryHeaders

type GlobalCanaryHeaders struct {
	ServiceHeaders map[string][]string `yaml:"serviceHeaders" jsonschema:"omitempty"`
}

GlobalCanaryHeaders is the spec of global service

type GlobalTransmission added in v1.4.1

type GlobalTransmission struct {
	// Headers are the canary headers, all endpoints of mesh should transmit them.
	Headers []string `yaml:"headers" jsonschema:"omitempty"`

	MomitorMTLS *MTLSTransmission `yaml:"monitorMTLS"`
}

GlobalTransmission is the spec of global transmission data for Agent.

type HTTPMatch added in v1.3.2

type HTTPMatch struct {
	// Name is the name of the match for referencing in a TrafficTarget
	Name string `json:"name,omitempty"`

	// Methods for inbound traffic as defined in RFC 7231
	// https://tools.ietf.org/html/rfc7231#section-4
	Methods []string `json:"methods,omitempty"`

	// PathRegex is a regular expression defining the route
	PathRegex string `json:"pathRegex,omitempty"`
}

HTTPMatch defines an individual route for HTTP traffic

type HTTPRouteGroup added in v1.3.2

type HTTPRouteGroup struct {
	// Name is the name for referencing a HTTPRouteGroup
	Name string `yaml:"name" jsonschema:"required"`

	// Matches is a list of HTTPMatch to match traffic
	Matches []HTTPMatch `json:"matches,omitempty"`
}

HTTPRouteGroup defines the spec of a HTTP route group

type IdentityBindingSubject added in v1.3.2

type IdentityBindingSubject struct {
	// Kind is the type of Subject to allow ingress (Service)
	Kind string `json:"kind"`

	// Name of the Subject, i.e. ServiceName
	Name string `json:"name"`
}

IdentityBindingSubject is a service which should be allowed access to the TrafficTarget

type Ingress

type Ingress struct {
	Name  string         `yaml:"name" jsonschema:"required"`
	Rules []*IngressRule `yaml:"rules" jsonschema:"required"`
}

Ingress is the spec of mesh ingress

type IngressPath

type IngressPath struct {
	Path          string `yaml:"path" jsonschema:"required"`
	RewriteTarget string `yaml:"rewriteTarget" jsonschema:"omitempty"`
	Backend       string `yaml:"backend" jsonschema:"required"`
}

IngressPath is the path for a mesh ingress rule

type IngressRule

type IngressRule struct {
	Host  string         `yaml:"host" jsonschema:"omitempty"`
	Paths []*IngressPath `yaml:"paths" jsonschema:"required"`
}

IngressRule is the rule for mesh ingress

type IngressServerSpec added in v1.5.3

type IngressServerSpec struct {
	KeepAlive        bool   `yaml:"keepAlive" jsonschema:"omitempty"`
	KeepAliveTimeout string `yaml:"keepAliveTimeout" jsonschema:"omitempty,format=duration"`
}

IngressServerSpec is the spec of ingress httpserver in worker

type LoadBalance

type LoadBalance = proxy.LoadBalance

LoadBalance is the spec of service load balance.

type MTLSTransmission added in v1.5.1

type MTLSTransmission struct {
	CaCertBase64 string `yaml:"caCertBase64" jsonschema:"required,format=base64"`
	CertBase64   string `yaml:"certBase64" jsonschema:"required,format=base64"`
	KeyBase64    string `yaml:"keyBase64" jsonschema:"required,format=base64"`
}

MTLSTransmission is the mTLS config for Agent.

type Mock added in v1.3.0

type Mock struct {
	// Enable is the mocking switch for this service.
	Enabled bool `yaml:"enabled" jsonschema:"required"`

	// Rules are the mocking matching and responding configurations.
	Rules []*mock.Rule `yaml:"rules" jsonschema:"omitempty"`
}

Mock is the spec of configured and static API responses for this service.

type MonitorCert added in v1.5.1

type MonitorCert struct {
	CertBase64 string   `yaml:"certBase64" jsonschema:"required,format=base64"`
	KeyBase64  string   `yaml:"keyBase64" jsonschema:"required,format=base64"`
	Services   []string `yaml:"services" jsonschema:"required"`
}

MonitorCert is the spec for single pack of mTLS.

type MonitorMTLS added in v1.5.1

type MonitorMTLS struct {
	Enabled  bool   `yaml:"enabled" jsonschema:"required"`
	URL      string `yaml:"url" jsonschema:"required"`
	Username string `yaml:"username" jsonschema:"required"`
	Password string `yaml:"password" jsonschema:"required"`

	ReporterAppendType string         `yaml:"reporterAppendType"`
	CaCertBase64       string         `yaml:"caCertBase64" jsonschema:"required,format=base64"`
	Certs              []*MonitorCert `yaml:"certs" jsonschema:"required"`
}

MonitorMTLS is the spec of mTLS specification of monitor.

type Observability

type Observability struct {
	OutputServer *ObservabilityOutputServer `yaml:"outputServer" jsonschema:"omitempty"`
	Tracings     *ObservabilityTracings     `yaml:"tracings" jsonschema:"omitempty"`
	Metrics      *ObservabilityMetrics      `yaml:"metrics" jsonschema:"omitempty"`
}

Observability is the spec of service observability.

type ObservabilityMetrics

type ObservabilityMetrics struct {
	Enabled        bool                       `yaml:"enabled" jsonschema:"required"`
	Access         ObservabilityMetricsDetail `yaml:"access" jsonschema:"required"`
	Request        ObservabilityMetricsDetail `yaml:"request" jsonschema:"required"`
	JdbcStatement  ObservabilityMetricsDetail `yaml:"jdbcStatement" jsonschema:"required"`
	JdbcConnection ObservabilityMetricsDetail `yaml:"jdbcConnection" jsonschema:"required"`
	Rabbit         ObservabilityMetricsDetail `yaml:"rabbit" jsonschema:"required"`
	Kafka          ObservabilityMetricsDetail `yaml:"kafka" jsonschema:"required"`
	Redis          ObservabilityMetricsDetail `yaml:"redis" jsonschema:"required"`
	JvmGC          ObservabilityMetricsDetail `yaml:"jvmGc" jsonschema:"required"`
	JvmMemory      ObservabilityMetricsDetail `yaml:"jvmMemory" jsonschema:"required"`
	Md5Dictionary  ObservabilityMetricsDetail `yaml:"md5Dictionary" jsonschema:"required"`
}

ObservabilityMetrics is the metrics of observability.

type ObservabilityMetricsDetail

type ObservabilityMetricsDetail struct {
	Enabled  bool   `yaml:"enabled" jsonschema:"required"`
	Interval int    `yaml:"interval" jsonschema:"required"`
	Topic    string `yaml:"topic" jsonschema:"required"`
}

ObservabilityMetricsDetail is the metrics detail of observability.

type ObservabilityOutputServer

type ObservabilityOutputServer struct {
	Enabled         bool   `yaml:"enabled" jsonschema:"required"`
	BootstrapServer string `yaml:"bootstrapServer" jsonschema:"required"`
	Timeout         int    `yaml:"timeout" jsonschema:"required"`
}

ObservabilityOutputServer is the output server of observability.

type ObservabilityTracings

type ObservabilityTracings struct {
	Enabled     bool                              `yaml:"enabled" jsonschema:"required"`
	SampleByQPS int                               `yaml:"sampleByQPS" jsonschema:"required"`
	Output      ObservabilityTracingsOutputConfig `yaml:"output" jsonschema:"required"`

	Request      ObservabilityTracingsDetail `yaml:"request" jsonschema:"required"`
	RemoteInvoke ObservabilityTracingsDetail `yaml:"remoteInvoke" jsonschema:"required"`
	Kafka        ObservabilityTracingsDetail `yaml:"kafka" jsonschema:"required"`
	Jdbc         ObservabilityTracingsDetail `yaml:"jdbc" jsonschema:"required"`
	Redis        ObservabilityTracingsDetail `yaml:"redis" jsonschema:"required"`
	Rabbit       ObservabilityTracingsDetail `yaml:"rabbit" jsonschema:"required"`
}

ObservabilityTracings is the tracings of observability.

type ObservabilityTracingsDetail

type ObservabilityTracingsDetail struct {
	Enabled       bool   `yaml:"enabled" jsonschema:"required"`
	ServicePrefix string `yaml:"servicePrefix" jsonschema:"required"`
}

ObservabilityTracingsDetail is the tracing detail of observability.

type ObservabilityTracingsOutputConfig

type ObservabilityTracingsOutputConfig struct {
	Enabled         bool   `yaml:"enabled" jsonschema:"required"`
	ReportThread    int    `yaml:"reportThread" jsonschema:"required"`
	Topic           string `yaml:"topic" jsonschema:"required"`
	MessageMaxBytes int    `yaml:"messageMaxBytes" jsonschema:"required"`
	QueuedMaxSpans  int    `yaml:"queuedMaxSpans" jsonschema:"required"`
	QueuedMaxSize   int    `yaml:"queuedMaxSize" jsonschema:"required"`
	MessageTimeout  int    `yaml:"messageTimeout" jsonschema:"required"`
}

ObservabilityTracingsOutputConfig is the tracing output configuration

type Resilience

type Resilience struct {
	RateLimiter    *ratelimiter.Spec    `yaml:"rateLimiter" jsonschema:"omitempty"`
	CircuitBreaker *circuitbreaker.Spec `yaml:"circuitBreaker" jsonschema:"omitempty"`
	Retryer        *retryer.Spec        `yaml:"retryer" jsonschema:"omitempty"`
	TimeLimiter    *timelimiter.Spec    `yaml:"timeLimiter" jsonschema:"omitempty"`
}

Resilience is the spec of service resilience.

type Security added in v1.3.1

type Security struct {
	MTLSMode     string `yaml:"mtlsMode" jsonschema:"required"`
	CertProvider string `yaml:"certProvider" jsonschema:"required"`

	RootCertTTL string `yaml:"rootCertTTL" jsonschema:"required,format=duration"`
	AppCertTTL  string `yaml:"appCertTTL" jsonschema:"required,format=duration"`
}

Security is the spec for mesh-wide security.

type Service

type Service struct {
	// Empty means mesh registry itself.
	RegistryName   string `yaml:"registryName" jsonschema:"omitempty"`
	Name           string `yaml:"name" jsonschema:"required"`
	RegisterTenant string `yaml:"registerTenant" jsonschema:"required"`

	Sidecar       *Sidecar       `yaml:"sidecar" jsonschema:"required"`
	Mock          *Mock          `yaml:"mock" jsonschema:"omitempty"`
	Resilience    *Resilience    `yaml:"resilience" jsonschema:"omitempty"`
	Canary        *Canary        `yaml:"canary" jsonschema:"omitempty"`
	LoadBalance   *LoadBalance   `yaml:"loadBalance" jsonschema:"omitempty"`
	Observability *Observability `yaml:"observability" jsonschema:"omitempty"`
}

Service contains the information of service.

func (*Service) ApplicationEndpoint

func (s *Service) ApplicationEndpoint(port uint32) string

ApplicationEndpoint returns application endpoint URL string

func (*Service) BackendName added in v1.1.0

func (s *Service) BackendName() string

BackendName returns backend service name

func (*Service) EgressEndpoint

func (s *Service) EgressEndpoint() string

EgressEndpoint returns Egress endpoint URL string

func (*Service) EgressHTTPServerName

func (s *Service) EgressHTTPServerName() string

EgressHTTPServerName returns egress HTTP server name

func (*Service) EgressHandlerName

func (s *Service) EgressHandlerName() string

EgressHandlerName returns egress handler name.

func (*Service) EgressPipelineName

func (s *Service) EgressPipelineName() string

EgressPipelineName returns egress pipeline name

func (*Service) IngressControllerPipelineName added in v1.4.1

func (s *Service) IngressControllerPipelineName() string

IngressControllerPipelineName returns the ingress pipeline name

func (*Service) IngressControllerPipelineSpec added in v1.4.0

func (s *Service) IngressControllerPipelineSpec(instanceSpecs []*ServiceInstanceSpec,
	canaries []*ServiceCanary, cert, rootCert *Certificate) (*supervisor.Spec, error)

IngressControllerPipelineSpec generates a spec for ingress controller pipeline spec.

func (*Service) IngressEndpoint

func (s *Service) IngressEndpoint() string

IngressEndpoint returns Ingress endpoint URL string

func (*Service) IngressHTTPServerName

func (s *Service) IngressHTTPServerName() string

IngressHTTPServerName returns the ingress server name

func (*Service) IngressHandlerName

func (s *Service) IngressHandlerName() string

IngressHandlerName returns the ingress handler name

func (*Service) SidecarEgressHTTPServerSpec added in v1.4.0

func (s *Service) SidecarEgressHTTPServerSpec(keepalive bool, timeout string) (*supervisor.Spec, error)

SidecarEgressHTTPServerSpec returns a spec for egress HTTP server

func (*Service) SidecarEgressPipelineSpec added in v1.4.0

func (s *Service) SidecarEgressPipelineSpec(instanceSpecs []*ServiceInstanceSpec,
	canaries []*ServiceCanary, appCert, rootCert *Certificate) (*supervisor.Spec, error)

SidecarEgressPipelineSpec returns a spec for sidecar egress pipeline

func (*Service) SidecarIngressHTTPServerSpec added in v1.4.0

func (s *Service) SidecarIngressHTTPServerSpec(keepalive bool, timeout string, cert, rootCert *Certificate) (*supervisor.Spec, error)

SidecarIngressHTTPServerSpec generates a spec for sidecar ingress HTTP server

func (*Service) SidecarIngressPipelineName added in v1.4.1

func (s *Service) SidecarIngressPipelineName() string

SidecarIngressPipelineName returns the ingress pipeline name

func (*Service) SidecarIngressPipelineSpec added in v1.4.0

func (s *Service) SidecarIngressPipelineSpec(applicationPort uint32) (*supervisor.Spec, error)

SidecarIngressPipelineSpec returns a spec for sidecar ingress pipeline

func (*Service) UniqueCanaryHeaders

func (s *Service) UniqueCanaryHeaders() []string

UniqueCanaryHeaders returns the unique headers in canary filter rules.

type ServiceCanary added in v1.4.0

type ServiceCanary struct {
	Name string `yaml:"name" jsonschema:"required"`
	// Priority must be [1, 9], the default is 5 if user does not set it.
	// The smaller number get higher priority.
	// The order is sorted by name alphabetically in the same priority.
	Priority     int              `yaml:"priority" jsonschema:"omitempty"`
	Selector     *ServiceSelector `yaml:"selector" jsonschema:"required"`
	TrafficRules *TrafficRules    `yaml:"trafficRules" jsonschema:"required"`
}

ServiceCanary is the service canary entry.

func (ServiceCanary) Validate added in v1.4.0

func (sc ServiceCanary) Validate() error

Validate validates ServiceCanary.

type ServiceInstanceSpec

type ServiceInstanceSpec struct {
	RegistryName string `yaml:"registryName" jsonschema:"required"`
	// Provide by registry client
	ServiceName  string            `yaml:"serviceName" jsonschema:"required"`
	InstanceID   string            `yaml:"instanceID" jsonschema:"required"`
	IP           string            `yaml:"ip" jsonschema:"required"`
	Port         uint32            `yaml:"port" jsonschema:"required"`
	RegistryTime string            `yaml:"registryTime" jsonschema:"omitempty"`
	Labels       map[string]string `yaml:"labels" jsonschema:"omitempty"`

	// Set by heartbeat timer event or API
	Status string `yaml:"status" jsonschema:"omitempty"`
}

ServiceInstanceSpec is the spec of service instance. FIXME: Use the unified struct: serviceregistry.ServiceInstanceSpec.

func (*ServiceInstanceSpec) Key added in v1.3.0

func (s *ServiceInstanceSpec) Key() string

Key returns the key of ServiceInstanceSpec.

type ServiceInstanceStatus

type ServiceInstanceStatus struct {
	ServiceName string `yaml:"serviceName" jsonschema:"required"`
	InstanceID  string `yaml:"instanceID" jsonschema:"required"`
	// RFC3339 format
	LastHeartbeatTime string `yaml:"lastHeartbeatTime" jsonschema:"required,format=timerfc3339"`
}

ServiceInstanceStatus is the status of service instance.

type ServiceSelector added in v1.4.0

type ServiceSelector struct {
	MatchServices       []string          `yaml:"matchServices" jsonschema:"required,uniqueItems=true"`
	MatchInstanceLabels map[string]string `yaml:"matchInstanceLabels" jsonschema:"required"`
}

ServiceSelector is to select service instances according to service names and labels.

func (*ServiceSelector) MatchInstance added in v1.4.0

func (s *ServiceSelector) MatchInstance(serviceName string, instancelabels map[string]string) bool

MatchInstance returns whether selecting the service instance by service name and instance labels.

func (*ServiceSelector) MatchService added in v1.4.0

func (s *ServiceSelector) MatchService(serviceName string) bool

MatchService returns whether selecting the given service.

type Sidecar

type Sidecar struct {
	DiscoveryType   string `yaml:"discoveryType" jsonschema:"required"`
	Address         string `yaml:"address" jsonschema:"required"`
	IngressPort     int    `yaml:"ingressPort" jsonschema:"required"`
	IngressProtocol string `yaml:"ingressProtocol" jsonschema:"required"`
	EgressPort      int    `yaml:"egressPort" jsonschema:"required"`
	EgressProtocol  string `yaml:"egressProtocol" jsonschema:"required"`
}

Sidecar is the spec of service sidecar.

type Tenant

type Tenant struct {
	Name string `yaml:"name"`

	Services []string `yaml:"services" jsonschema:"omitempty"`
	// Format: RFC3339
	CreatedAt   string `yaml:"createdAt" jsonschema:"omitempty"`
	Description string `yaml:"description"`
}

Tenant contains the information of tenant.

type TrafficRules added in v1.4.0

type TrafficRules struct {
	Headers map[string]*urlrule.StringMatch `yaml:"headers" jsonschema:"required"`
}

TrafficRules is the rules of traffic.

func (*TrafficRules) Clone added in v1.4.0

func (tr *TrafficRules) Clone() *TrafficRules

Clone clones TrafficRules.

type TrafficTarget added in v1.3.2

type TrafficTarget struct {
	// Name is the name for referencing a TrafficTarget
	Name string `yaml:"name" jsonschema:"required"`

	// Destination is the service to allow ingress traffic
	Destination IdentityBindingSubject `json:"destination"`

	// Sources are the services to allow egress traffic
	Sources []IdentityBindingSubject `json:"sources,omitempty"`

	// Rules are the traffic rules to allow (HTTPRoutes)
	Rules []TrafficTargetRule `json:"rules,omitempty"`
}

TrafficTarget is the specification of a TrafficTarget

type TrafficTargetRule added in v1.3.2

type TrafficTargetRule struct {
	// Kind is the kind of TrafficSpec to allow
	Kind string `json:"kind"`

	// Name of the TrafficSpec to use
	Name string `json:"name"`

	// Matches is a list of TrafficSpec routes to allow traffic for
	// +optional
	Matches []string `json:"matches,omitempty"`
}

TrafficTargetRule is the TrafficSpec to allow for a TrafficTarget

type WorkerSpec added in v1.5.3

type WorkerSpec struct {
	Ingress IngressServerSpec `yaml:"ingress" jsonschema:"omitempty"`
	Egress  EgressServerSpec  `yaml:"egress" jsonschema:"omitempty"`
}

WorkerSpec is the spec of worker

Jump to

Keyboard shortcuts

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