istio: istio.io/istio/pkg/test/framework/components/environment/kube Index | Files

package kube

import "istio.io/istio/pkg/test/framework/components/environment/kube"

Index

Package Files

cluster.go flags.go kube.go settings.go

func New Uses

func New(ctx resource.Context, s *Settings) (resource.Environment, error)

New returns a new Kubernetes environment

func Setup Uses

func Setup(sfn SetupSettingsFunc) resource.SetupFn

Setup is a setup function that allows overriding values in the Kube environment settings.

type ClientFactoryFunc Uses

type ClientFactoryFunc func(kubeConfigs []string) ([]istioKube.ExtendedClient, error)

ClientFactoryFunc is a transformation function that creates k8s clients from the provided k8s config files.

type Cluster Uses

type Cluster struct {
    kube.ExtendedClient
    // contains filtered or unexported fields
}

Cluster for a Kubernetes cluster. Provides access via a kube.Client.

func (Cluster) Filename Uses

func (c Cluster) Filename() string

TODO(nmittler): Remove the need for this by changing operator to use provided kube clients directly. Filename of the kubeconfig file for this cluster.

func (Cluster) Index Uses

func (c Cluster) Index() resource.ClusterIndex

Index of this cluster within the Environment.

func (Cluster) Name Uses

func (c Cluster) Name() string

Name provides the name this cluster used by Istio.

func (Cluster) NetworkName Uses

func (c Cluster) NetworkName() string

NetworkName the cluster is on

func (Cluster) String Uses

func (c Cluster) String() string

type Environment Uses

type Environment struct {
    KubeClusters []Cluster
    // contains filtered or unexported fields
}

Environment is the implementation of a kubernetes environment. It implements environment.Environment, and also hosts publicly accessible methods that are specific to cluster environment.

func (*Environment) Case Uses

func (e *Environment) Case(name environment.Name, fn func())

func (*Environment) Clusters Uses

func (e *Environment) Clusters() []resource.Cluster

func (*Environment) ClustersByNetwork Uses

func (e *Environment) ClustersByNetwork() map[string][]*Cluster

ClustersByNetwork returns an inverse mapping of the network topolgoy to a slice of clusters in a given network.

func (*Environment) ControlPlaneClusters Uses

func (e *Environment) ControlPlaneClusters(excludedClusters ...resource.Cluster) []resource.Cluster

func (*Environment) EnvironmentName Uses

func (e *Environment) EnvironmentName() environment.Name

func (*Environment) GetControlPlaneCluster Uses

func (e *Environment) GetControlPlaneCluster(cluster resource.Cluster) (resource.Cluster, error)

GetControlPlaneCluster returns the cluster running the control plane for the given cluster based on the ControlPlaneTopology. An error is returned if the given cluster isn't present in the topology, or the cluster in the topology isn't in KubeClusters.

func (*Environment) ID Uses

func (e *Environment) ID() resource.ID

ID implements resource.Instance

func (*Environment) IsControlPlaneCluster Uses

func (e *Environment) IsControlPlaneCluster(cluster resource.Cluster) bool

IsControlPlaneCluster returns true if the cluster uses its own control plane in the ControlPlaneTopology. We return if there is no mapping for the cluster, similar to the behavior of the istio.test.kube.controlPlaneTopology.

func (*Environment) IsMulticluster Uses

func (e *Environment) IsMulticluster() bool

func (*Environment) IsMultinetwork Uses

func (e *Environment) IsMultinetwork() bool

IsMultinetwork returns true if there is more than one network name in networkTopology.

func (*Environment) Settings Uses

func (e *Environment) Settings() *Settings

type Settings Uses

type Settings struct {
    // An array of paths to kube config files. Required if the environment is kubernetes.
    KubeConfig []string

    // ClientFactoryFunc is an optional override for the default behavior for creating k8s clients.
    // instances for interacting with clusters. If not specified, the clients will be created from KubeConfig.
    ClientFactoryFunc ClientFactoryFunc

    // Indicates that the Ingress Gateway is not available. This typically happens in Minikube. The Ingress
    // component will fall back to node-port in this case.
    Minikube bool

    // ControlPlaneTopology maps each cluster to the cluster that runs its control plane. For replicated control
    // plane cases (where each cluster has its own control plane), the cluster will map to itself (e.g. 0->0).
    ControlPlaneTopology map[resource.ClusterIndex]resource.ClusterIndex
    // contains filtered or unexported fields
}

Settings provide kube-specific Settings from flags.

func NewSettingsFromCommandLine Uses

func NewSettingsFromCommandLine() (*Settings, error)

NewSettingsFromCommandLine returns Settings obtained from command-line flags. flag.Parse must be called before calling this function.

func (*Settings) GetControlPlaneClusters Uses

func (s *Settings) GetControlPlaneClusters() map[resource.ClusterIndex]bool

GetControlPlaneClusters returns a set containing just the cluster indexes that contain control planes.

func (*Settings) NewClients Uses

func (s *Settings) NewClients() ([]istioKube.ExtendedClient, error)

NewClients creates the kubernetes clients for interacting with the configured clusters.

func (*Settings) String Uses

func (s *Settings) String() string

String implements fmt.Stringer

type SetupSettingsFunc Uses

type SetupSettingsFunc func(s *Settings)

Package kube imports 13 packages (graph) and is imported by 32 packages. Updated 2020-07-15. Refresh now. Tools for package owners.