eksctl icon indicating copy to clipboard operation
eksctl copied to clipboard

panic when creating nodegroup on unowned cluster

Open MarkusMuellerAU opened this issue 5 years ago • 4 comments

What were you trying to accomplish?

Add a managed node group to an existing AWS EKS Cluster which is not eksctl managed

eksctl create nodegroup --config-file eks_nodegroup.yaml -p hcs_au

What happened?

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x32eda7b]

How to reproduce it?

eksctl create nodegroup --config-file eks_nodegroup.yaml -p hcs_au
2021-08-04 14:15:44 [ℹ]  eksctl version 0.59.0
2021-08-04 14:15:44 [ℹ]  using region ap-southeast-2
2021-08-04 14:15:46 [!]  no eksctl-managed CloudFormation stacks found for "hcs-au", will attempt to create nodegroup(s) on non eksctl-managed cluster
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x32eda7b]

Logs

eksctl create nodegroup --config-file eks_nodegroup.yaml -p hcs_au
2021-08-04 14:15:44 [ℹ]  eksctl version 0.59.0
2021-08-04 14:15:44 [ℹ]  using region ap-southeast-2
2021-08-04 14:15:46 [!]  no eksctl-managed CloudFormation stacks found for "hcs-au", will attempt to create nodegroup(s) on non eksctl-managed cluster
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x32eda7b]

goroutine 1 [running]:
github.com/weaveworks/eksctl/pkg/actions/nodegroup.loadVPCFromConfig(0x44e3690, 0xc00031dad0, 0xc00050fd00, 0x1, 0x1)
	github.com/weaveworks/eksctl/pkg/actions/nodegroup/create.go:296 +0x3b
github.com/weaveworks/eksctl/pkg/actions/nodegroup.(*Manager).Create(0xc0003fcf00, 0x10000010101, 0x44a06f0, 0xc00051c380, 0xc0003fcf00, 0x0)
	github.com/weaveworks/eksctl/pkg/actions/nodegroup/create.go:54 +0x2d6
github.com/weaveworks/eksctl/pkg/ctl/create.createNodeGroupCmd.func1(0xc0001242c0, 0xc00056e460, 0x101, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0)
	github.com/weaveworks/eksctl/pkg/ctl/create/nodegroup.go:60 +0x3c5
github.com/weaveworks/eksctl/pkg/ctl/create.createNodeGroupCmdWithRunFunc.func1(0xc00016e780, 0xc0002930c0, 0x0, 0x4, 0x0, 0x0)
	github.com/weaveworks/eksctl/pkg/ctl/create/nodegroup.go:86 +0x106
github.com/spf13/cobra.(*Command).execute(0xc00016e780, 0xc000293080, 0x4, 0x4, 0xc00016e780, 0xc000293080)
	github.com/spf13/[email protected]/command.go:856 +0x472
github.com/spf13/cobra.(*Command).ExecuteC(0xc00002f400, 0xc00051ae20, 0x1, 0xc000857f70)
	github.com/spf13/[email protected]/command.go:974 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
	github.com/spf13/[email protected]/command.go:902
main.main()
	github.com/weaveworks/eksctl/cmd/eksctl/main.go:77 +0x41b

Anything else we need to know?

MacOS Big Sur Downloaded binary of eksctl, tried 0.58, 0.59 and 0.60rc-0, all panic AWS named profile

Versions

$ eksctl info
eksctl version: 0.59.0
kubectl version: v1.19.0
OS: darwin

eks_nodegroup.yaml

apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
  name: hcs-au
  region: ap-southeast-2
  version: "1.20"
managedNodeGroups:
- name: localssd
  instanceTypes: ["m5ad.xlarge","m5d.xlarge"]
  spot: true
  availabilityZones: ["ap-southeast-2b","ap-southeast-2c"]
  desiredCapacity: 1
  minSize: 1
  maxSize: 2
  iam:
    instanceRoleARN: arn:aws:iam::671700000000:role/NodeInstanceRole
  launchTemplate:
    id: lt-07bd1ef4d00000000

MarkusMuellerAU avatar Aug 04 '21 04:08 MarkusMuellerAU

Hi @MarkusMuellerAU, did you add your VPC details to your config as per the docs here?

(note for team: we should obvs not panic when users forget to supply this info)

Callisto13 avatar Aug 05 '21 09:08 Callisto13

I am working on it.

NaivePa avatar Aug 06 '21 08:08 NaivePa

Hi @Callisto13 , no I didn't. Thank you very much for your help and pointing me in the right direction. Adding the VPC details has solved the issue.

MarkusMuellerAU avatar Aug 06 '21 08:08 MarkusMuellerAU

Sweet! Looks like someone else has submitted a PR to give a more helpful message when that config is missing, will leave this open until it is merged.

Thanks @NaivePa !

Callisto13 avatar Aug 06 '21 09:08 Callisto13