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 ¶
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 NewSingleCluster ¶
func NewSingleCluster(name string, config *rest.Config, scheme *apiruntime.Scheme, kubeConfigOptions ...KubeConfigOption) (Cluster, error)
Click to show internal directories.
Click to hide internal directories.