kube

package
v1.14.1 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 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"
)
View Source
var (
	AddToScheme sync.Once
)

Functions

func IsImmutableErr added in v1.13.0

func IsImmutableErr(err error) bool

func IsNoSuchKindErr added in v1.13.0

func IsNoSuchKindErr(err error) bool

func IsNotFoundErr added in v1.13.0

func IsNotFoundErr(err error) bool

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

type ClientFactorier interface {
	KubeClient() KubeClienter
	Static() kubernetes.Interface
	Dynamic() dynamic.Interface
	Discovery() discovery.CachedDiscoveryInterface
	Mapper() meta.ResettableRESTMapper
	LegacyClientGetter() *LegacyClientGetter
	KubeConfig() *KubeConfig
}

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 apimeta.ResettableRESTMapper) *KubeClient

func (*KubeClient) Apply

func (*KubeClient) Create

func (*KubeClient) Delete

func (c *KubeClient) Delete(ctx context.Context, resMeta *spec.ResourceMeta, opts KubeClientDeleteOptions) error

func (*KubeClient) Get

func (*KubeClient) MergePatch

type KubeClientApplyOptions

type KubeClientApplyOptions struct {
	DefaultNamespace string
	DryRun           bool
}

type KubeClientCreateOptions

type KubeClientCreateOptions struct {
	DefaultNamespace string
	ForceReplicas    *int
}

type KubeClientDeleteOptions

type KubeClientDeleteOptions struct {
	DefaultNamespace  string
	PropagationPolicy *metav1.DeletionPropagation
}

type KubeClientGetOptions

type KubeClientGetOptions struct {
	DefaultNamespace string
	TryCache         bool
}

type KubeClientMergePatchOptions added in v1.13.0

type KubeClientMergePatchOptions struct {
	DefaultNamespace string
}

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

TODO(v2): get rid

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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