pilotv2

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NodeInfo

type NodeInfo struct {
	PodName    string
	Namespace  string
	InstanceIP string
}

NodeInfo stores the info of the node, which will be used to make a XDS call

type XdsClient

type XdsClient struct {
	PilotAddr string
	TlsConfig *tls.Config
	ReqCaches map[XdsType]*XdsReqCache

	NodeID      string
	NodeCluster string
	// contains filtered or unexported fields
}

XdsClient provides the XDS API calls.

func NewXdsClient

func NewXdsClient(pilotAddr string, tlsConfig *tls.Config, nodeInfo *NodeInfo, kubeconfigPath string) (*XdsClient, error)

NewXdsClient returns the new XDS client.

func (*XdsClient) CDS

func (client *XdsClient) CDS() ([]apiv2.Cluster, error)

CDS s the Clsuter Discovery Service API, which fetches all the clusters from istio pilot

func (*XdsClient) EDS

func (client *XdsClient) EDS(clusterName string) (*apiv2.ClusterLoadAssignment, error)

EDS is the Endpoint Discovery Service API, the API takes the cluster's name and return all its endpoints(which provide address and port)

func (*XdsClient) GetEndpointsByTags

func (client *XdsClient) GetEndpointsByTags(serviceName string, tags map[string]string) ([]apiv2endpoint.LbEndpoint, string, error)

GetEndpointsByTags fetches the cluster's endpoints with tags. The tags is usually specified in a DestinationRule.

func (*XdsClient) GetSubsetTags

func (client *XdsClient) GetSubsetTags(namespace, hostName, subsetName string) (map[string]string, error)

GetSubsetTags returns the tags of the specified subset.

func (*XdsClient) LDS

func (client *XdsClient) LDS() ([]apiv2.Listener, error)

LDS is the Listener Discovery Service API, which returns all the listerns

func (*XdsClient) RDS

func (client *XdsClient) RDS(clusterName string) ([]apiv2route.VirtualHost, error)

RDS is the Router Discovery Service API, it returns the virtual hosts which contains Routes

type XdsClusterInfo

type XdsClusterInfo struct {
	ClusterName  string
	Direction    string
	Port         string
	Subset       string
	HostName     string
	ServiceName  string
	Namespace    string
	DomainSuffix string // DomainSuffix might not be used
	Tags         map[string]string
	Addrs        []string // The accessible addresses of the endpoints
}

XdsClusterInfo stores all the infos from a cluster name, which is in the format direction|port|subset|hostName

func ParseClusterName

func ParseClusterName(clusterName string) *XdsClusterInfo

ParseClusterName parse the cluster's name, which is in the format direction|port|subset|hostName, the 4 items will be parsed into different fields. The hostName item will also be parsed into ServcieName, Namespace etc.

type XdsReqCache

type XdsReqCache struct {
	Nonce       string
	VersionInfo string
}

XdsReqCache stores the VersionInfo and Nonce for the XDS calls

type XdsType

type XdsType string

XdsType is the wrapper of string, the wrapper type should be "cds", "eds", "lds" or "rds"

const (
	TypeCds XdsType = "cds"
	TypeEds XdsType = "eds"
	TypeLds XdsType = "lds"
	TypeRds XdsType = "rds"
)

Jump to

Keyboard shortcuts

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