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

I made changes only to NodePool, but NodeClass has changed as well #7470

Open
EigoOda opened this issue Dec 2, 2024 · 3 comments
Open

I made changes only to NodePool, but NodeClass has changed as well #7470

EigoOda opened this issue Dec 2, 2024 · 3 comments
Labels
bug Something isn't working lifecycle/stale triage/needs-information Marks that the issue still needs more information to properly triage

Comments

@EigoOda
Copy link
Contributor

EigoOda commented Dec 2, 2024

Description

Observed Behavior:

When I changed only the NodePool setting and applied, the NodeClass setting was also changed.
The only place to change is in NodePool resource value of key: “karpenter.k8s.aws/instance-cpu”.

The only unexpected change is the value of .spec.metadataOptions.httpPutResponseHopLimit in NodeClass, which is changed from 2 to 1.

The httpPutResponseHopLimit was not defined in Yaml, but used the default. (I intentionally set it to 2 now because of this issue)
As I assume, we upgraded from v0.37 to v1 about a month ago.
At that time, I did not take any action because the httpPutResponseHopLimit did not change to 1, which is the v1 default, without changing httpPutResponseHopLimit to 2.

Is it possible that this has now been changed to the default of 1?

before

apiVersion: karpenter.sh/v1
kind: NodePool
metadata:
  name: nodepool
spec:
  template:
    spec:
      requirements:
        - key: "karpenter.k8s.aws/instance-family"
          operator: In
          values: ["m6i"]
        - key: kubernetes.io/os
          operator: In
          values: ["linux"]
        - key: "karpenter.k8s.aws/instance-cpu"
          operator: In
          values: ["16", "32", "48"]
        - key: "kubernetes.io/arch"
          operator: In
          values: ["amd64"]
        - key: "karpenter.sh/capacity-type"
          operator: In
          values: ["on-demand"]
      nodeClassRef:
        group: karpenter.k8s.aws
        kind: EC2NodeClass
        name: nodeclass
      expireAfter: 720h # 30days
  disruption:
    consolidationPolicy: WhenEmptyOrUnderutilized
    budgets:
      - nodes: 25
---
apiVersion: karpenter.k8s.aws/v1
kind: EC2NodeClass
metadata:
  name: nodeclass
spec:
  amiFamily: AL2023
  amiSelectorTerms:
    - name: amazon-eks-node-al2023-x86_64-standard-1.29-v20241024
  subnetSelectorTerms:
    - tags:
        karpenter.sh/discovery: "dev"
  securityGroupSelectorTerms:
    - tags:
        karpenter.sh/discovery: "dev"
  role: "noderole"
  blockDeviceMappings:
    - deviceName: /dev/xvda
      ebs:
        volumeSize: 60Gi
        volumeType: gp3
        encrypted: true
        deleteOnTermination: true
        throughput: 125
  tags:
    CostEnv: dev
    CostService: service
    CostTeam: team
  userData: |
    #!/bin/bash
    modprobe iptable_nat
    modprobe ip6table_nat
    dnf -y install rsyslog
    systemctl enable --now rsyslog

after

apiVersion: karpenter.sh/v1
kind: NodePool
metadata:
  name: nodepool
spec:
  template:
    spec:
      requirements:
        - key: "karpenter.k8s.aws/instance-family"
          operator: In
          values: ["m6i"]
        - key: kubernetes.io/os
          operator: In
          values: ["linux"]
        - key: "karpenter.k8s.aws/instance-cpu"
          operator: In
          values: ["4", "8", "16", "32", "48"] <-- here
        - key: "kubernetes.io/arch"
          operator: In
          values: ["amd64"]
        - key: "karpenter.sh/capacity-type"
          operator: In
          values: ["on-demand"]
      nodeClassRef:
        group: karpenter.k8s.aws
        kind: EC2NodeClass
        name: nodeclass
      expireAfter: 720h # 30days
  disruption:
    consolidationPolicy: WhenEmptyOrUnderutilized
    budgets:
      - nodes: 25

Expected Behavior:

  • Change only where expected.

Reproduction Steps (Please include YAML):

  • Checking

Versions:

  • Chart Version: 1.0.6(oci://public.ecr.aws/karpenter/karpenter)
  • Kubernetes Version (kubectl version): v1.29.10-eks-7f9249a
  • 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
@EigoOda EigoOda added bug Something isn't working needs-triage Issues that need to be triaged labels Dec 2, 2024
@jmdeal
Copy link
Contributor

jmdeal commented Dec 2, 2024

Was this the first time you had reapplied the EC2NodeClass since upgrading to v1? This is expected behavior for defaulted fields - if the field hasn't been specified and you apply the manifest, the default will be used.

@jmdeal jmdeal added triage/needs-information Marks that the issue still needs more information to properly triage and removed needs-triage Issues that need to be triaged labels Dec 2, 2024
@EigoOda
Copy link
Contributor Author

EigoOda commented Dec 5, 2024

@jmdeal
Thank you replied, I understood.
If I apply an EC2NodeClass that has not been modified, does it behave that way?

Copy link
Contributor

This issue has been inactive for 14 days. StaleBot will close this stale issue after 14 more days of inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lifecycle/stale triage/needs-information Marks that the issue still needs more information to properly triage
Projects
None yet
Development

No branches or pull requests

2 participants