provider

package
v0.0.0-...-67cdcee Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AKSName         = "aks"
	AWSName         = "aws"
	AutopilotName   = "autopilot"
	EKSName         = "eks"
	GCEName         = "gce"
	GKEName         = "gke"
	GKEKubemarkName = "gkekubemark"
	KCPName         = "kcp"
	KindName        = "kind"
	KubemarkName    = "kubemark"
	LocalName       = "local"
	SkeletonName    = "skeleton"
	VsphereName     = "vsphere"
	KubestellarName = "ks"
)
View Source
const (
	RootKubeConfigKey = "ROOT_KUBECONFIG"
)

Variables

View Source
var (
	ErrNoManagedPrometheus = errors.New("no managed Prometheus service for this cloud provider")
)

Functions

This section is empty.

Types

type AKSProvider

type AKSProvider struct {
	// contains filtered or unexported fields
}

func (*AKSProvider) Features

func (p *AKSProvider) Features() *Features

func (*AKSProvider) GetComponentProtocolAndPort

func (p *AKSProvider) GetComponentProtocolAndPort(componentName string) (string, int, error)

func (*AKSProvider) GetConfig

func (p *AKSProvider) GetConfig() Config

func (*AKSProvider) GetManagedPrometheusClient

func (p *AKSProvider) GetManagedPrometheusClient() (prom.Client, error)

func (*AKSProvider) Metadata

func (p *AKSProvider) Metadata(_ clientset.Interface) (map[string]string, error)

func (*AKSProvider) Name

func (p *AKSProvider) Name() string

func (*AKSProvider) RunSSHCommand

func (p *AKSProvider) RunSSHCommand(cmd, host string) (string, string, int, error)

type AWSProvider

type AWSProvider struct {
	// contains filtered or unexported fields
}

func (*AWSProvider) Features

func (p *AWSProvider) Features() *Features

func (*AWSProvider) GetComponentProtocolAndPort

func (p *AWSProvider) GetComponentProtocolAndPort(componentName string) (string, int, error)

func (*AWSProvider) GetConfig

func (p *AWSProvider) GetConfig() Config

func (*AWSProvider) GetManagedPrometheusClient

func (p *AWSProvider) GetManagedPrometheusClient() (prom.Client, error)

func (*AWSProvider) Metadata

func (p *AWSProvider) Metadata(_ clientset.Interface) (map[string]string, error)

func (*AWSProvider) Name

func (p *AWSProvider) Name() string

func (*AWSProvider) RunSSHCommand

func (p *AWSProvider) RunSSHCommand(cmd, host string) (string, string, int, error)

type AutopilotProvider

type AutopilotProvider struct {
	// contains filtered or unexported fields
}

func (*AutopilotProvider) Features

func (p *AutopilotProvider) Features() *Features

func (*AutopilotProvider) GetComponentProtocolAndPort

func (p *AutopilotProvider) GetComponentProtocolAndPort(componentName string) (string, int, error)

func (*AutopilotProvider) GetConfig

func (p *AutopilotProvider) GetConfig() Config

func (*AutopilotProvider) GetManagedPrometheusClient

func (p *AutopilotProvider) GetManagedPrometheusClient() (prom.Client, error)

func (*AutopilotProvider) Metadata

func (p *AutopilotProvider) Metadata(_ clientset.Interface) (map[string]string, error)

func (*AutopilotProvider) Name

func (p *AutopilotProvider) Name() string

func (*AutopilotProvider) RunSSHCommand

func (p *AutopilotProvider) RunSSHCommand(cmd, host string) (string, string, int, error)

type Config

type Config map[string]string

Config is the config of the provider.

func (Config) RootFrameworkKubeConfigOverride

func (c Config) RootFrameworkKubeConfigOverride() string

RootFrameworkKubeConfigOverride returns the KubeConfig override for Root Framework.

type EKSProvider

type EKSProvider struct {
	// contains filtered or unexported fields
}

func (*EKSProvider) Features

func (p *EKSProvider) Features() *Features

func (*EKSProvider) GetComponentProtocolAndPort

func (p *EKSProvider) GetComponentProtocolAndPort(componentName string) (string, int, error)

func (*EKSProvider) GetConfig

func (p *EKSProvider) GetConfig() Config

func (*EKSProvider) GetManagedPrometheusClient

func (p *EKSProvider) GetManagedPrometheusClient() (prom.Client, error)

func (*EKSProvider) Metadata

func (p *EKSProvider) Metadata(_ clientset.Interface) (map[string]string, error)

func (*EKSProvider) Name

func (p *EKSProvider) Name() string

func (*EKSProvider) RunSSHCommand

func (p *EKSProvider) RunSSHCommand(cmd, host string) (string, string, int, error)

type Features

