cluster

package
v0.17.0-rc.4 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2023 License: MPL-2.0 Imports: 19 Imported by: 12

Documentation

Index

Constants

View Source
const (
	// DefaultCluster name
	DefaultCluster = "Default"
	// ClientQPS is the QPS to use while creating the k8s clients (actually a float32)
	ClientQPS = 1000
	// ClientBurst is the burst to use while creating the k8s clients
	ClientBurst = 2000
)

Variables

View Source
var (
	DefaultKubeConfigOptions = []KubeConfigOption{WithFlowControl}
)

Functions

func WithFlowControl

func WithFlowControl(config *rest.Config) (*rest.Config, error)

Types

type Cluster

type Cluster interface {
	// GetName gets the name weave-gitops has given this cluster.
	GetName() string
	// GetHost gets the host of the cluster - this should match what's set in the `rest.Config`s below
	GetHost() string
	// GetServerClient gets a un-impersonated client for this cluster
	GetServerClient() (client.Client, error)
	// GetUserClient gets an appropriately impersonated client for the user on this cluster
	GetUserClient(*auth.UserPrincipal) (client.Client, error)
	// GetServerClientset gets an un-impersonated clientset for this cluster
	GetServerClientset() (kubernetes.Interface, error)
	// GetUserClientset gets an appropriately impersonated clientset for the user on this cluster
	GetUserClientset(*auth.UserPrincipal) (kubernetes.Interface, error)
	// GetServerConig gets an un-impersonated rest config for this cluster.
	// Note that using this might bypass e.g. caches.
	GetServerConfig() (*rest.Config, error)
}

Cluster is an abstraction around a connection to a specific k8s cluster It's effectively a pair of (name, rest.Config), with some helpers

func NewDelegatingCacheCluster

func NewDelegatingCacheCluster(cluster Cluster, config *rest.Config, scheme *runtime.Scheme) Cluster

func NewSingleCluster

func NewSingleCluster(name string, config *rest.Config, scheme *apiruntime.Scheme, kubeConfigOptions ...KubeConfigOption) (Cluster, error)

type KubeConfigOption

type KubeConfigOption func(*rest.Config) (*rest.Config, error)

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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