client

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2025 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClient

func GetClient(restConfig *rest.Config) (*kubernetes.Clientset, error)

k8s clientset

func GetKubeConfig

func GetKubeConfig(configPath ...string) string

first use kubeconfig from configPath second use env.KUBECONFIG third use $HOME/.kube/config default return empty string

func GetRestConfig

func GetRestConfig(kubeconfig string) (*rest.Config, error)

get rest config, if you want use for other resources Example: istioClient

Types

type Client added in v0.1.5

type Client struct {
	// kubeconfig path
	KubeConfig string
	// REST config, use for other resources
	RestConfig *rest.Config
	// kube clientset
	KubeClient *kubernetes.Clientset
}

func NewClient added in v0.1.5

func NewClient() (*Client, error)

func (*Client) GetClientSetWithContext added in v0.1.5

func (c *Client) GetClientSetWithContext(contextName string) (*kubernetes.Clientset, error)

k8s api client with set-context = contextName configPath equal merged kubeconfigs, example dev, prod, test

func (*Client) GetDynamicClient added in v0.1.5

func (c *Client) GetDynamicClient() (*dynamic.DynamicClient, error)

get dyn client for use dynamic DynamicClient

func (*Client) GetDynamicClientWithContext added in v0.1.5

func (c *Client) GetDynamicClientWithContext(contextName string) (*dynamic.DynamicClient, error)

get dynamic client with Context

func (*Client) GetIstioClient added in v0.1.5

func (c *Client) GetIstioClient() (*istioVersioned.Clientset, error)

get istio client

func (*Client) GetRuntimeClient added in v0.1.5

func (c *Client) GetRuntimeClient(r *runtime.Scheme) (runtimeclient.Client, error)

get runtime client

Jump to

Keyboard shortcuts

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