Skip to content

Add log info when EC2NodeClass contains a Bottlerocket attribute which is not supported by Karpenter #8738

@youwalther65

Description

@youwalther65

Description

What problem are you trying to solve?

Karpenter supports only a subset of available K8s related Bottlerocket API attributes using a struct BottlerocketKubernetes as defined in pkg/providers/amifamily/bootstrap/bottlerocketsettings.go.

Currently if the EC2NodeClass contains an attribute in Bottlerocket userData which is not supported it will be silently ignored without any log info in Karpenter logs, see Karpenter docs here.

Example:
Bottlerocket supports settings.kubernetes.cpu-manager-policy and settings.kubernetes.cpu-manager-policy-options but using it in a EC2NodeClass, attribute cpu-manager-policy-options will be silently ignored, just check control container with apiclient get settings.kubernetes:

apiVersion: karpenter.k8s.aws/v1
kind: EC2NodeClass
...
spec:
  amiFamily: Bottlerocket
...
  userData: |
    [settings.kubernetes]
    cpu-manager-policy = ["static"]
    cpu-manager-policy-options = ["full-pcpus-only"]
...

Karpenter uses the go-toml v2 which supports a strict mode to throw a toml.StrictMissingError error.
I developed a small sample Go program in Go Playground here to show a possible implementation.

A stricter approach would not just log the issue, but rather lead to a failed EC2NodeClass validation by returning type: ValidationSucceeded with status: "False".

Note: Karpenter team is open and supports Pull Requests to enhance the Karpenter BottlerocketKubernetes struct, see example PR Enabled pass-through of kubelet log level for debugging purposes #8635.

How important is this feature to you?
This is misleading to users thinking that Karpenter supports all possible Bottlerocket API values.

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or requesttriage/needs-informationMarks that the issue still needs more information to properly triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions