Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add preflight validation to check that cluster name length is not more than 36 characters #8016

Closed
sp1999 opened this issue Apr 19, 2024 · 0 comments
Assignees

Comments

@sp1999
Copy link
Member

sp1999 commented Apr 19, 2024

What happened:
EKS-A cluster creation failed during the bootstrap-cluster-init stage when creating kind cluster due to hostname being too long. Hostname is limited to 64 characters and eks-a appends "-eks-a-cluster-control-plane" to the cluster name when setting the hostname. So eks-a cluster name cannot be more than 36 characters.

Error message

Error: creating bootstrap cluster: executing create cluster: cluster name "{cluster-name}-eks-a-cluster" is probably too long, this might not work properly on some systems
Creating cluster "{cluster-name}-eks-a-cluster" ...
 • Ensuring node image (public.ecr.aws/eks-anywhere/kubernetes-sigs/kind/node:v1.27.4-eks-d-1-27-10-eks-a-47) 🖼  ...
 ✓ Ensuring node image (public.ecr.aws/eks-anywhere/kubernetes-sigs/kind/node:v1.27.4-eks-d-1-27-10-eks-a-47) 🖼
 • Preparing nodes 📦   ...
 ✗ Preparing nodes 📦 
Deleted nodes: ["{cluster-name}-eks-a-cluster-control-plane"]
ERROR: failed to create cluster: command "docker run --name {cluster-name}-eks-a-cluster-control-plane --hostname {cluster-name}-eks-a-cluster-control-plane --label io.x-k8s.kind.role=control-plane --privileged --security-opt seccomp=unconfined --security-opt apparmor=unconfined --tmpfs /tmp --tmpfs /run --volume /var --volume /lib/modules:/lib/modules:ro -e KIND_EXPERIMENTAL_CONTAINERD_SNAPSHOTTER --detach --tty --label io.x-k8s.kind.cluster={cluster-name}-eks-a-cluster --net kind --restart=on-failure:1 --init=false --publish=127.0.0.1:55089:6443/TCP -e KUBECONFIG=/etc/kubernetes/admin.conf public.ecr.aws/eks-anywhere/kubernetes-sigs/kind/node:v1.27.4-eks-d-1-27-10-eks-a-47" failed with error: exit status 125

Command Output: 7a3130fc9866624bd2e5b4cfcf69fdf6f9ded41f0f17f104aaef258bd207790f
docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: sethostname: invalid argument: unknown.

What you expected to happen:
Cluster gets created without any errors

How to reproduce it (as minimally and precisely as possible):

eksctl anywhere create cluster -f {cluster-name}.yaml -v 9

Run the above command with cluster name length greater than 36

Anything else we need to know?:
Related to #7302

Environment:

  • EKS Anywhere Release: v0.17.2
  • Kubernetes version: v1.27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant