clientset

package
v1.23.32 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GkeMetaDataServerKey              = "iam.gke.io/gke-metadata-server-enabled"
	MachineTypeKey                    = "node.kubernetes.io/instance-type"
	GkeAppliedNodeLabelsAnnotationKey = "node.gke.io/last-applied-node-labels"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Clientset

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

func (*Clientset) ConfigureNodeLister added in v1.14.0

func (c *Clientset) ConfigureNodeLister(ctx context.Context, nodeName string)

func (*Clientset) ConfigurePVCLister added in v1.22.3

func (c *Clientset) ConfigurePVCLister(ctx context.Context)

func (*Clientset) ConfigurePVLister added in v1.20.0

func (c *Clientset) ConfigurePVLister(ctx context.Context)

func (*Clientset) ConfigurePodLister added in v1.5.0

func (c *Clientset) ConfigurePodLister(ctx context.Context, nodeName string)

func (*Clientset) ConfigureSCLister added in v1.20.0

func (c *Clientset) ConfigureSCLister(ctx context.Context)

func (*Clientset) CreateServiceAccountToken

func (c *Clientset) CreateServiceAccountToken(ctx context.Context, namespace, name string, tokenRequest *authenticationv1.TokenRequest) (*authenticationv1.TokenRequest, error)

func (*Clientset) GetGCPServiceAccountName

func (c *Clientset) GetGCPServiceAccountName(ctx context.Context, namespace, name string) (string, error)

func (*Clientset) GetNode added in v1.14.0

func (c *Clientset) GetNode(name string) (*corev1.Node, error)

func (*Clientset) GetPV added in v1.20.0

func (c *Clientset) GetPV(name string) (*corev1.PersistentVolume, error)

GetPV retrieves a PersistentVolume from the informer cache by name. IMPORTANT: In the Node driver, the PV informer cache is intentionally filtered down to ONLY track PVs that utilize the GCS Fuse profiles feature (via the gke-gcsfuse/profile-managed label) to minimize the memory footprint in large-scale clusters. Do not attempt to use this function from the Node driver to look up generic PVs or non-profile GCS Fuse PVs, as they are explicitly prevented from entering the Node's cache.

func (*Clientset) GetPVC added in v1.22.3

func (c *Clientset) GetPVC(namespace, name string) (*corev1.PersistentVolumeClaim, error)

func (*Clientset) GetPod

func (c *Clientset) GetPod(namespace, name string) (*corev1.Pod, error)

func (*Clientset) GetSC added in v1.20.0

func (c *Clientset) GetSC(name string) (*storagev1.StorageClass, error)

func (*Clientset) K8sClient added in v1.22.0

func (c *Clientset) K8sClient() kubernetes.Interface

type FakeClientset

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

func NewFakeClientset added in v1.14.0

func NewFakeClientset() *FakeClientset

func (*FakeClientset) AddPodVolumes added in v1.22.3

func (c *FakeClientset) AddPodVolumes(volumes []corev1.Volume)

func (*FakeClientset) ConfigureNodeLister added in v1.14.0

func (c *FakeClientset) ConfigureNodeLister(_ context.Context, _ string)

func (*FakeClientset) ConfigurePVCLister added in v1.22.3

func (c *FakeClientset) ConfigurePVCLister(_ context.Context)

func (*FakeClientset) ConfigurePVLister added in v1.20.0

func (c *FakeClientset) ConfigurePVLister(_ context.Context)

func (*FakeClientset) ConfigurePodLister added in v1.5.0

func (c *FakeClientset) ConfigurePodLister(_ context.Context, _ string)

func (*FakeClientset) ConfigureSCLister added in v1.20.0

func (c *FakeClientset) ConfigureSCLister(_ context.Context)

func (*FakeClientset) CreateNode added in v1.14.0

func (c *FakeClientset) CreateNode(nodeConfig FakeNodeConfig)

func (*FakeClientset) CreatePV added in v1.20.0

func (c *FakeClientset) CreatePV(pvConfig FakePVConfig)

func (*FakeClientset) CreatePVC added in v1.22.3

func (c *FakeClientset) CreatePVC(pvcConfig FakePVCConfig)

func (*FakeClientset) CreatePod added in v1.14.0

func (c *FakeClientset) CreatePod(podConfig FakePodConfig)

func (*FakeClientset) CreateSC added in v1.20.0

func (c *FakeClientset) CreateSC(scConfig FakeSCConfig)

func (*FakeClientset) CreateServiceAccountToken

func (c *FakeClientset) CreateServiceAccountToken(_ context.Context, _, _ string, _ *authenticationv1.TokenRequest) (*authenticationv1.TokenRequest, error)

func (*FakeClientset) GetGCPServiceAccountName

func (c *FakeClientset) GetGCPServiceAccountName(_ context.Context, _, _ string) (string, error)

func (*FakeClientset) GetNode added in v1.14.0

func (c *FakeClientset) GetNode(name string) (*corev1.Node, error)

func (*FakeClientset) GetPV added in v1.20.0

func (c *FakeClientset) GetPV(name string) (*corev1.PersistentVolume, error)

func (*FakeClientset) GetPVC added in v1.22.3

func (c *FakeClientset) GetPVC(namespace, name string) (*corev1.PersistentVolumeClaim, error)

func (*FakeClientset) GetPod

func (c *FakeClientset) GetPod(namespace, name string) (*corev1.Pod, error)

func (*FakeClientset) GetSC added in v1.20.0

func (c *FakeClientset) GetSC(name string) (*storagev1.StorageClass, error)

func (*FakeClientset) K8sClient added in v1.22.0

func (c *FakeClientset) K8sClient() kubernetes.Interface

type FakeNodeConfig added in v1.15.0

type FakeNodeConfig struct {
	IsWorkloadIdentityEnabled bool
	MachineType               string
	Status                    corev1.NodeStatus
}

type FakePVCConfig added in v1.22.3

type FakePVCConfig struct {
	Name       string
	VolumeName string
	Namespace  string
}

type FakePVConfig added in v1.20.0

type FakePVConfig struct {
	Annotations map[string]string
	SCName      string
	DriverName  string
	Name        string
}

type FakePodConfig added in v1.20.0

type FakePodConfig struct {
	HostNetworkEnabled bool
	SidecarLimits      corev1.ResourceList
}

type FakeSCConfig added in v1.20.0

type FakeSCConfig struct {
	Labels       map[string]string
	Parameters   map[string]string
	MountOptions []string
}

type Interface

type Interface interface {
	K8sClient() kubernetes.Interface
	ConfigurePodLister(ctx context.Context, nodeName string)
	ConfigureNodeLister(ctx context.Context, nodeName string)
	ConfigurePVLister(ctx context.Context)
	ConfigurePVCLister(ctx context.Context)
	ConfigureSCLister(ctx context.Context)
	GetPod(namespace, name string) (*corev1.Pod, error)
	GetNode(name string) (*corev1.Node, error)
	GetPV(name string) (*corev1.PersistentVolume, error)
	GetPVC(namespace string, name string) (*corev1.PersistentVolumeClaim, error)
	GetSC(name string) (*storagev1.StorageClass, error)
	CreateServiceAccountToken(ctx context.Context, namespace, name string, tokenRequest *authenticationv1.TokenRequest) (*authenticationv1.TokenRequest, error)
	GetGCPServiceAccountName(ctx context.Context, namespace, name string) (string, error)
}

func New

func New(kubeconfigPath string, informerResyncDurationSec int, runController bool) (Interface, error)

type PodInfo added in v0.1.14

type PodInfo struct {
	Name      string
	Namespace string
}

Jump to

Keyboard shortcuts

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