Documentation
¶
Index ¶
- Constants
- Variables
- func ArchToAMILabelKey(arch string) string
- func GetHCP(ctx context.Context, c client.Client, namespace string) (*hyperv1.HostedControlPlane, error)
- func IsKarpenterEnabled(autoNode hyperv1.AutoNode) bool
- func KarpenterBaseTaintMap() map[string]interface{}
- func KarpenterNodeClassKubeletConfigName(nodeClassName string) string
- func KarpenterNodePoolName(oec2nc *hyperkarpenterv1.OpenshiftEC2NodeClass) string
- func KarpenterTaintConfigManifest() (string, error)
- func SupportedArchitectures(platform hyperv1.PlatformType) ([]string, error)
Constants ¶
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" // KarpenterNodeClassKubeletConfigLabel is a label set on per-OpenshiftEC2NodeClass KubeletConfig ConfigMaps // in the HCP namespace so they can be discovered. KarpenterNodeClassKubeletConfigLabel = "hypershift.openshift.io/karpenter-nodeclass-kubelet-config" )
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 ¶
var ErrHCPNotFound = errors.New("hostedcontrolplane not found")
ErrHCPNotFound is returned when no HostedControlPlane is found in the namespace.
var KarpenterBaseTaints = []corev1.Taint{ { Key: "karpenter.sh/unregistered", Value: "true", Effect: corev1.TaintEffectNoExecute, }, }
KarpenterBaseTaints is the set of taints applied to nodes registered by Karpenter.
Functions ¶
func ArchToAMILabelKey ¶ added in v0.1.75
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 ¶
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 KarpenterBaseTaintMap ¶ added in v0.1.76
func KarpenterBaseTaintMap() map[string]interface{}
KarpenterBaseTaintMap returns the registerWithTaints kubelet config map built from KarpenterTaints. It is used by reconcileKubeletConfigMap to merge our taints into the user-provided kubelet config.
func KarpenterNodeClassKubeletConfigName ¶ added in v0.1.76
KarpenterNodeClassKubeletConfigName returns the name of the ConfigMap containing the per-OpenshiftEC2NodeClass KubeletConfig in the HCP namespace.
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 KarpenterTaintConfigManifest ¶ added in v0.1.76
KarpenterTaintConfigManifest returns the KubeletConfig CR YAML for the set-karpenter-taint ConfigMap.
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.