kube

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2025 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultKubectlCacheDir      = filepath.Join(homedir.HomeDir(), ".kube", "cache")
	KubectlCacheDirEnv          = "KUBECACHEDIR"
	KubectlHttpCacheSubdir      = "http"
	KubectlDiscoveryCacheSubdir = "discovery"
)

Functions

func NewDiscoveryKubeClientFromKubeConfig

func NewDiscoveryKubeClientFromKubeConfig(kubeConfig *KubeConfig) (*disk.CachedDiscoveryClient, error)

func NewDynamicKubeClientFromKubeConfig

func NewDynamicKubeClientFromKubeConfig(kubeConfig *KubeConfig) (*dynamic.DynamicClient, error)

func NewKubeMapper

func NewKubeMapper(ctx context.Context, discoveryClient discovery.CachedDiscoveryInterface) meta.RESTMapper

func NewStaticKubeClientFromKubeConfig

func NewStaticKubeClientFromKubeConfig(kubeConfig *KubeConfig) (*kubernetes.Clientset, error)

Types

type ClientFactory

type ClientFactory struct {
	// contains filtered or unexported fields
}

func NewClientFactory

func NewClientFactory(ctx context.Context, kubeConfig *KubeConfig) (*ClientFactory, error)

func (*ClientFactory) Discovery

func (*ClientFactory) Dynamic

func (f *ClientFactory) Dynamic() dynamic.Interface

func (*ClientFactory) KubeClient

func (f *ClientFactory) KubeClient() KubeClienter

func (*ClientFactory) KubeConfig

func (f *ClientFactory) KubeConfig() *KubeConfig

func (*ClientFactory) LegacyClientGetter

func (f *ClientFactory) LegacyClientGetter() *LegacyClientGetter

func (*ClientFactory) Mapper

func (*ClientFactory) Static

func (f *ClientFactory) Static() kubernetes.Interface

type KubeClient

type KubeClient struct {
	// contains filtered or unexported fields
}

func NewKubeClient

func NewKubeClient(staticClient kubernetes.Interface, dynamicClient dynamic.Interface, discoveryClient discovery.CachedDiscoveryInterface, mapper meta.ResettableRESTMapper) *KubeClient

func (*KubeClient) Apply

func (*KubeClient) Create

func (*KubeClient) Delete

func (c *KubeClient) Delete(ctx context.Context, resource *id.ResourceID, opts KubeClientDeleteOptions) error

func (*KubeClient) Get

func (*KubeClient) MergePatch

func (c *KubeClient) MergePatch(ctx context.Context, resource *id.ResourceID, patch []byte) (*unstructured.Unstructured, error)

type KubeClientApplyOptions

type KubeClientApplyOptions struct {
	DryRun bool
}

type KubeClientCreateOptions

type KubeClientCreateOptions struct {
	ForceReplicas *int
}

type KubeClientDeleteOptions

type KubeClientDeleteOptions struct {
	PropagationPolicy *metav1.DeletionPropagation
}

type KubeClientGetOptions

type KubeClientGetOptions struct {
	TryCache bool
}

type KubeConfig

type KubeConfig struct {
	LegacyClientConfig clientcmd.ClientConfig
	Namespace          string
	RawConfig          *api.Config
	RestConfig         *rest.Config
}

func NewKubeConfig

func NewKubeConfig(ctx context.Context, kubeConfigPaths []string, opts KubeConfigOptions) (*KubeConfig, error)

type KubeConfigOptions

type KubeConfigOptions struct {
	AuthInfo              string
	BurstLimit            int
	CertificateAuthority  string
	ClientCertificate     string
	ClientKey             string
	Cluster               string
	CurrentContext        string
	DisableCompression    bool
	Impersonate           string
	ImpersonateGroups     []string
	ImpersonateUID        string
	InsecureSkipTLSVerify bool
	KubeConfigBase64      string
	Namespace             string
	Password              string
	QPSLimit              int
	Server                string
	TLSServerName         string
	Timeout               string
	Token                 string
	Username              string
}

type LegacyClientGetter

type LegacyClientGetter struct {
	// contains filtered or unexported fields
}

func NewLegacyClientGetter

func NewLegacyClientGetter(discoveryClient discovery.CachedDiscoveryInterface, mapper meta.ResettableRESTMapper, restConfig *rest.Config, legacyClientConfig clientcmd.ClientConfig) *LegacyClientGetter

func (*LegacyClientGetter) ToDiscoveryClient

func (g *LegacyClientGetter) ToDiscoveryClient() (discovery.CachedDiscoveryInterface, error)

func (*LegacyClientGetter) ToRESTConfig

func (g *LegacyClientGetter) ToRESTConfig() (*rest.Config, error)

func (*LegacyClientGetter) ToRESTMapper

func (g *LegacyClientGetter) ToRESTMapper() (meta.RESTMapper, error)

func (*LegacyClientGetter) ToRawKubeConfigLoader

func (g *LegacyClientGetter) ToRawKubeConfigLoader() clientcmd.ClientConfig

Jump to

Keyboard shortcuts

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