Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"sort"
"time"

"github.com/aws/aws-sdk-go-v2/service/ec2/types"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/ec2"
"k8s.io/utils/ptr"
)

Expand Down Expand Up @@ -207,14 +207,6 @@ type TargetGroupAttribute string
var (
// TargetGroupAttributeEnablePreserveClientIP defines the attribute key for enabling preserve client IP.
TargetGroupAttributeEnablePreserveClientIP = "preserve_client_ip.enabled"

// TargetGroupAttributeEnableConnectionTermination defines the attribute key for terminating
// established connections to unhealthy targets.
TargetGroupAttributeEnableConnectionTermination = "target_health_state.unhealthy.connection_termination.enabled"

// TargetGroupAttributeUnhealthyDrainingIntervalSeconds defines the attribute key for the
// unhealthy target connection draining interval.
TargetGroupAttributeUnhealthyDrainingIntervalSeconds = "target_health_state.unhealthy.draining_interval_seconds"
)

// LoadBalancerAttribute defines a set of attributes for a V2 load balancer.
Expand Down Expand Up @@ -667,11 +659,11 @@ func (s *SubnetSpec) IsEdgeWavelength() bool {
}

// SetZoneInfo updates the subnets with zone information.
func (s *SubnetSpec) SetZoneInfo(zones []types.AvailabilityZone) error {
zoneInfo := func(zoneName string) *types.AvailabilityZone {
func (s *SubnetSpec) SetZoneInfo(zones []*ec2.AvailabilityZone) error {
zoneInfo := func(zoneName string) *ec2.AvailabilityZone {
for _, zone := range zones {
if aws.StringValue(zone.ZoneName) == zoneName {
return &zone
return zone
}
}
return nil
Expand Down Expand Up @@ -826,7 +818,7 @@ func (s Subnets) GetUniqueZones() []string {
}

// SetZoneInfo updates the subnets with zone information.
func (s Subnets) SetZoneInfo(zones []types.AvailabilityZone) error {
func (s Subnets) SetZoneInfo(zones []*ec2.AvailabilityZone) error {
for i := range s {
if err := s[i].SetZoneInfo(zones); err != nil {
return err
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,20 @@ import (
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
)

// NodeType specifies the type of nodeq
// +kubebuilder:validation:Enum=al2023
type NodeType string

const (
// NodeTypeAL2023 represents the AL2023 node type.
NodeTypeAL2023 NodeType = "al2023"
)

// EKSConfigSpec defines the desired state of Amazon EKS Bootstrap Configuration.
type EKSConfigSpec struct {
// NodeType specifies the type of node (e.g., "al2023")
// +optional
NodeType NodeType `json:"nodeType,omitempty"`
// KubeletExtraArgs passes the specified kubelet args into the Amazon EKS machine bootstrap script
// +optional
KubeletExtraArgs map[string]string `json:"kubeletExtraArgs,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion api/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ replace github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/c

require (
github.com/aws/aws-sdk-go v1.55.8
github.com/aws/aws-sdk-go-v2/service/ec2 v1.240.0
github.com/aws/aws-sdk-go-v2/service/eks v1.69.0
github.com/blang/semver/v4 v4.0.0
github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common v0.7.0
Expand Down Expand Up @@ -47,6 +46,7 @@ require (
github.com/google/go-cmp v0.7.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
Expand Down
7 changes: 5 additions & 2 deletions api/go.sum
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
github.com/aws/aws-sdk-go v1.55.8 h1:JRmEUbU52aJQZ2AjX4q4Wu7t4uZjOu71uyNmaWlUkJQ=
github.com/aws/aws-sdk-go v1.55.8/go.mod h1:ZkViS9AqA6otK+JBBNH2++sx1sgxrPKcSzPPvQkUtXk=
github.com/aws/aws-sdk-go-v2/service/ec2 v1.240.0 h1:/NUzag+6BGBNvM7FEHDsDK8itSgWEUVhmC2HDBR8NrM=
github.com/aws/aws-sdk-go-v2/service/ec2 v1.240.0/go.mod h1:HDxGArx3/bUnkoFsuvTNIxEj/cR3f+IgsVh1B7Pvay8=
github.com/aws/aws-sdk-go-v2/service/eks v1.69.0 h1:eiZOCsKGl0D7M3FSeSJwJbsikxowCMVz513WDFCe6HY=
github.com/aws/aws-sdk-go-v2/service/eks v1.69.0/go.mod h1:u3CDoNUAkSIGKNiA6LfQtApPmHPGRuAjikx3ObM5XBs=
github.com/aws/smithy-go v1.22.5 h1:P9ATCXPMb2mPjYBgueqJNCA5S9UfktsW0tTxi+a7eqw=
Expand Down Expand Up @@ -62,6 +60,8 @@ github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
Expand Down Expand Up @@ -184,6 +184,9 @@ gopkg.in/evanphx/json-patch.v4 v4.12.0 h1:n6jtcsulIzXPJaxegRbvFNNrZDjbij7ny3gmSP
gopkg.in/evanphx/json-patch.v4 v4.12.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M=
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
k8s.io/api v0.32.8 h1:PhuKPnqsaXYuwmLXRLAmdDJ9EZ2R2kEbOZTq4UE3lGc=
Expand Down
8 changes: 8 additions & 0 deletions api/v1alpha1/crds/caren.nutanix.com_eksworkernodeconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,14 @@ spec:
default: m5.2xlarge
description: The AWS instance type to use for the cluster Machines.
type: string
nodeType:
description: |-
nodeType specifies the node type to use for the node. This affects the bootstrap format created
for the node. If `nodeType` is specified as `al2023`, the bootstrap format will be `nodeadm`, otherwise
the format will be `cloud-init`.
enum:
- al2023
type: string
placementGroup:
description: PlacementGroup specifies the placement group in which
to launch the instance.
Expand Down
17 changes: 14 additions & 3 deletions api/v1alpha1/nodeconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,23 @@ func (s EKSWorkerNodeConfig) VariableSchema() clusterv1.VariableSchema { //nolin
// Otherwise, it should go into the ClusterConfigSpec.
type EKSWorkerNodeConfigSpec struct {
// +kubebuilder:validation:Optional
EKS *AWSWorkerNodeSpec `json:"eks,omitempty"`
EKS *EKSWorkerNodeSpec `json:"eks,omitempty"`

EKSNodeSpec `json:",inline"`
EKSGenericNodeSpec `json:",inline"`
}

type EKSNodeSpec struct {
type EKSWorkerNodeSpec struct {
AWSWorkerNodeSpec `json:",inline"`

// nodeType specifies the node type to use for the node. This affects the bootstrap format created
// for the node. If `nodeType` is specified as `al2023`, the bootstrap format will be `nodeadm`, otherwise
// the format will be `cloud-init`.
// +kubebuilder:validation:Optional
// +kubebuilder:validation:Enum:=al2023
NodeType string `json:"nodeType,omitempty"`
}

type EKSGenericNodeSpec struct {
// Taints specifies the taints the Node API object should be registered with.
// +kubebuilder:validation:Optional
Taints []Taint `json:"taints,omitempty"`
Expand Down
28 changes: 22 additions & 6 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/variables/aggregate_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ type WorkerNodeConfigSpec struct {

Nutanix *carenv1.NutanixWorkerNodeSpec `json:"nutanix,omitempty"`

EKS *carenv1.AWSWorkerNodeSpec `json:"eks,omitempty"`
EKS *carenv1.EKSWorkerNodeSpec `json:"eks,omitempty"`

carenv1.GenericNodeSpec `json:",inline"`
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ metadata:
spec:
template:
spec:
instanceMetadataOptions:
httpPutResponseHopLimit: 2
httpTokens: required
instanceType: PLACEHOLDER
sshKeyName: ""
---
Expand Down
Loading
Loading