k8s

package
v0.0.0-...-18e089f Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: Apache-2.0 Imports: 16 Imported by: 9

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
	Snapshot() snapshotclient.Interface
	ApiExtensions() apiextensionsclient.Interface
	Prometheus() promresourcesclient.Interface
	Master() string
	Config() *rest.Config
}

func NewFakeClientSets

func NewFakeClientSets(k8sClient kubernetes.Interface, discoveryClient *discovery.DiscoveryClient,
	kubeSphereClient kubesphere.Interface,
	istioClient istioclient.Interface, snapshotClient snapshotclient.Interface,
	apiextensionsclient apiextensionsclient.Interface, prometheusClient promresourcesclient.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

	IstioClient istioclient.Interface

	SnapshotClient snapshotclient.Interface

	ApiExtensionClient apiextensionsclient.Interface

	MasterURL string

	KubeConfig *rest.Config
	// contains filtered or unexported fields
}

func (*FakeClient) ApiExtensions

func (n *FakeClient) ApiExtensions() apiextensionsclient.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) Prometheus

func (n *FakeClient) Prometheus() promresourcesclient.Interface

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,omitempty"`

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

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

func NewKubernetesOptions

func NewKubernetesOptions() (option *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