eksctl icon indicating copy to clipboard operation
eksctl copied to clipboard

[Bug] policy error when use eksctl to create a cluster for ipv6 family in china region

Open zhaojiew10 opened this issue 4 years ago • 2 comments

What were you trying to accomplish?

I want to use eksctl to create a cluster for ipv6 family in china region

What happened?

An error occured 2022-08-24 12:00:23 [!] 1 error(s) occurred and cluster hasn't been created properly, you may wish to check CloudFormation console

I already know the reason for the error. There is something wrong with the policy in the reference document in China.

Resource should be arn:aws-cn:ec2:*:*:network-interface/* but not arn:aws:ec2:*:*:network-interface/*

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "ec2:AssignIpv6Addresses",
                "ec2:DescribeInstances",
                "ec2:DescribeTags",
                "ec2:DescribeNetworkInterfaces",
                "ec2:DescribeInstanceTypes"
            ],
            "Resource": "*"
        },
        {
            "Effect": "Allow",
            "Action": [
                "ec2:CreateTags"
            ],
            "Resource": [
                "arn:aws:ec2:*:*:network-interface/*"
            ]
        }
    ]
}

https://docs.amazonaws.cn/eks/latest/userguide/cni-ipv6.html

How to reproduce it?

apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
  name: ipv6
  region: cn-north-1
  version: "1.22"
kubernetesNetworkConfig:
  ipFamily: IPv6
iam:
  withOIDC: true
addons:
  - name: vpc-cni
    version: latest
  - name: coredns
    version: latest
  - name: kube-proxy
    version: latest
managedNodeGroups:
  - name: ng1
    instanceType: t3.medium
    desiredCapacity: 1

Logs

2022-08-24 11:46:51 [ℹ]  deploying stack "eksctl-test-ipv6-cluster"
2022-08-24 11:47:21 [ℹ]  waiting for CloudFormation stack "eksctl-test-ipv6-cluster"
2022-08-24 11:47:51 [ℹ]  waiting for CloudFormation stack "eksctl-test-ipv6-cluster"
2022-08-24 11:48:51 [ℹ]  waiting for CloudFormation stack "eksctl-test-ipv6-cluster"
2022-08-24 11:49:51 [ℹ]  waiting for CloudFormation stack "eksctl-test-ipv6-cluster"
2022-08-24 11:50:51 [ℹ]  waiting for CloudFormation stack "eksctl-test-ipv6-cluster"
2022-08-24 11:51:51 [ℹ]  waiting for CloudFormation stack "eksctl-test-ipv6-cluster"
2022-08-24 11:52:51 [ℹ]  waiting for CloudFormation stack "eksctl-test-ipv6-cluster"
2022-08-24 11:53:51 [ℹ]  waiting for CloudFormation stack "eksctl-test-ipv6-cluster"
2022-08-24 11:54:51 [ℹ]  waiting for CloudFormation stack "eksctl-test-ipv6-cluster"
2022-08-24 11:55:51 [ℹ]  waiting for CloudFormation stack "eksctl-test-ipv6-cluster"
2022-08-24 11:56:51 [ℹ]  waiting for CloudFormation stack "eksctl-test-ipv6-cluster"
2022-08-24 11:57:51 [ℹ]  waiting for CloudFormation stack "eksctl-test-ipv6-cluster"
2022-08-24 11:59:52 [ℹ]  daemonset "kube-system/aws-node" restarted
2022-08-24 11:59:53 [ℹ]  creating role using recommended policies
2022-08-24 11:59:53 [ℹ]  deploying stack "eksctl-test-ipv6-addon-vpc-cni"
2022-08-24 11:59:53 [ℹ]  waiting for CloudFormation stack "eksctl-test-ipv6-addon-vpc-cni"
2022-08-24 12:00:23 [ℹ]  waiting for CloudFormation stack "eksctl-test-ipv6-addon-vpc-cni"
2022-08-24 12:00:23 [!]  1 error(s) occurred and cluster hasn't been created properly, you may wish to check CloudFormation console
2022-08-24 12:00:23 [ℹ]  to cleanup resources, run 'eksctl delete cluster --region=cn-north-1 --name=test-ipv6'
2022-08-24 12:00:23 [✖]  waiter state transitioned to Failure
Error: failed to create cluster "test-ipv6"

Anything else we need to know?

$ cat /etc/os-release
NAME="Amazon Linux"
VERSION="2"
ID="amzn"
ID_LIKE="centos rhel fedora"
VERSION_ID="2"
PRETTY_NAME="Amazon Linux 2"
ANSI_COLOR="0;33"
CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2"
HOME_URL="https://amazonlinux.com/"

Versions

$ eksctl info
eksctl version: 0.105.0
kubectl version: v1.22.0
OS: linux

zhaojiew10 avatar Aug 24 '22 12:08 zhaojiew10

Hello zhaojiew05955 :wave: Thank you for opening an issue in eksctl project. The team will review the issue and aim to respond within 1-3 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

github-actions[bot] avatar Aug 24 '22 12:08 github-actions[bot]

Hi @zhaojiew05955 , thanks for raising this! Fortunately, we have a very kind contributor who's already opened a PR to fix this. I've just linked this issue to that PR.

TiberiuGC avatar Aug 24 '22 12:08 TiberiuGC