k8sclient

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRestConfig

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

GetRestConfig get rest config with clusterName

Types

type K8sClient

type K8sClient struct {

	// client for kubernetes
	ClientSet kubernetes.Interface
	CRClient  client.Client
	// contains filtered or unexported fields
}

func New

func New(clusterName string, ops ...Option) (*K8sClient, error)

New new K8sClient with clusterName.

func NewForInCluster

func NewForInCluster(ops ...Option) (*K8sClient, error)

NewForInCluster New client for in cluster

func NewForRestConfig

func NewForRestConfig(c *rest.Config, ops ...Option) (*K8sClient, error)

NewForRestConfig new K8sClient with rest.Config, you can register your custom runtime.Scheme.

func NewWithTimeOut

func NewWithTimeOut(clusterName string, timeout time.Duration) (*K8sClient, error)

NewWithTimeOut new k8sClient with timeout

type Option

type Option func(*K8sClient)

func WithPreferredToUseInClusterConfig

func WithPreferredToUseInClusterConfig() Option

WithPreferredToUseInClusterConfig set whether priority to use in cluster config if not set this option, we will get and use config set by cluster agent

func WithSchemes

func WithSchemes(schemes ...func(scheme *runtime.Scheme) error) Option

func WithTimeout

func WithTimeout(timeout time.Duration) Option

Directories

Path Synopsis
apis
keda/v1alpha1
Package v1alpha1 contains API Schema definitions for the keda v1alpha1 API group +kubebuilder:object:generate=true +groupName=keda.sh
Package v1alpha1 contains API Schema definitions for the keda v1alpha1 API group +kubebuilder:object:generate=true +groupName=keda.sh
openyurt/v1alpha1
+groupName=apps.openyurt.io
+groupName=apps.openyurt.io

Jump to

Keyboard shortcuts

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