type Features struct {
	// IsKubemarkProvider indicates if some features do not work for kubemark-like providers or have a separate implementation.
	IsKubemarkProvider bool

	// SupportWindowsNodeScraping indicates if scraping windows nodes is supported.
	SupportWindowsNodeScraping bool

	// SupportProbe determines whether probe is supported.
	SupportProbe bool

	// SupportImagePreload determines whether image preloading is supported.
	SupportImagePreload bool

	// SupportEnablePrometheusServer determines whether enabling prometheus server is possible.
	SupportEnablePrometheusServer bool

	// SupportSSHToMaster determines whether SSH access to master machines is possible.
	// If false (impossible for many providers), ClusterLoader will skip operations requiring it.
	SupportSSHToMaster bool

	// SupportAccessAPIServerPprofEndpoint determines whether accessing api server pprof endpoint is possible.
	SupportAccessAPIServerPprofEndpoint bool

	// SupportSnapshotPrometheusDisk determines whether snapshot prometheus disk is supported.
	SupportSnapshotPrometheusDisk bool

	// SupportNodeKiller determines whether node killer is supported.
	SupportNodeKiller bool

	// SupportGrabMetricsFromKubelets determines whether getting metrics from kubelet is supported.
	SupportGrabMetricsFromKubelets bool

	// SupportKubeStateMetrics determines if running kube-state-metrics is supported.
	SupportKubeStateMetrics bool

	// SupportMetricsServerMetrics determines if running metrics server is supported.
	SupportMetricsServerMetrics bool

	// SupportResourceUsageMetering determines if resource usage measurement is supported.
	SupportResourceUsageMetering bool

	// ShouldPrometheusScrapeApiserverOnly determines if we should set `PROMETHEUS_SCRAPE_APISERVER_ONLY` by default.
	ShouldPrometheusScrapeApiserverOnly bool

	// SchedulerInsecurePortDisabled determines if kube-scheduler listens on an insecure port.
	SchedulerInsecurePortDisabled bool

	// ShouldScrapeKubeProxy determines if prommetheus should set `PROMETHEUS_SCRAPE_KUBE_PROXY` by default.
	ShouldScrapeKubeProxy bool
}

Features represents all features supported by this provider.

type GCEProvider

type GCEProvider struct {
	// contains filtered or unexported fields
}

func (*GCEProvider) Features

func (p *GCEProvider) Features() *Features

func (*GCEProvider) GetComponentProtocolAndPort

func (p *GCEProvider) GetComponentProtocolAndPort(componentName string) (string, int, error)

func (*GCEProvider) GetConfig

func (p *GCEProvider) GetConfig() Config

func (*GCEProvider) GetManagedPrometheusClient

func (p *GCEProvider) GetManagedPrometheusClient() (prom.Client, error)

func (*GCEProvider) Metadata

func (p *GCEProvider) Metadata(c clientset.Interface) (map[string]string, error)

func (*GCEProvider) Name

func (p *GCEProvider) Name() string

func (*GCEProvider) RunSSHCommand

func (p *GCEProvider) RunSSHCommand(cmd, host string) (string, string, int, error)

type GKEKubemarkProvider

type GKEKubemarkProvider struct {
	// contains filtered or unexported fields
}

func NewGKEKubemarkProvider

func NewGKEKubemarkProvider(config map[string]string) *GKEKubemarkProvider

func (*GKEKubemarkProvider) Features

func (p *GKEKubemarkProvider) Features() *Features

func (*GKEKubemarkProvider) GetComponentProtocolAndPort

func (p *GKEKubemarkProvider) GetComponentProtocolAndPort(componentName string) (string, int, error)

func (*GKEKubemarkProvider) GetConfig

func (p *GKEKubemarkProvider) GetConfig() Config

func (*GKEKubemarkProvider) GetManagedPrometheusClient

func (p *GKEKubemarkProvider) GetManagedPrometheusClient() (prom.Client, error)

func (*GKEKubemarkProvider) Metadata

func (p *GKEKubemarkProvider) Metadata(_ clientset.Interface) (map[string]string, error)

func (*GKEKubemarkProvider) Name

func (p *GKEKubemarkProvider) Name() string

func (*GKEKubemarkProvider) RunSSHCommand

func (p *GKEKubemarkProvider) RunSSHCommand(cmd, host string) (string, string, int, error)

type GKEProvider

type GKEProvider struct {
	// contains filtered or unexported fields
}

func (*GKEProvider) Features

func (p *GKEProvider) Features() *Features

func (*GKEProvider) GetComponentProtocolAndPort

func (p *GKEProvider) GetComponentProtocolAndPort(componentName string) (string, int, error)

func (*GKEProvider) GetConfig

func (p *GKEProvider) GetConfig() Config

func (*GKEProvider) GetManagedPrometheusClient

func (p *GKEProvider) GetManagedPrometheusClient() (prom.Client, error)

