istio: istio.io/istio/pkg/adsc Index | Files

package adsc

import "istio.io/istio/pkg/adsc"

Index

Package Files

adsc.go

Constants

const (

    // ListenerType is sent after clusters and endpoints.
    ListenerType = typePrefix + "Listener"
)

type ADSC Uses

type ADSC struct {

    // InitialLoad tracks the time to receive the initial configuration.
    InitialLoad time.Duration

    // Metadata has the node metadata to send to pilot.
    // If nil, the defaults will be used.
    Metadata *pstruct.Struct

    // Updates includes the type of the last update received from the server.
    Updates     chan string
    XDSUpdates  chan *xdsapi.DiscoveryResponse
    VersionInfo map[string]string

    // Last received message, by type
    Received map[string]*xdsapi.DiscoveryResponse

    Mesh *v1alpha1.MeshConfig

    // Retrieved configurations can be stored using the common istio model interface.
    Store model.IstioConfigStore

    // Retrieved endpoints can be stored in the memory registry. This is used for CDS and EDS responses.
    Registry *v2.MemServiceDiscovery

    // 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
    // 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 Dial Uses

func Dial(url string, certDir string, opts *Config) (*ADSC, error)

Dial connects to a ADS server, with optional MTLS authentication if a cert dir is specified.

func (*ADSC) Close Uses

func (a *ADSC) Close()

Close the stream.

func (*ADSC) EndpointsJSON Uses

func (a *ADSC) EndpointsJSON() string

EndpointsJSON returns the endpoints, formatted as JSON, for debugging.

func (*ADSC) GetClusters Uses

func (a *ADSC) GetClusters() map[string]*cluster.Cluster

GetClusters returns all the non-eds type clusters.

func (*ADSC) GetEdsClusters Uses

func (a *ADSC) GetEdsClusters() map[string]*cluster.Cluster

GetEdsClusters returns all the eds type clusters.

func (*ADSC) GetEndpoints Uses

func (a *ADSC) GetEndpoints() map[string]*endpoint.ClusterLoadAssignment

GetEndpoints returns all the routes.

func (*ADSC) GetHTTPListeners Uses

func (a *ADSC) GetHTTPListeners() map[string]*listener.Listener

GetHTTPListeners returns all the http listeners.

func (*ADSC) GetRoutes Uses

func (a *ADSC) GetRoutes() map[string]*route.RouteConfiguration

GetRoutes returns all the routes.

func (*ADSC) GetTCPListeners Uses

func (a *ADSC) GetTCPListeners() map[string]*listener.Listener

GetTCPListeners returns all the tcp listeners.

func (*ADSC) Run Uses

func (a *ADSC) Run() error

Run will run one connection to the ADS client.

func (*ADSC) Save Uses

func (a *ADSC) Save(base string) error

Save will save the json configs to files, using the base directory

func (*ADSC) Send Uses

func (a *ADSC) Send(req *xdsapi.DiscoveryRequest) error

Raw send of a request.

func (*ADSC) Wait Uses

func (a *ADSC) Wait(to time.Duration, updates ...string) ([]string, error)

Wait for an updates for all the specified types If updates is empty, this will wait for any update

func (*ADSC) WaitClear Uses

func (a *ADSC) WaitClear()

WaitClear will clear the waiting events, so next call to Wait will get the next push type.

func (*ADSC) WaitVersion Uses

func (a *ADSC) WaitVersion(to time.Duration, typeURL, lastVersion string) (*xdsapi.DiscoveryResponse, error)

WaitVersion waits for a new or updated for a typeURL.

func (*ADSC) Watch Uses

func (a *ADSC) Watch()

Watch will start watching resources, starting with LDS. Based on the LDS response it will start watching RDS and CDS.

func (*ADSC) WatchConfig Uses

func (a *ADSC) WatchConfig()

WatchConfig will use the new experimental API watching, similar with MCP.

type Config Uses

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

    // Workload defaults to 'test'
    Workload string

    // Meta includes additional metadata for the node
    Meta *pstruct.Struct

    // 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

    // CertDir is the directory where mTLS certs are configured.
    // If empty, an insecure connection will be used.
    // TODO: also allow passing in-memory certs.
    CertDir string

    // Watch is a list of resources to watch, represented as URLs (for new XDS resource naming)
    // or type URLs.
    Watch []string

    // InitialReconnectDelay is the time to wait before attempting to reconnect.
    // If empty reconnect will not be attempted.
    // TODO: client will use exponential backoff to reconnect.
    InitialReconnectDelay time.Duration
}

Config for the ADS connection.

Package adsc imports 32 packages (graph). Updated 2020-06-04. Refresh now. Tools for package owners.