kube

package
v0.0.0-...-33ef25c Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: Apache-2.0 Imports: 17 Imported by: 3

Documentation

Index

Constants

View Source
const (
	ArchAMD64 = "amd64"
	ArchARM64 = "arm64"
)

Variables

This section is empty.

Functions

func New

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

New returns a new Kubernetes environment

Types

type ClientFactoryFunc

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

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

type Environment

type Environment struct {
	// 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) AllClusters

func (e *Environment) AllClusters() cluster.Clusters

func (*Environment) Clusters

func (e *Environment) Clusters() cluster.Clusters

func (*Environment) ClustersByNetwork

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

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

func (*Environment) EnvironmentName

func (e *Environment) EnvironmentName() string

func (*Environment) ID

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

ID implements resource.Instance

func (*Environment) IsMultiCluster

func (e *Environment) IsMultiCluster() bool

func (*Environment) IsMultiNetwork

func (e *Environment) IsMultiNetwork() bool

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

func (*Environment) Settings

func (e *Environment) Settings() *Settings

type FakeEnvironment

type FakeEnvironment struct {
	Name        string
	NumClusters int
	IDValue     string
}

FakeEnvironment for testing.

func (FakeEnvironment) AllClusters

func (f FakeEnvironment) AllClusters() cluster.Clusters

func (FakeEnvironment) Clusters

func (f FakeEnvironment) Clusters() cluster.Clusters

func (FakeEnvironment) EnvironmentName

func (f FakeEnvironment) EnvironmentName() string

func (FakeEnvironment) ID

func (f FakeEnvironment) ID() resource.ID

func (FakeEnvironment) IsMultiCluster

func (f FakeEnvironment) IsMultiCluster() bool

func (FakeEnvironment) IsMultiNetwork

func (f FakeEnvironment) IsMultiNetwork() bool

type Settings

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

	// Indicates that the LoadBalancer services can obtain a public IP. If not, NodePort be used as a workaround
	// for ingress gateway. KinD will not support LoadBalancer out of the box and requires a workaround such as
	// MetalLB.
	LoadBalancerSupported bool

	// Architecture indicates the architecture of the cluster under test
	Architecture string

	// MCSControllerEnabled indicates that the Kubernetes environment has a Multi-Cluster Services (MCS)
	// controller up and running.
	MCSControllerEnabled bool

	// MCSAPIGroup the group to use for the MCS API
	MCSAPIGroup string

	// MCSAPIVersion the version to use for the MCS API
	MCSAPIVersion string
	// contains filtered or unexported fields
}

Settings provide kube-specific Settings from flags.

func NewSettingsFromCommandLine

func NewSettingsFromCommandLine() (*Settings, error)

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

func (*Settings) MCSAPIGroupVersion

func (s *Settings) MCSAPIGroupVersion() schema.GroupVersion

func (*Settings) ServiceExportGVR

func (s *Settings) ServiceExportGVR() schema.GroupVersionResource

func (*Settings) ServiceImportGVR

func (s *Settings) ServiceImportGVR() schema.GroupVersionResource

func (*Settings) String

func (s *Settings) String() string

String implements fmt.Stringer

Jump to

Keyboard shortcuts

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