func (*GKEProvider) Metadata

func (p *GKEProvider) Metadata(_ clientset.Interface) (map[string]string, error)

func (*GKEProvider) Name

func (p *GKEProvider) Name() string

func (*GKEProvider) RunSSHCommand

func (p *GKEProvider) RunSSHCommand(cmd, host string) (string, string, int, error)

type InitOptions

type InitOptions struct {
	// TODO(#1361) remove this and use providerConfigs.
	KubemarkRootKubeConfigPath string
	ProviderName               string
	ProviderConfigs            []string
}

InitOptions encapsulates the fields needed to init provider.

type KCPProvider

type KCPProvider struct {
	// contains filtered or unexported fields
}

func (*KCPProvider) Features

func (p *KCPProvider) Features() *Features

func (*KCPProvider) GetComponentProtocolAndPort

func (p *KCPProvider) GetComponentProtocolAndPort(componentName string) (string, int, error)

func (*KCPProvider) GetConfig

func (p *KCPProvider) GetConfig() Config

func (*KCPProvider) GetManagedPrometheusClient

func (p *KCPProvider) GetManagedPrometheusClient() (prom.Client, error)

func (*KCPProvider) Metadata

func (p *KCPProvider) Metadata(_ clientset.Interface) (map[string]string, error)

func (*KCPProvider) Name

func (p *KCPProvider) Name() string

func (*KCPProvider) RunSSHCommand

func (p *KCPProvider) RunSSHCommand(_, _ string) (string, string, int, error)

type KindProvider

type KindProvider struct {
	// contains filtered or unexported fields
}

func (*KindProvider) Features

func (p *KindProvider) Features() *Features

func (*KindProvider) GetComponentProtocolAndPort

func (p *KindProvider) GetComponentProtocolAndPort(componentName string) (string, int, error)

func (*KindProvider) GetConfig

func (p *KindProvider) GetConfig() Config

func (*KindProvider) GetManagedPrometheusClient

func (p *KindProvider) GetManagedPrometheusClient() (prom.Client, error)

func (*KindProvider) Metadata

func (p *KindProvider) Metadata(_ clientset.Interface) (map[string]string, error)

func (*KindProvider) Name

func (p *KindProvider) Name() string

func (*KindProvider) RunSSHCommand

func (p *KindProvider) RunSSHCommand(_, _ string) (string, string, int, error)

type KubemarkProvider

type KubemarkProvider struct {
	// contains filtered or unexported fields
}

func NewKubemarkProvider

func NewKubemarkProvider(config map[string]string) *KubemarkProvider

func (*KubemarkProvider) Features

func (p *KubemarkProvider) Features() *Features

func (*KubemarkProvider) GetComponentProtocolAndPort

func (p *KubemarkProvider) GetComponentProtocolAndPort(componentName string) (string, int, error)

func (*KubemarkProvider) GetConfig

func (p *KubemarkProvider) GetConfig() Config

func (*KubemarkProvider) GetManagedPrometheusClient

func (p *KubemarkProvider) GetManagedPrometheusClient() (prom.Client, error)

func (*KubemarkProvider) Metadata

func (p *KubemarkProvider) Metadata(_ clientset.Interface) (map[string]string, error)

TODO(mborsz): Dump instanceIDs for master nodes (as in gce).

func (*KubemarkProvider) Name

func (p *KubemarkProvider) Name() string

func (*KubemarkProvider) RunSSHCommand

func (p *KubemarkProvider) RunSSHCommand(cmd, host string) (string, string, int, error)

type KubestellarProvider

type KubestellarProvider struct {
	// contains filtered or unexported fields
}

func (*KubestellarProvider) Features

func (p *KubestellarProvider) Features() *Features

func (*KubestellarProvider) GetComponentProtocolAndPort

func (p *KubestellarProvider) GetComponentProtocolAndPort(componentName string) (string, int, error)

func (*KubestellarProvider) GetConfig

func (p *KubestellarProvider) GetConfig() Config

func (*KubestellarProvider) GetManagedPrometheusClient

func (p *KubestellarProvider) GetManagedPrometheusClient() (prom.Client, error)

func (*KubestellarProvider) Metadata

func (p *KubestellarProvider) Metadata(_ clientset.Interface) (map[string]string, error)

func (*KubestellarProvider) Name

func (p *KubestellarProvider) Name() string

func (*KubestellarProvider) RunSSHCommand

func (p *KubestellarProvider) RunSSHCommand(_, _ string) (string, string, int, error)

type LocalProvider

type LocalProvider struct {
	// contains filtered or unexported fields
}

func (*LocalProvider) Features

func (p *LocalProvider) Features() *Features

func (*LocalProvider) GetComponentProtocolAndPort

func (p *LocalProvider) GetComponentProtocolAndPort(componentName string) (string, int, error)

