k8sclient

package
v1.3.0-rc.0...-d217119 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Apache-2.0 Imports: 15 Imported by: 2

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 added in v1.5.0

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
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