Node groups created by eks 1.17 (eksctl is 0.30.0-rc1) are not created by eks 1.18.
I also wrote a comment here: https://github.com/weaveworks/eksctl/issues/2740
What happened?
Node groups created by eks 1.17 (with eksctl 0.30.0-rc1) are not created by eks 1.18(with eksctl 0.30.0-rc1).
How to reproduce it?
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
name: ${CLUSTER_NAME}
region: ap-northeast-1
version: "${EKS_VERSION}"
cloudWatch:
clusterLogging:
enableTypes: ["*"] # types: "api", "audit", "authenticator", "controllerManager", "scheduler"
secretsEncryption:
# ARN of the KMS key
keyARN: "${AWS_KMS_KEY_ARN}"
vpc:
clusterEndpoints:
privateAccess: true
publicAccess: true
publicAccessCIDRs:
- "XX.XX.XX.XX/32"
subnets:
# must provide 'private' and/or 'public' subnets by availibility zone as shown
public:
${AZ1}:
id: "${AZ1_SUBNET_ID}"
${AZ2}:
id: "${AZ2_SUBNET_ID}"
${AZ3}:
id: "${AZ3_SUBNET_ID}"
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
name: ${CLUSTER_NAME}
region: ap-northeast-1
nodeGroups:
- name: worker-XXXX
labels:
node.kubernetes.io/role: "worker"
aws.amazon.com/purchaseType: "spot"
instanceType: mixed
minSize: 1
maxSize: 100
disableIMDSv1: true
disablePodIMDS: true
desiredCapacity: ${WORKER_DESIRED_CAPACITY}
volumeSize: ${WORKER_VOLUME_SIZE}
volumeType: gp2
volumeEncrypted: true
asgMetricsCollection:
- granularity: 1Minute
metrics:
- GroupMinSize
- GroupMaxSize
- GroupDesiredCapacity
- GroupInServiceInstances
- GroupPendingInstances
- GroupStandbyInstances
- GroupTerminatingInstances
- GroupTotalInstances
instancesDistribution:
instanceTypes:
- c5.2xlarge
- m5.2xlarge
- c5n.2xlarge
- m5n.2xlarge
- c5d.2xlarge
- m5d.2xlarge
onDemandBaseCapacity: 0
onDemandPercentageAboveBaseCapacity: 0
spotInstancePools: 6
spotAllocationStrategy: "lowest-price"
tags:
# EC2 tags required for cluster-autoscaler auto-discovery
k8s.io/cluster-autoscaler/enabled: "true"
k8s.io/cluster-autoscaler/${CLUSTER_NAME}: "owned"
k8s.io/cluster-autoscaler/node-template/label/node.kubernetes.io/role: "worker"
k8s.io/cluster-autoscaler/node-template/label/aws.amazon.com/purchaseType: "spot"
iam:
instanceProfileARN: "arn:aws:iam::${AWS_ACCOUNT_ID}:instance-profile/${WORKER_ROLE_NAME}"
instanceRoleARN: "arn:aws:iam::${AWS_ACCOUNT_ID}:role/${WORKER_ROLE_NAME}"
kubeletExtraConfig:
allowedUnsafeSysctls:
- "net.core.somaxconn"
- "net.ipv4.tcp_tw_reuse"
- "net.ipv4.ip_local_port_range"
- "net.ipv4.tcp_max_syn_backlog"
- "net.ipv4.tcp_fin_timeout"
preBootstrapCommands:
# docker daemon settings
- 'cat /etc/docker/daemon.json | jq -r ".\"log-opts\".\"max-size\" |= \"${WORKER_LOG_MAX_SIZE}\"" | jq -r ".\"log-opts\".\"max-file\" |= \"${WORKER_LOG_MAX_FILE}\"" | jq -r ".\"registry-mirrors\"[0] |= \"http://${CLUSTER_NAME}-docker-regsitry.ap-northeast-1.private.chatwork.network:5000\"" > /tmp/docker.json'
- 'cp -f /tmp/docker.json /etc/docker/daemon.json'
- "systemctl restart docker"
# sysctl settings
- "cat > /etc/sysctl.d/99-zz-network.conf << EOF \nnet.core.somaxconn = 65535 \nnet.ipv4.tcp_max_syn_backlog = 65535 \nnet.core.netdev_max_backlog = 16384 \nnet.ipv4.ip_local_port_range = 1024 65535\nnet.ipv4.tcp_tw_reuse = 1 \nnet.netfilter.nf_conntrack_tcp_be_liberal = 1 \nEOF"
- "sysctl -p /etc/sysctl.d/99-zz-network.conf"
# limits settings
- "cat > /etc/security/limits.d/20-nproc.conf << EOF \n* soft nofile 65536 \n* hard nofile 65536 \nEOF"
- "ulimit -n 65536"
# install ssm-agent
- "yum install -y https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/linux_amd64/amazon-ssm-agent.rpm"
- "systemctl enable amazon-ssm-agent"
- "systemctl start amazon-ssm-agent"
securityGroups:
attachIDs:
- "${SG_ID_EKS_WORKER}"
availabilityZones:
- "${AZ1}"
eksctl create cluster -f eks.yaml
eksctl create nodegroup -f nodegroup.yaml
The results were the same when I used eksctl 0.30.0-rc0.
Versions Please paste in the output of these commands:
$ eksctl version
0.30.0-rc.1
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.8", GitCommit:"9f2892aab98fe339f3bd70e3c470144299398ace", GitTreeState:"clean", BuildDate:"2020-08-13T16:12:48Z", GoVersion:"go1.13.15", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"18+", GitVersion:"v1.18.8-eks-7c9bda", GitCommit:"7c9bda52c425d0d56d7b93f1377a826b4132c05c", GitTreeState:"clean", BuildDate:"2020-08-28T23:04:33Z", GoVersion:"go1.13.15", Compiler:"gc", Platform:"linux/amd64"}
Logs kubelet logs
Oct 15 03:33:41 ip-XXX-XXX-XXX-XXX.ap-northeast-1.compute.internal kubelet[3993]: E1015 03:33:41.866231 3993 kubelet.go:2193] Container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized
Oct 15 03:33:41 ip-XXX-XXX-XXX-XXX.ap-northeast-1.compute.internal kubelet[3993]: E1015 03:33:41.948160 3993 kubelet.go:2273] node "ip-XXX-XXX-XXX-XXX.ap-northeast-1.compute.internal" not found
There doesn't seem to be a binary and config for cni.
/usr/bin/kubelet --node-ip=XXXX --node-labels=alpha.eksctl.io/cluster-name=XXXX,alpha.eksctl.io/nodegroup-name=XXXX,aws.amazon.com/purchaseType=spot,node.kubernetes.io/role=worker,node-lifecycle=spot,alpha.eksctl.io/instance-id=i-XXXX --max-pods=58 --register-node=true --register-with-taints= --cloud-provider=aws --container-runtime=docker --network-plugin=cni --cni-bin-dir=/opt/cni/bin --cni-conf-dir=/etc/cni/net.d --pod-infra-container-image=602401143452.dkr.ecr.ap-northeast-1.amazonaws.com/eks/pause:3.1-eksbuild.1 --kubeconfig=/etc/eksctl/kubeconfig.yaml --config=/etc/eksctl/kubelet.yaml
sh-4.2$ ls /opt/cni/bin/
bandwidth bridge dhcp firewall flannel host-device host-local ipvlan loopback macvlan portmap ptp sbr static tuning vlan
sh-4.2$ sudo ls /etc/cni/net.d/
ls: cannot access /etc/cni/net.d/: No such file or directory
@cw-sakamoto Can you post the output of create nodegroup? Do you mean it errors with "Failed to stabilize"?
@michaelbeaumont Thank you for your comments.
eksctl finishes without error, but kubectl get node shows no node, and kubectl get po -n kube-system shows pending.
$ eksctl create nodegroup -f nodegroup.yaml
[ℹ] eksctl version 0.30.0-rc.1
[ℹ] using region ap-northeast-1
[ℹ] will use version 1.18 for new nodegroup(s) based on control plane version
[ℹ] 1 nodegroup (worker-1a-202010150804-1) was included (based on the include/exclude rules)
[ℹ] will create a CloudFormation stack for each of 1 nodegroups in cluster "eksXXX"
[ℹ] 2 sequential tasks: { fix cluster compatibility, 1 task: { 1 task: { create nodegroup "worker-1a-202010150804-1" } } }
[ℹ] checking cluster stack for missing resources
[ℹ] cluster stack has all required resources
[ℹ] building nodegroup stack "eksctl-XXXX-nodegroup-worker-1a-202010150804-1"
[ℹ] deploying stack "eksctl-XXX-nodegroup-worker-1a-202010150804-1"
[ℹ] no tasks
[✔] created 1 nodegroup(s) in cluster "eksXXX"
[✔] created 0 managed nodegroup(s) in cluster "eksXXX"
[ℹ] checking security group configuration for all nodegroups
[ℹ] all nodegroups have up-to-date configuration
$ kubectl get node
No resources found in default namespace.
$ kubectl get po -n kube-system
NAME READY STATUS RESTARTS AGE
coredns-86f7d88d77-24xjw 0/1 Pending 0 5h55m
coredns-86f7d88d77-lhmrx 0/1 Pending 0 5h55m
Sorry..., I think I deleted aws-auth by mistake in the creation script (eksctl's wrapper).