Documentation ¶
Index ¶
- type Cluster
- type Clusters
- func (c Clusters) ByNetwork() ClustersByNetwork
- func (c Clusters) Configs(excluded ...Cluster) Clusters
- func (c Clusters) Contains(cc Cluster) bool
- func (c Clusters) Default() Cluster
- func (c Clusters) Exclude(excluded ...Cluster) Clusters
- func (c Clusters) ForNetworks(networks ...string) Clusters
- func (c Clusters) GetByName(name string) Cluster
- func (c Clusters) GetOrDefault(cluster Cluster) Cluster
- func (c Clusters) IsExternalControlPlane() bool
- func (c Clusters) IsMulticluster() bool
- func (c Clusters) Len() int
- func (c Clusters) MeshClusters(excluded ...Cluster) Clusters
- func (c Clusters) Names() []string
- func (c Clusters) Networks() []string
- func (c Clusters) Primaries(excluded ...Cluster) Clusters
- func (c Clusters) Remotes(excluded ...Cluster) Clusters
- func (c Clusters) String() string
- type ClustersByNetwork
- type Config
- type Map
- type Topology
- func (c Topology) Config() Cluster
- func (c Topology) ConfigName() string
- func (c Topology) HTTPProxy() string
- func (c Topology) IsConfig() bool
- func (c Topology) IsExternalControlPlane() bool
- func (c Topology) IsPrimary() bool
- func (c Topology) IsRemote() bool
- func (c Topology) MaxKubeVersion(minor uint) bool
- func (c Topology) MetadataValue(key string) string
- func (c Topology) MinKubeVersion(minor uint) bool
- func (c Topology) Name() string
- func (c Topology) NetworkName() string
- func (c Topology) Primary() Cluster
- func (c Topology) PrimaryName() string
- func (c Topology) ProxyKubectlOnly() bool
- func (c Topology) StableName() string
- func (c Topology) String() string
- func (c Topology) WithConfig(configClusterName string) Topology
- func (c Topology) WithPrimary(primaryClusterName string) Topology
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster interface { fmt.Stringer kube.CLIClient // Name of this cluster. Use for interacting with the cluster or validation against clusters. // Use StableName instead of Name when creating subtests. Name() string // StableName gives a deterministic name for the cluster. Use this for test/subtest names to // allow test grid to compare runs, even when the underlying cluster names are dynamic. // Use Name for validation/interaction with the actual cluster. StableName() string // NetworkName the cluster is on NetworkName() string // MinKubeVersion returns true if the cluster is at least the version specified, // false otherwise MinKubeVersion(minor uint) bool // MaxKubeVersion returns true if the cluster is at most the version specified, // false otherwise MaxKubeVersion(minor uint) bool // IsPrimary returns true if this is a primary cluster, containing an instance // of the Istio control plane. IsPrimary() bool // IsConfig returns true if this is a config cluster, used as the source of // Istio config for one or more control planes. IsConfig() bool // IsRemote returns true if this is a remote cluster, which uses a control plane // residing in another cluster. IsRemote() bool // IsExternalControlPlane returns true if this is a cluster containing an instance // of the Istio control plane but with its source of config in another cluster. IsExternalControlPlane() bool // Primary returns the primary cluster for this cluster. Will return itself if // IsPrimary. Primary() Cluster // PrimaryName returns the name of the primary cluster for this cluster. PrimaryName() string // Config returns the config cluster for this cluster. Will return itself if // IsConfig. Config() Cluster // ConfigName returns the name of the config cluster for this cluster. ConfigName() string // HTTPProxy returns the HTTP proxy config to connect to the cluster HTTPProxy() string // Metadata returns the value for a given metadata key for the cluster. // If the key is not found in the cluster metadata, an empty string is returned. MetadataValue(key string) string // ProxyKubectlOnly returns a boolean value to indicate whether all traffic // should route through the HTTP proxy or only Kubectl traffic. (Useful // in topologies where the API server is private but the ingress is public). ProxyKubectlOnly() bool }
Cluster in a multicluster environment.
type Clusters ¶
type Clusters []Cluster
Clusters is an ordered list of Cluster instances.
func (Clusters) ByNetwork ¶
func (c Clusters) ByNetwork() ClustersByNetwork
ByNetwork returns a map of network name to a subset of clusters
func (Clusters) Contains ¶
Contains returns true if a cluster with the given name is found in the list.
func (Clusters) ForNetworks ¶
ForNetworks returns the list of clusters in the given networks.
func (Clusters) GetByName ¶
GetByName returns the Cluster with the given name or nil if it is not in the list.
func (Clusters) GetOrDefault ¶
GetOrDefault returns the given cluster if non-nil. Otherwise returns the first Cluster in the list.
func (Clusters) IsExternalControlPlane ¶
IsExternalControlPlane indicates whether the clusters are set up in an enternal control plane configuration. An external control plane is a primary cluster that gets its Istio configuration from a different cluster.
func (Clusters) IsMulticluster ¶
IsMulticluster is a utility method that indicates whether there are multiple Clusters available.
func (Clusters) MeshClusters ¶
MeshClusters returns the subset that are not external control plane clusters.
type ClustersByNetwork ¶
func (ClustersByNetwork) Networks ¶
func (c ClustersByNetwork) Networks() []string
type Config ¶
type Config struct { Name string `json:"clusterName,omitempty"` Network string `json:"network,omitempty"` HTTPProxy string `json:"httpProxy,omitempty"` ProxyKubectlOnly bool `json:"proxyKubectlOnly,omitempty"` PrimaryClusterName string `json:"primaryClusterName,omitempty"` ConfigClusterName string `json:"configClusterName,omitempty"` Meta config.Map `json:"meta,omitempty"` }
type Map ¶
Map can be given as a shared reference to multiple Topology/Cluster implementations. allowing clusters to find each other for lookups of Primary, ConfigCluster, etc.
type Topology ¶
type Topology struct { ClusterName string Network string ClusterHTTPProxy string PrimaryClusterName string ConfigClusterName string ClusterProxyKubectlOnly bool Index int // AllClusters should contain all AllClusters in the context AllClusters Map ConfigMetadata config.Map }
Topology gives information about the relationship between clusters. Cluster implementations can embed this struct to include common functionality.
func NewTopology ¶
func (Topology) ConfigName ¶
func (Topology) IsExternalControlPlane ¶
func (Topology) MaxKubeVersion ¶
func (Topology) MetadataValue ¶
MetadataValue provides the configured value for a metadata key in the cluster configuration.
func (Topology) MinKubeVersion ¶
func (Topology) PrimaryName ¶
func (Topology) ProxyKubectlOnly ¶
func (Topology) StableName ¶
StableName provides a name used for testcase names. Deterministic, so testgrid can be consistent when the underlying cluster names are dynamic.