karpenter

package
v0.1.75 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// KarpenterFinalizer is the finalizer added to HostedControlPlane resources by the karpenter-operator.
	// This allows time for Karpenter to delete all NodePools and NodeClaims before the HostedControlPlane is deleted.
	KarpenterFinalizer = "hypershift.openshift.io/karpenter-finalizer"

	// ManagedByKarpenterLabel is a label set on the userData secrets as being managed by Karpenter Operator
	ManagedByKarpenterLabel = "hypershift.openshift.io/managed-by-karpenter"
)
View Source
const (
	// KarpenterTaintConfigMapName is the name of the configmap containing the karpenter taint config
	KarpenterTaintConfigMapName = "set-karpenter-taint"
	// KarpenterSubnetsConfigMapName is the name of the configmap containing the aggregated subnet IDs
	// from all user-defined OpenshiftEC2NodeClass resources.
	KarpenterSubnetsConfigMapName = "karpenter-subnets"
)

Variables

View Source
var ErrHCPNotFound = errors.New("hostedcontrolplane not found")

ErrHCPNotFound is returned when no HostedControlPlane is found in the namespace.

Functions

func ArchToAMILabelKey added in v0.1.75

func ArchToAMILabelKey(arch string) string

ArchToAMILabelKey returns a label key to store the AMI ID for the given architecture. The label is set on Karpenter userData secrets in order to eventually propagate to EC2NodeClass.AMISelectorTerms.

func GetHCP added in v0.1.74

func GetHCP(ctx context.Context, c client.Client, namespace string) (*hyperv1.HostedControlPlane, error)

GetHCP retrieves the HostedControlPlane from the given namespace. Returns ErrHCPNotFound if no HCP exists in the namespace.

func IsKarpenterEnabled

func IsKarpenterEnabled(autoNode *hyperv1.AutoNode) bool

IsKarpenterEnabled checks if Karpenter is enabled for the given AutoNode configuration. Note that we may eventually support other platforms, but for now we only support AWS.

func KarpenterNodePoolName added in v0.1.74

func KarpenterNodePoolName(oec2nc *hyperkarpenterv1.OpenshiftEC2NodeClass) string

KarpenterNodePoolName returns the name of the Karpenter NodePool for a given OpenshiftEC2NodeClass

func SupportedArchitectures added in v0.1.75

func SupportedArchitectures(platform hyperv1.PlatformType) ([]string, error)

SupportedArchitectures returns the list of supported architectures for Karpenter on the given platform.

Types

This section is empty.

Jump to

Keyboard shortcuts

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