Building a custom AMI for EKS
There are a number of reasons why you may want to use a custom AMI—for example, security hardening, updates to Kubernetes agent binaries, and so on. There are also many ways you can do this, but we are going to look at using Packer from HashiCorp (https://learn.hashicorp.com/packer), which is an open source tool that can be used to create a number of different types of operating system images. Here are the steps:
- In the first step, we need to install Packer on our workstation using the following link: https://learn.hashicorp.com/collections/packer/aws-get-started. This will then allow us to create a custom AMI.
- You can then clone the following Git repository and change into the new
amazon-eks-ami
directory: https://github.com/awslabs/amazon-eks-ami. This is the same process used to create official AMIs. - From the root of the cloned repository, you can now run the
make
command shown next to create a basic1.21
AMI (ensure the region...