Skip to content

Error with adopting Capacity Reservation resources #2485

@fizashaikh

Description

@fizashaikh

Describe the bug
Adopting Resources functionality fails while adopting CapacityReservation resources.

Steps to reproduce
Apply following yaml to adopt an existing capacity reservation in AWS.

apiVersion: services.k8s.aws/v1alpha1
kind: AdoptedResource
metadata:
  name: test-adopt-existing-capacity # name of the adopted resource
spec: 
  aws:
    nameOrID: cr-XXXXXXXX # ID of the actual capacity reservation in AWS
    additionalKeys:
      instanceCount: "1"  # replace with the actual instance count from your CR
      availabilityZone: "us-west-2a"  # replace with your actual AZ
      instancePlatform: "Linux/UNIX"  # match the actual platform
      instanceType: "t2.nano"        # match the actual instance type
  kubernetes:
    group: ec2.services.k8s.aws
    kind: CapacityReservation
    metadata:
      name: test-adopt-capacity # name of the K8s capacity reservation resource created by ack-ec2-controller
      namespace: default

Expected outcome
Resource should be adopted successfully

Got outcome
Got the following error,

'CapacityReservation.ec2.services.k8s.aws "test-adopt-capacity" is invalid:
      spec.instanceCount: Required value'

Environment

  • Kubernetes version: v1.31.6
  • Using EKS (yes/no), if so version? No
  • AWS service targeted: EC2

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions