Documentation ¶
Index ¶
- Constants
- Variables
- func GetCertificate(ctx context.Context, id *auth.MeshAuth, ca *hbone.Cluster) error
- func HandleCDS(hb *hbone.HBone, eds map[string]*xds.Cluster)
- func HandleEDS(hb *hbone.HBone, eds map[string]*xds.ClusterLoadAssignment)
- func SendMsg(s *h2.H2Stream, args interface{}) error
- func SetupControlPlane(ctx context.Context, hb *hbone.HBone, c *hbone.Cluster) error
- type ADSC
- type Config
- type Endpoint
- type TCPListener
- type Target
- type UGRPC
- type Watch
Constants ¶
View Source
const ( EndpointType = apiTypePrefix + "envoy.config.endpoint.v3.ClusterLoadAssignment" ClusterType = apiTypePrefix + "envoy.config.cluster.v3.Cluster" RouteType = apiTypePrefix + "envoy.config.route.v3.RouteConfiguration" ScopedRouteType = apiTypePrefix + "envoy.config.route.v3.ScopedRouteConfiguration" 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 ( ReasonAck = "ack" ReasonRequest = "request" ReasonInit = "init" )
Variables ¶
View Source
var Debug = false
View Source
var ErrTimeout = errors.New("timeout")
ErrTimeout is returned by Wait if no update is received in the given time.
Functions ¶
func GetCertificate ¶
getCertificate is using Istio CA gRPC protocol to get a certificate for the id. Google implementation of the protocol is also supported.
Types ¶
type ADSC ¶
type ADSC struct { // InitialLoad tracks the time to receive the initial configuration. InitialLoad time.Duration // HTTPListeners contains received listeners with a http_connection_manager filter. HTTPListeners map[string]*xds.Listener // TCPListeners contains all listeners of type TCP (not-HTTP) TCPListeners map[string]*xds.Listener // All received Clusters of no-eds type, keyed by name Clusters map[string]*xds.Cluster // All received Routes, keyed by route name Routes map[string]*xds.RouteConfiguration // All received endpoints, keyed by cluster name Endpoints map[string]*xds.ClusterLoadAssignment // Metadata has the node metadata to send to pilot. // If nil, the defaults will be used. Metadata map[string]interface{} Config *Config // Updates includes the type of the last update received from the server, or "close". // Short names for eds/cds/lds/rds, as well as init, error-xxxx, long names for other types. Updates chan string XDSUpdates chan *xds.DiscoveryResponse VersionInfo map[string]string // Last received message, by type Received map[string]*xds.DiscoveryResponse // LocalCacheDir is set to a base name used to save fetched resources. // If set, each update will be saved. // TODO: also load at startup - so we can support warm up in init-container, and survive // restarts. LocalCacheDir string // RecvWg is for letting goroutines know when the goroutine handling the ADS stream finishes. RecvWg sync.WaitGroup // contains filtered or unexported fields }
ADSC implements a basic client for ADS, for use in stress tests and tools or libraries that need to connect to Istio pilot or other ADS servers.
func DialContext ¶
Dial connects to a ADS server, with optional MTLS authentication if a cert dir is specified.
type Config ¶
type Config struct { // Namespace defaults to 'default' Namespace string // Workload defaults to 'test' Workload string // Revision for this control plane instance. We will only read configs that match this revision. Revision string // Meta includes additional metadata for the node Meta map[string]interface{} Locality *xds.Locality XDSHeaders map[string]string // NodeType defaults to sidecar. "ingress" and "router" are also supported. NodeType 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 NodeId string // InitialDiscoveryRequests is a list of resources to watch at first, represented as URLs (for new XDS resource naming) // or type URLs. InitialDiscoveryRequests []*xds.DiscoveryRequest // ResponseHandler will be called on each DiscoveryResponse. // TODO: mirror Generator, allow adding handler per type ResponseHandler func(con *ADSC, response *xds.DiscoveryResponse) HBone *hbone.HBone Cluster *hbone.Cluster }
Config for the ADS connection.
type TCPListener ¶
type TCPListener struct { // Address is the address, as expected by go Dial and Listen, including port Address string // LogFile is the access log address for the listener LogFile string // Target is the destination cluster. Target string }
TCPListener extracts the core elements from envoy Listener.
Click to show internal directories.
Click to hide internal directories.