Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HOSTEDCP-2220: Autonode karpenter #5279

Merged
merged 6 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add AutoNode Karpenter feature gated API support
  • Loading branch information
enxebre committed Dec 17, 2024
commit 258e97473ea0e3f9a9562b1a7415d9a25b2bf557
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
"featureGates": [
{
"disabled": [
{
"name": "AutoNodeKarpenter",
},
{
"name": "AROHCPManagedIdentities"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
{
"disabled": [],
"enabled": [
{
"name": "AutoNodeKarpenter",
},
{
"name": "AROHCPManagedIdentities"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
"featureGates": [
{
"disabled": [
{
"name": "AutoNodeKarpenter",
},
{
"name": "AROHCPManagedIdentities"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
{
"disabled": [],
"enabled": [
{
"name": "AutoNodeKarpenter",
},
{
"name": "AROHCPManagedIdentities"
},
Expand Down
4 changes: 4 additions & 0 deletions api/hypershift/v1beta1/hosted_controlplane.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@ type HostedControlPlaneSpec struct {
// +optional
Autoscaling ClusterAutoscaling `json:"autoscaling,omitempty"`

// autoNode specifies the configuration for the autoNode feature.
// +openshift:enable:FeatureGate=AutoNodeKarpenter
AutoNode *AutoNode `json:"autoNode,omitempty"`

// NodeSelector when specified, must be true for the pods managed by the HostedCluster to be scheduled.
//
// +optional
Expand Down
45 changes: 45 additions & 0 deletions api/hypershift/v1beta1/hostedcluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,10 @@ type HostedClusterSpec struct {
// +optional
Autoscaling ClusterAutoscaling `json:"autoscaling,omitempty"`

// autoNode specifies the configuration for the autoNode feature.
// +openshift:enable:FeatureGate=AutoNodeKarpenter
AutoNode *AutoNode `json:"autoNode,omitempty"`

// etcd specifies configuration for the control plane etcd cluster. The
// default managementType is Managed. Once set, the managementType cannot be
// changed.
Expand Down Expand Up @@ -1096,6 +1100,47 @@ type Release struct {
Image string `json:"image"`
}

// We expose here internal configuration knobs that won't be exposed to the service.
type AutoNode struct {
// provisioner is the implementation used for Node auto provisioning.
// +required
Provisioner *ProvisionerConfig `json:"provisionerConfig"`
}

// ProvisionerConfig is a enum specifying the strategy for auto managing Nodes.
type ProvisionerConfig struct {
// name specifies the name of the provisioner to use.
// +required
// +kubebuilder:validation:Enum=Karpenter
Name Provisioner `json:"name"`
// karpenter specifies the configuration for the Karpenter provisioner.
// +optional
Karpenter *KarpenterConfig `json:"karpenter,omitempty"`
}

type KarpenterConfig struct {
// platform specifies the platform-specific configuration for Karpenter.
// +required
Platform PlatformType `json:"platform"`
// aws specifies the AWS-specific configuration for Karpenter.
// +optional
AWS *KarpenterAWSConfig `json:"aws,omitempty"`
}

type KarpenterAWSConfig struct {
//arn specifies the ARN of the Karpenter provisioner.
// +required
RoleARN string `json:"roleARN"`
}

const (
ProvisionerKarpeneter Provisioner = "Karpenter"
)

// provisioner is a enum specifying the strategy for auto managing Nodes.
// +kubebuilder:validation:Enum=Karpenter
type Provisioner string

// ClusterAutoscaling specifies auto-scaling behavior that applies to all
// NodePools associated with a control plane.
type ClusterAutoscaling struct {
Expand Down