Skip to content

Commit

Permalink
Remove SSM install script from AL2; SSM is pre-installed on EKS AL ba…
Browse files Browse the repository at this point in the history
…sed AMIs (#8135)
  • Loading branch information
bryantbiggs authored Jan 15, 2025
1 parent 5f1438b commit 83e5ccc
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 56 deletions.
5 changes: 0 additions & 5 deletions pkg/nodebootstrap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ The call to `UserData` will also dynamically add the following:
The bootstrap wrapper scripts will use `jq` and `sed` to get user and our config into various files,
and then call `/etc/eks/bootstrap.sh`.

For AL2, enabling SSM will add `assets/install-ssm.al2.sh`.

### AmazonLinux2023

While AL2023 implements the `Bootstrapper` interface, the underlying userdata will be entirely different from other AMI families. Specifically, AL2023 introduces a new node initialization process nodeadm that uses a YAML configuration schema, dropping the use of `/etc/eks/bootstrap.sh` script. For self-managed nodes, and for EKS-managed nodes based on custom AMIs, eksctl will populate userdata in the fashion below:
Expand Down Expand Up @@ -73,8 +71,6 @@ spec:
```

For EKS-managed nodes based on native AMIs, the userdata above is fulfilled automatically by the AWS SSM agent.

## Troubleshooting

### Ubuntu
Expand Down Expand Up @@ -111,5 +107,4 @@ Files:
/var/lib/cloud/scripts/eksctl/bootstrap.al2.sh
/etc/kubernetes/kubelet/kubelet-config.json
/etc/docker/daemon.json
/var/lib/cloud/scripts/eksctl/install-ssm.sh
```
37 changes: 0 additions & 37 deletions pkg/nodebootstrap/al2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,43 +31,6 @@ var _ = Describe("AmazonLinux2 User Data", func() {
}
})

When("SSM is enabled", func() {
BeforeEach(func() {
ng.SSH.EnableSSM = api.Enabled()
bootstrapper = newBootstrapper(clusterConfig, ng)
})

It("does not add the SSM install script to the userdata", func() {
userData, err := bootstrapper.UserData()
Expect(err).NotTo(HaveOccurred())

cloudCfg := decode(userData)

var paths []string
for _, f := range cloudCfg.WriteFiles {
paths = append(paths, f.Path)
}
Expect(paths).NotTo(ContainElement("/var/lib/cloud/scripts/eksctl/install-ssm.al2.sh"))
})
})

When("EFA is enabled", func() {
BeforeEach(func() {
enabled := true
ng.EFAEnabled = &enabled
bootstrapper = newBootstrapper(clusterConfig, ng)
})

It("adds the ssm install script to the userdata", func() {
userData, err := bootstrapper.UserData()
Expect(err).NotTo(HaveOccurred())

cloudCfg := decode(userData)
Expect(cloudCfg.WriteFiles[2].Path).To(Equal("/var/lib/cloud/scripts/eksctl/bootstrap.al2.sh"))
Expect(cloudCfg.WriteFiles[2].Permissions).To(Equal("0755"))
})
})

type bootScriptEntry struct {
clusterConfig *api.ClusterConfig
ng *api.NodeGroup
Expand Down
5 changes: 0 additions & 5 deletions pkg/nodebootstrap/assets/assets.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ var BootstrapUbuntuSh string
//go:embed scripts/al2023-xtables.lock.sh
var AL2023XTablesLock string

// InstallSsmAl2Sh holds the install-ssm.al2.sh contents
//
//go:embed scripts/install-ssm.al2.sh
var InstallSsmAl2Sh string

// KubeletYaml holds the kubelet.yaml contents
//
//go:embed scripts/kubelet.yaml
Expand Down
9 changes: 0 additions & 9 deletions pkg/nodebootstrap/assets/scripts/install-ssm.al2.sh

This file was deleted.

0 comments on commit 83e5ccc

Please sign in to comment.