kubernetesamazon-ekseksctl

eksct error unmarshaling JSON during processing YAML file


I am getting error during applying YAML config to AWS K8s cluster:

Error:

couldn't create node group filter from command line options: 
loading config file "K8s-nodegroups/group_test.yaml": error unmarshaling JSON: 
while decoding JSON: json: unknown field "fullEc2Access"

Here is the command which I am using: eksctl create nodegroup -f K8s-nodegroups/group_test.yaml

And here is my YAML:

apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig

metadata:
  name: some-cluster-name
  region: eu-west-2

nodeGroups:
  - name: "group-test"
    instanceType: t3.small
    desiredCapacity: 1
    subnets:
      - eu-west-2a
      - eu-west-2b
    maxSize: 2
    minSize: 1
    fullEc2Access: true
    spot: true
    maxPodsPerNode: 100
    volumeSize: 8
    volumeType: gp3
    labels: { group: test }

And there is not error related to fullEc2Access, if I remove it I will get next one:

...error unmarshaling JSON: while decoding JSON: json: unknown field "spot"

Why my file is trying to precess like a JSON? How I can fix it, I got this example form docs and checked it many times.

I know that I can use "one line" command to create nodegroup, but I want to use YAML. How it is possible to fix it?

I tried eksctl 0.131.0 and 0.128.0 versions - same errors.


Solution

  • fullEc2Access does not exists as a property in the schema, spot is a property of ManagedNodeGroup, not NodeGroup.

    See EKS Config File Schema for further info, or you can print the default schema using the command

    eksctl utils schema