Skip to content

Commit

Permalink
strip out the unneeded caching logic
Browse files Browse the repository at this point in the history
  • Loading branch information
ndbaker1 committed Oct 10, 2024
1 parent f4c00a6 commit 0a92684
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 126 deletions.
2 changes: 1 addition & 1 deletion nodeadm/cmd/nodeadm/init/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ func enrichConfig(log *zap.Logger, cfg *api.NodeConfig) error {
log.Info("Instance details populated", zap.Reflect("details", instanceDetails))
log.Info("Fetching default options...")
cfg.Status.Defaults = api.DefaultOptions{
SandboxImage: containerd.PauseContainerImageRef,
SandboxImage: "localhost/kubernetes/pause:0.1.0",
}
log.Info("Default options populated", zap.Reflect("defaults", cfg.Status.Defaults))
return nil
Expand Down
2 changes: 1 addition & 1 deletion nodeadm/internal/containerd/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func (cd *containerd) EnsureRunning() error {
}

func (cd *containerd) PostLaunch(c *api.NodeConfig) error {
return cacheSandboxImage(c)
return nil
}

func (cd *containerd) Name() string {
Expand Down
59 changes: 0 additions & 59 deletions nodeadm/internal/containerd/sandbox.go

This file was deleted.

57 changes: 0 additions & 57 deletions nodeadm/internal/containerd/sandbox_test.go

This file was deleted.

9 changes: 9 additions & 0 deletions templates/al2/provisioners/cache-pause-container.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

set -o nounset
set -o errexit
set -o pipefail

AWS_DOMAIN=$(imds 'latest/meta-data/services/domain')
ECR_URI="$(/etc/eks/get-ecr-uri.sh ${AWS_REGION} ${AWS_DOMAIN})"
cache-pause-container "${ECR_URI}/eks/pause:3.5"
5 changes: 2 additions & 3 deletions templates/al2/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,13 +211,12 @@
{
"type": "shell",
"remote_folder": "{{ user `remote_folder`}}",
"script": "{{template_dir}}/../shared/provisioners/cache-pause-container.sh",
"script": "{{template_dir}}/provisioners/cache-pause-container.sh",
"environment_vars": [
"AWS_ACCESS_KEY_ID={{user `aws_access_key_id`}}",
"AWS_SECRET_ACCESS_KEY={{user `aws_secret_access_key`}}",
"AWS_SESSION_TOKEN={{user `aws_session_token`}}",
"AWS_REGION={{user `aws_region`}}",
"PAUSE_CONTAINER_CMD=echo $(/etc/eks/get-ecr-uri.sh \"{{user `aws_region`}}\" \"$(imds 'latest/meta-data/services/domain')\")/eks/pause:3.5"
"AWS_REGION={{user `aws_region`}}"
]
},
{
Expand Down
7 changes: 7 additions & 0 deletions templates/al2023/provisioners/cache-pause-container.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

set -o nounset
set -o errexit
set -o pipefail

cache-pause-container "$(nodeadm runtime ecr-uri)/eks/pause:3.5"
5 changes: 2 additions & 3 deletions templates/al2023/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -220,13 +220,12 @@
{
"type": "shell",
"remote_folder": "{{ user `remote_folder`}}",
"script": "{{template_dir}}/../shared/provisioners/cache-pause-container.sh",
"script": "{{template_dir}}/provisioners/cache-pause-container.sh",
"environment_vars": [
"AWS_ACCESS_KEY_ID={{user `aws_access_key_id`}}",
"AWS_SECRET_ACCESS_KEY={{user `aws_secret_access_key`}}",
"AWS_SESSION_TOKEN={{user `aws_session_token`}}",
"AWS_REGION={{user `aws_region`}}",
"PAUSE_CONTAINER_CMD=echo $(nodeadm runtime ecr-uri)/eks/pause:3.5"
"AWS_REGION={{user `aws_region`}}"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ set -o nounset
set -o errexit
set -o pipefail

LOCAL_REF=${LOCAL_REF:-"localhost/kubernetes/pause:0.1.0"}
PAUSE_CONTAINER=${PAUSE_CONTAINER:-$(eval "${PAUSE_CONTAINER_CMD}")}
PAUSE_CONTAINER=${1}
LOCAL_REF=${2:-"localhost/kubernetes/pause:0.1.0"}

sudo systemctl start containerd

Expand Down

0 comments on commit 0a92684

Please sign in to comment.