uxds

package
v0.0.0-...-c645305 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	EndpointType        = apiTypePrefix + "envoy.config.endpoint.v3.ClusterLoadAssignment"
	ClusterType         = apiTypePrefix + "envoy.config.cluster.v3.Dest"
	RouteType           = apiTypePrefix + "envoy.config.route.v3.RouteConfiguration"
	ScopedRouteType     = apiTypePrefix + "envoy.config.route.v3.ScopedRouteConfiguration"
	VirtualHostType     = apiTypePrefix + "envoy.config.route.v3.VirtualHost"
	ListenerType        = apiTypePrefix + "envoy.config.listener.v3.Listener"
	SecretType          = apiTypePrefix + "envoy.extensions.transport_sockets.tls.v3.Secret"
	ExtensionConfigType = apiTypePrefix + "envoy.config.core.v3.TypedExtensionConfig"
	RuntimeType         = apiTypePrefix + "envoy.service.runtime.v3.Runtime"

	// AnyType is used only by ADS
	AnyType = ""
)

Resource types in xDS v3.

View Source
const RBAC_TYPE = "type.googleapis.com/istio.workload.Authorization"
View Source
const WORKLOAD_TYPE = "type.googleapis.com/istio.workload.Workload"

Required node info in ambient:

  • INSTANCE_IPS ( env var is INSTANCE_IP )

  • POD_NAME

  • NAMESPACE - from POD_NAMESPACE

  • NODE_NAME

  • AMBIENT_TYPE

    Id: sidecar~{ip}~{pod_name}.{ns}~{ns}.svc.cluster.local

Variables

View Source
var (
	XDSTopics map[string]Topic = map[string]Topic{
		"ptr": &XDSTopic[*xds.Workload]{
			TypeURL: WORKLOAD_TYPE,
			T:       &xds.Workload{},
		},
		"cluster": &XDSTopic[*xds.Cluster]{
			TypeURL: ClusterType,
			T:       &xds.Cluster{},
		},
	}
)

Functions

func GetCertIstio

func GetCertIstio(ctx context.Context, dest *meshauth.Dest, ttlSec int, certSigner string) ([]byte, []string, error)

GetCertIstio implements the basic Istio gRPC protocol The 'dest' may be configured with

  • TokenSource reading the istio-ca mounted token
  • K8S token source returning "istio-ca" certs (using cluster, kubeconfig or other user creds)
  • An existing certificate
  • A long-lived certificate

func TransportFunc

func TransportFunc(d *meshauth.Dest) http.RoundTripper

Types

type LRS

type LRS struct {
}

func NewLRS

func NewLRS() *LRS

type StreamService

type StreamService[I any, O any] interface {
	Receive() (*O, error)
	Send(*I) error
}

type Topic

type Topic interface {
	Proto() proto.Message
	GetTypeURL() string
}

type XDS

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

func NewXDS

func NewXDS(cfg *XDSConfig) *XDS

func (*XDS) RunDelta

func (x *XDS) RunDelta(initial string) error

func (*XDS) RunFull

func (x *XDS) RunFull(initial string) error

type XDSConfig

type XDSConfig struct {
	// Namespace defaults to 'default'
	Namespace string

	// Workload defaults to 'test'
	Workload string

	XDSHeaders map[string]string

	// IP is currently the primary key used to locate inbound configs. It is sent by client,
	// must match a known endpoint IP. Tests can use a ServiceEntry to register fake IPs.
	IP string

	// Context used for early cancellation
	Context context.Context

	// Base URL of the XDS server, including scheme
	XDS string
}

type XDSResource

type XDSResource[T any] struct {
	Value   T
	Name    string
	TypeURL string
}

type XDSTopic

type XDSTopic[T proto.Message] struct {
	TypeURL       string
	T             T
	ResourceNames map[string]string
	Resourcces    map[string]T
}

func (*XDSTopic[T]) GetTypeURL

func (x *XDSTopic[T]) GetTypeURL() string

func (*XDSTopic[T]) Proto

func (x *XDSTopic[T]) Proto() proto.Message

Jump to

Keyboard shortcuts

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