Issues Facing During the creation of Node-Group with Custom Launch Template..?
Let's Troubleshoot the issue in a simple way...
Published Aug 6, 2024
Last Modified Jan 7, 2025
Solution:
1. Create Custom Launch Template:
- EC2 > Launch Templates > Create
- Configure:
- Name: eks-custom-template-v1
- AMI: Your custom AMI
- Instance type: t3.medium
- Key pair: Select for SSH (if needed)
- Network: Leave VPC/subnet blank
- Security group: Create new/select existing
- IAM role: Select with EKS permissions
- Expand Advanced details
Note: Ensure custom AMI is EKS-compatible and includes necessary tools/configurations.
2. User Data :
```
#!/bin/bash
/etc/eks/bootstrap.sh ${ClusterName} \
--b64-cluster-ca ${B64ClusterCA} \
--apiserver-endpoint ${ClusterAPIServerEndpoint} \
--dns-cluster-ip ${ClusterDNSIP} \
--kubelet-extra-args "${KubeletExtraArgs}"
```
3. Create Node Group with Custom Template:
- EKS console > Your cluster > Compute > Add node group
- Configure:
- Name: node-1
- IAM role: Select appropriate
- Compute:
- AMI: Custom
- Launch template: eks-launchtemplate
- Instance types: As needed
- Scaling:
- Desired: 1
- Min: 1
- Max: 2
- Network:
- Subnets: Select private
- Review and create
Note: Ensure launch template and IAM roles have necessary EKS permissions.
4. Common Issues and Fixes:
- IAM permissions: Add AmazonEKSWorkerNodePolicy, AmazonEKS_CNI_Policy
- AMI compatibility: Use Amazon EKS-optimized AMI as base
- Network issues: Let EKS manage VPC/subnet selection