kubernetes

package
v1.9.1-beta.1 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2023 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 8 more Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ClusterNameToClient      sync.Map
	ClusterNameToIstioClient sync.Map
)

Functions

This section is empty.

Types

type Client

type Client interface {
	// RestConfig given cluster id to get Kubernetes cluster rest config
	RestConfig(cluster string) (*rest.Config, error)
	// Cluster given cluster id to get Kubernetes cluster client
	Cluster(cluster string) (ctrlclient.Client, error)
	// Istio given cluster id to get Istio client
	Istio(cluster string) (ctrlclient.Client, error)
}

Client facade interface

func New

func New(provider ClusterProvider) Client

New new client

type ClusterProvider

type ClusterProvider interface {
	// RestConfig Kubernetes cluster rest config
	RestConfig(clusterName string) (*rest.Config, error)
	// Client Kubernetes cluster client with scheme
	Client(clusterName string, scheme *runtime.Scheme) (ctrlclient.Client, error)
}

ClusterProvider retrieve cluster kubeconfig provider interface

type KubeConfigClusterProvider

type KubeConfigClusterProvider struct {
	KubeConfigFiles string
}

KubeConfigClusterProvider get kubeconfig files from env var Only for local test

func NewKubeConfigProvider

func NewKubeConfigProvider(kubeconfigFiles string) *KubeConfigClusterProvider

Only for local test

func (*KubeConfigClusterProvider) Client

func (k *KubeConfigClusterProvider) Client(clusterName string, scheme *runtime.Scheme) (ctrlclient.Client, error)

func (*KubeConfigClusterProvider) RestConfig

func (k *KubeConfigClusterProvider) RestConfig(clusterName string) (*rest.Config, error)

type TKEClusterProvider

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

TKEClusterProvider get kubeconfig from tkestack platform api

func NewTKEClusterProvider

func NewTKEClusterProvider(platformClient platformversionedclient.PlatformV1Interface) *TKEClusterProvider

NewTKEClusterProvider

func (*TKEClusterProvider) Client

func (t *TKEClusterProvider) Client(clusterName string, scheme *runtime.Scheme) (ctrlclient.Client, error)

func (*TKEClusterProvider) RestConfig

func (t *TKEClusterProvider) RestConfig(clusterName string) (*rest.Config, error)

Jump to

Keyboard shortcuts

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