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

Remove SSM install script from AL2; SSM is pre-installed on EKS AL based AMIs #8135

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

Loading