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

bug: Karpenter 1.0 fails to install using Bottlerocket AMI Family #249

Closed
JoeNorth opened this issue Sep 9, 2024 · 0 comments
Closed

bug: Karpenter 1.0 fails to install using Bottlerocket AMI Family #249

JoeNorth opened this issue Sep 9, 2024 · 0 comments

Comments

@JoeNorth
Copy link
Contributor

JoeNorth commented Sep 9, 2024

When trying to install karpenter using BR I found that no default nodeclass was created and the following error was shown:

$ eksdemo install karpenter --replicas 2 -a Bottlerocket -c main-lab
Creating EC2NodeClass "default"
Warning: failed to create resource: EC2NodeClass.karpenter.k8s.aws "default" is invalid: [spec.amiSelectorTerms: Required value, <nil>: Invalid value: "null": some validation rules were not checked because the object was invalid; correct the existing errors to complete validation]

Adding the --dry-run flag shows that the spec.amiSelectorTerms was not specified but this is now required for Karpenter 1.0:

$ eksdemo install karpenter --replicas 2 -a Bottlerocket -c main-lab --dry-run
---
apiVersion: karpenter.k8s.aws/v1
kind: EC2NodeClass
metadata:
  name: default
spec:
  amiFamily: Bottlerocket
  role: KarpenterNodeRole-main-lab
  subnetSelectorTerms:
    - tags:
        Name: eksctl-main-lab-cluster/SubnetPrivate*
  securityGroupSelectorTerms:
    - tags:
        aws:eks:cluster-name: main-lab
  tags:
    eksdemo.io/version: 0.16.0

Doing the same with the AL2 amiFamily shows the following:

$ eksdemo install karpenter --replicas 2 -a AL2 -c main-lab --dry-run
apiVersion: karpenter.k8s.aws/v1
kind: EC2NodeClass
metadata:
  name: default
spec:
  amiFamily: AL2
  role: KarpenterNodeRole-main-lab
  subnetSelectorTerms:
    - tags:
        Name: eksctl-main-lab-cluster/SubnetPrivate*
  securityGroupSelectorTerms:
    - tags:
        aws:eks:cluster-name: main-lab
  tags:
    eksdemo.io/version: 0.16.0
  amiSelectorTerms:
    - id: ami-03413b57906e5c8b2
    - id: ami-0164d2524bf3468bf

Based on the docs[1], it looks like the logic should be updated to use spec.amiSelectorTerms.alias and fetch the version using the appropriate SSM parameter rather than trying to resolve the current AMI IDs.

$ eksdemo version
eksdemo: version.Info{Version:"0.16.0", Date:"2024-08-19T17:41:55Z", Commit:"74fc767"}

[1] - https://karpenter.sh/docs/concepts/nodeclasses/#specamiselectorterms

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant