eksctl-io / eksctl

The official CLI for Amazon EKS
https://eksctl.io
Other
4.92k stars 1.41k forks source link

[Bug] Creation of managed node groups failed: alpha.eksctl.io/nodegroup-type is not a valid tag key #7948

Open Ankitwasnik opened 2 months ago

Ankitwasnik commented 2 months ago

What were you trying to accomplish?

I was trying to create a cluster using a config file. See the config file below.

What happened?

Cluster got created but creation of managed node groups failed. I see the following error message in cloudformation. Resource handler returned message: "'alpha.eksctl.io/nodegroup-type' is not a valid tag key. Tag keys must match pattern ([0-9a-zA-Z\\-_+=,.@:]{1,255}), and must not be a reserved name ('.', '..', '_index') (Service: Eks, Status Code: 400, Request ID: 'some id')" (RequestToken: 'some id', HandlerErrorCode: InvalidRequest)

How to reproduce it?

Copy the following config to a file. Run the command eksctl create cluster -f config.yaml. See the cloudformation logs.

apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
  name: mycluster-1
  region: us-west-2
  version: "1.30"

kubernetesNetworkConfig:
  ipFamily: IPv4

managedNodeGroups:
  - name: ng-1
    instanceType: t3.medium
    desiredCapacity: 3
    minSize: 2
    maxSize: 3
    volumeSize: 80
    volumeEncrypted: true
    volumeKmsKeyID: '' 
    volumeType: 'gp3'
    ssh:
      publicKeyPath: ~/workspace/key.pub
availabilityZones: ["us-west-2a", "us-west-2b",  "us-west-2c"]
iam:
  withOIDC: true
  serviceAccounts:
    - metadata:
        name: ebs-csi-controller-sa
        namespace: kube-system
      wellKnownPolicies:
        ebsCSIController: true

addons:
  - name: vpc-cni
    attachPolicyARNs:
      - arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy
  - name: coredns
    version: latest
  - name: kube-proxy
    version: latest
  - name: aws-ebs-csi-driver
    wellKnownPolicies:
      ebsCSIController: true

Logs

https://gist.github.com/Ankitwasnik/eb56f9bedab1d223ec6b601908d17fc4 Anything else we need to know?

What OS are you using? Ubuntu 22.04.4 LTS Are you using a downloaded binary or did you compile eksctl? Downloaded binary What type of AWS credentials are you using (i.e. default/named profile, MFA)? - Named profile

Versions

eksctl version: 0.189.0
kubectl version: v1.30.0
OS: linux
github-actions[bot] commented 2 months ago

Hello Ankitwasnik :wave: Thank you for opening an issue in eksctl project. The team will review the issue and aim to respond within 1-5 business days. Meanwhile, please read about the Contribution and Code of Conduct guidelines here. You can find out more information about eksctl on our website

cPu1 commented 2 months ago

The config file you've used looks like a standard cluster that should work and is covered by our integration tests as well. I was unable to reproduce this issue. Are you using the exact ClusterConfig file you've shared here? Can you share the CloudFormation template for the nodegroup?

Ankitwasnik commented 2 months ago

I've sanitized a few fields, including volumeKmsKeyID and the cluster name, before sharing the config file. As requested, I've created a gist of the CloudFormation template for the node group.

https://gist.github.com/Ankitwasnik/ae913b1030149d43086c4c865f60310f