cloudprovider

package
v1.10.2 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: Apache-2.0, Apache-2.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NodeClassReadinessUnknownReason    = "NodeClassReadinessUnknown"
	InstanceTypeResolutionFailedReason = "InstanceTypeResolutionFailed"
	CreateInstanceFailedReason         = "CreateInstanceFailed"
)
View Source
const (
	NodeClassDrift       cloudprovider.DriftReason = "NodeClassDrift"
	K8sVersionDrift      cloudprovider.DriftReason = "K8sVersionDrift"
	ImageDrift           cloudprovider.DriftReason = "ImageDrift"
	KubeletIdentityDrift cloudprovider.DriftReason = "KubeletIdentityDrift"
	ClusterConfigDrift   cloudprovider.DriftReason = "ClusterConfigDrift" // This is a catch-all for cluster-level config changes (e.g., from PUT ManagedCluster), where Karpenter does not directly "own" them.

	// TODO (charliedmcb): Use this const across code and test locations which are signaling/checking for "no drift"
	NoDrift cloudprovider.DriftReason = ""
)

Variables

This section is empty.

Functions

func GetNodeClaimNameFromVMName added in v1.6.6

func GetNodeClaimNameFromVMName(vmName string) string

Types

type CloudProvider

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

func New

func New(
	instanceTypeProvider instancetype.Provider,
	vmInstanceProvider instance.VMProvider,
	aksMachineInstanceProvider instance.AKSMachineProvider,
	recorder events.Recorder,
	kubeClient client.Client,
	imageProvider imagefamily.NodeImageProvider,
	store *nodeoverlay.InstanceTypeStore,
) *CloudProvider

func (*CloudProvider) Create

func (c *CloudProvider) Create(ctx context.Context, nodeClaim *karpv1.NodeClaim) (*karpv1.NodeClaim, error)

func (*CloudProvider) Delete

func (c *CloudProvider) Delete(ctx context.Context, nodeClaim *karpv1.NodeClaim) error

Delete deletes the underlying node Note: Delete may be called many times while delete is ongoing (blocking) as the core Karpenter termination controller watches and reconciles on all node updates (including node status updates, which happen during deletion), so while one Delete call is blocking more will come in every ~5s due to excess Node events + requeues.

func (*CloudProvider) Get

func (c *CloudProvider) Get(ctx context.Context, providerID string) (*karpv1.NodeClaim, error)

func (*CloudProvider) GetInstanceTypes

func (c *CloudProvider) GetInstanceTypes(ctx context.Context, nodePool *karpv1.NodePool) ([]*cloudprovider.InstanceType, error)

GetInstanceTypes returns all available InstanceTypes May return apimachinery.NotFoundError if NodeClass is not found.

func (*CloudProvider) GetSupportedNodeClasses added in v0.4.0

func (c *CloudProvider) GetSupportedNodeClasses() []status.Object

func (*CloudProvider) IsDrifted

func (c *CloudProvider) IsDrifted(ctx context.Context, nodeClaim *karpv1.NodeClaim) (cloudprovider.DriftReason, error)

IsDrifted checks if the NodeClaim has drifted from our goal state. Note: During the initial launch and registration of a NodeClaim, core calls IsDrifted quite frequently as it waits for the Node to register and become ready. This is because the core pkg/controllers/nodeclaim/disruption/controller.go watches NodeClaims without a generation filter, so any update to the NodeClaim (including updates to status such as when updating conditions during launch) will trigger a call to IsDrifted. The following things produce a large number of IsDrifted calls:

  • The initialization controller pkg/controllers/nodeclaim/lifecycle/initialization.go changes the ConditionTypeInitialized condition a number of times during this process, which triggers disruption/controller.go to call IsDrifted each time.
  • Any pod scheduling that happens during this time will trigger the core disruption/controller.go, because it watches pod updates and maps each pod update to a NodeClaim event. This means every time a pod (including a DaemonSet pod) is scheduled to the node we'll get called.

func (*CloudProvider) List

func (c *CloudProvider) List(ctx context.Context) ([]*karpv1.NodeClaim, error)

func (*CloudProvider) LivenessProbe

func (c *CloudProvider) LivenessProbe(req *http.Request) error

func (*CloudProvider) Name

func (c *CloudProvider) Name() string

Name returns the CloudProvider implementation name.

func (*CloudProvider) RepairPolicies added in v1.4.0

func (c *CloudProvider) RepairPolicies() []cloudprovider.RepairPolicy

TODO: review repair policies

func (*CloudProvider) WaitForInstancePromises added in v1.10.0

func (c *CloudProvider) WaitForInstancePromises()

WaitForInstancePromises blocks until all in-flight async Create goroutines have completed.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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