k8s

package
v3.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Kubernetes() kubernetes.Interface
	KubeSphere() kubesphere.Interface
	Istio() istioclient.Interface
	Application() applicationclientset.Interface
	Snapshot() snapshotclient.Interface
	ApiExtensions() apiextensionsclient.Interface
	Discovery() discovery.DiscoveryInterface
	Master() string
	Config() *rest.Config
}

func NewFakeClientSets

func NewFakeClientSets(k8sClient kubernetes.Interface, discoveryClient *discovery.DiscoveryClient,
	kubeSphereClient kubesphere.Interface, applicationClient applicationclientset.Interface,
	istioClient istioclient.Interface, snapshotClient snapshotclient.Interface,
	apiextensionsclient apiextensionsclient.Interface, masterURL string, kubeConfig *rest.Config) Client

func NewKubernetesClient

func NewKubernetesClient(options *KubernetesOptions) (Client, error)

NewKubernetesClient creates a KubernetesClient

func NewKubernetesClientOrDie

func NewKubernetesClientOrDie(options *KubernetesOptions) Client

NewKubernetesClientOrDie creates KubernetesClient and panic if there is an error

func NewNullClient

func NewNullClient() Client

type FakeClient

type FakeClient struct {
	// kubernetes client interface
	K8sClient kubernetes.Interface

	// discovery client
	DiscoveryClient *discovery.DiscoveryClient

	// generated clientset
	KubeSphereClient kubesphere.Interface

	ApplicationClient applicationclientset.Interface

	IstioClient istioclient.Interface

	SnapshotClient snapshotclient.Interface

	ApiExtensionClient apiextensionsclient.Interface

	MasterURL string

	KubeConfig *rest.Config
}

func (*FakeClient) ApiExtensions

func (n *FakeClient) ApiExtensions() apiextensionsclient.Interface

func (*FakeClient) Application

func (n *FakeClient) Application() application.Interface

func (*FakeClient) Config

func (n *FakeClient) Config() *rest.Config

func (*FakeClient) Discovery

func (n *FakeClient) Discovery() discovery.DiscoveryInterface

func (*FakeClient) Istio

func (n *FakeClient) Istio() istioclient.Interface

func (*FakeClient) KubeSphere

func (n *FakeClient) KubeSphere() kubesphere.Interface

func (*FakeClient) Kubernetes

func (n *FakeClient) Kubernetes() kubernetes.Interface

func (*FakeClient) Master

func (n *FakeClient) Master() string

func (*FakeClient) Snapshot

func (n *FakeClient) Snapshot() snapshotclient.Interface

type KubernetesOptions

type KubernetesOptions struct {
	// kubeconfig path, if not specified, will use
	// in cluster way to create clientset
	KubeConfig string `json:"kubeconfig" yaml:"kubeconfig"`

	// kubernetes apiserver public address, used to generate kubeconfig
	// for downloading, default to host defined in kubeconfig
	// +optional
	Master string `json:"master,omitempty" yaml:"master"`

	// kubernetes clientset qps
	// +optional
	QPS float32 `json:"qps,omitempty" yaml:"qps"`

	// kubernetes clientset burst
	// +optional
	Burst int `json:"burst,omitempty" yaml:"burst"`
}

func NewKubernetesOptions

func NewKubernetesOptions() *KubernetesOptions

NewKubernetesOptions returns a `zero` instance

func (*KubernetesOptions) AddFlags

func (k *KubernetesOptions) AddFlags(fs *pflag.FlagSet, c *KubernetesOptions)

func (*KubernetesOptions) ApplyTo

func (k *KubernetesOptions) ApplyTo(options *KubernetesOptions)

func (*KubernetesOptions) Validate

func (k *KubernetesOptions) Validate() []error

Jump to

Keyboard shortcuts

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