func (*LocalProvider) GetConfig

func (p *LocalProvider) GetConfig() Config

func (*LocalProvider) GetManagedPrometheusClient

func (p *LocalProvider) GetManagedPrometheusClient() (prom.Client, error)

func (*LocalProvider) Metadata

func (p *LocalProvider) Metadata(_ clientset.Interface) (map[string]string, error)

func (*LocalProvider) Name

func (p *LocalProvider) Name() string

func (*LocalProvider) RunSSHCommand

func (p *LocalProvider) RunSSHCommand(cmd, host string) (string, string, int, error)

type Provider

type Provider interface {
	// Name returns name of this provider. It should used only in logs.
	Name() string

	// Features returns the feature supported by this provider.
	Features() *Features

	// GetConfig returns the provider config.
	GetConfig() Config

	// GetManagedPrometheusClient returns HTTP client for communicating with the relevant cloud provider's managed Prometheus service.
	GetManagedPrometheusClient() (prom.Client, error)

	// GetComponentProtocolAndPort returns the protocol and port for the control plane components.
	GetComponentProtocolAndPort(componentName string) (string, int, error)

	// RunSSHCommand runs an SSH command `cmd` on the host `host`. It returns stdout, stderr, exit code, and the error, respectively.
	RunSSHCommand(cmd, host string) (string, string, int, error)

	// Metadata returns provider-specific test run metadata.
	Metadata(client clientset.Interface) (map[string]string, error)
}

Provider is the interface for a ClusterLoader provider.

func NewAKSProvider

func NewAKSProvider(_ map[string]string) Provider

func NewAWSProvider

func NewAWSProvider(_ map[string]string) Provider

func NewAutopilotProvider

func NewAutopilotProvider(_ map[string]string) Provider

func NewEKSProvider

func NewEKSProvider(_ map[string]string) Provider

func NewGCEProvider

func NewGCEProvider(_ map[string]string) Provider

func NewGKEProvider

func NewGKEProvider(_ map[string]string) Provider

func NewKCPProvider

func NewKCPProvider(_ map[string]string) Provider

func NewKindProvider

func NewKindProvider(_ map[string]string) Provider

func NewKubestellarProvider

func NewKubestellarProvider(_ map[string]string) Provider

func NewLocalProvider

func NewLocalProvider(_ map[string]string) Provider

func NewProvider

func NewProvider(initOptions *InitOptions) (Provider, error)

NewProvider creates a new provider from init options. It will return an error if the provider name is not supported.

func NewSkeletonProvider

func NewSkeletonProvider(_ map[string]string) Provider

func NewVsphereProvider

func NewVsphereProvider(_ map[string]string) Provider

type SkeletonProvider

type SkeletonProvider struct {
	// contains filtered or unexported fields
}

func (*SkeletonProvider) Features

func (p *SkeletonProvider) Features() *Features

func (*SkeletonProvider) GetComponentProtocolAndPort

func (p *SkeletonProvider) GetComponentProtocolAndPort(componentName string) (string, int, error)

func (*SkeletonProvider) GetConfig

func (p *SkeletonProvider) GetConfig() Config

func (*SkeletonProvider) GetManagedPrometheusClient

func (p *SkeletonProvider) GetManagedPrometheusClient() (prom.Client, error)

func (*SkeletonProvider) GetRootFrameworkKubeConfigOverride

func (p *SkeletonProvider) GetRootFrameworkKubeConfigOverride() string

func (*SkeletonProvider) Metadata

func (p *SkeletonProvider) Metadata(_ clientset.Interface) (map[string]string, error)

func (*SkeletonProvider) Name

func (p *SkeletonProvider) Name() string

func (*SkeletonProvider) RunSSHCommand

func (p *SkeletonProvider) RunSSHCommand(cmd, host string) (string, string, int, error)

type VsphereProvider

type VsphereProvider struct {
	// contains filtered or unexported fields
}

func (*VsphereProvider) Features

func (p *VsphereProvider) Features() *Features

func (*VsphereProvider) GetComponentProtocolAndPort

func (p *VsphereProvider) GetComponentProtocolAndPort(componentName string) (string, int, error)

func (*VsphereProvider) GetConfig

func (p *VsphereProvider) GetConfig() Config

func (*VsphereProvider) GetManagedPrometheusClient

func (p *VsphereProvider) GetManagedPrometheusClient() (prom.Client, error)

func (*VsphereProvider) Metadata

func (p *VsphereProvider) Metadata(_ clientset.Interface) (map[string]string, error)

func (*VsphereProvider) Name

func (p *VsphereProvider) Name() string

func (*VsphereProvider) RunSSHCommand

func (p *VsphereProvider) RunSSHCommand(cmd, host string) (string, string, int, error)

Jump to

Keyboard shortcuts

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