Install the SSM Agent on Amazon EKS Worker nodes using pre-Bootstrap Commands

Amazon EKS Worker nodes using pre-bootstrap commands



Amazon Elastic Kubernetes Service (EKS) is a managed Kubernetes service that simplifies the deployment of containerized applications at scale. However, when managing EKS worker nodes (EC2 instances), secure remote access is required for troubleshooting, patching, and automation. This is where the AWS Systems Manager (SSM) Agent steps in.

The SSM Agent enables you to use Systems Manager capabilities on your worker nodes, including Session Manager, Run Command, and Patch Manager, without having to expose SSH ports or manage key pairs. One of the most effective ways to deploy the SSM Agent is during node bootstrap, ensuring that every new worker node in your cluster is pre-configured and ready for control.


Why is it necessary to install the SSM Agent on worker nodes?

By installing the SSM Agent, you get:

  • Secure Remote Access: Connect to nodes without making port 22 (SSH) public.
  • Centralized management: Automate operations and apply patches to all nodes.
  • Compliance and auditing: Monitor who accessed nodes and what actions were taken.
  • Reduced operational overhead: There is no need to manually install agents each time a node is started.

Using pre-bootstrap commands.

When launching EKS worker nodes (either self-managed or via a launch template), you can specify user data that runs before the bootstrap script. This is the ideal time to install and launch the SSM Agent.


Best Practices.

  • Always use the latest version of the SSM Agent from Amazon Linux repository to benefit from security patches and new features.
  • Use Launch Templates: Include pre-bootstrap instructions in your launch template to ensure that all nodes launched by an Auto Scaling group behave consistently.
  • Enable IAM Permissions: Ensure that the worker node's instance profile has the necessary Systems Manager permissions (AmazonSSMManagedInstanceCore policy).
  • Verify the setup in a staging cluster before deploying it to production.
  • Monitor Agent Health: Use Systems Manager, Fleet Manager, or CloudWatch to ensure that all nodes are reporting properly.

Benefits After Implementation

Once the SSM Agent is deployed using the pre-bootstrap commands, you will have a consistent, automated process that eliminates the need for manual intervention. This enhances security by eliminating the requirement for SSH, simplifies troubleshooting, and provides significant automation features like as patch management, inventory collecting, and script execution from remote locations.


FAQs

Q1: Can I add the SSM Agent to my current worker nodes?

Yes, you can manually install the SSM Agent on existing nodes using the AWS Systems Manager Run Command or by signing in and manually installing it. However, automating it for future nodes is suggested.

Q2: Should I open SSH ports after installing SSM Agent?

No. Session Manager provides secure shell-like access via the AWS console or CLI without opening port 22.

Q3: What happens if a node does not have the correct IAM role?

The SSM Agent will install but be unable to register with Systems Manager. Make sure that the AmazonSSMManagedInstanceCore policy is associated to the worker node instance profile.

Q4: Does this strategy work with controlled node groups?

Yes. You may also pass pre-bootstrap user data using managed node group setups.

Q5: Does deploying SSM Agent incur additional costs?

There is no additional expense for the agent. You only pay for the Systems Manager capabilities that you use, such as automated executions and parameter storage.


Comments

Popular posts from this blog

AWS Architecture Diagram for Scalable Cloud Design

AWS Mainframe Refactoring with Blu Age Modernization

Set up DNS resolution for hybrid networks in a multi-account AWS environment