Skip to content

Commit

Permalink
Install cri-tools on Amazon Linux 2
Browse files Browse the repository at this point in the history
Signed-off-by: Marko Mudrinić <[email protected]>
  • Loading branch information
xmudrii committed Mar 19, 2021
1 parent 99da013 commit 92277e5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions pkg/scripts/funcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ const (
defaultLegacyDockerVersion = "18.09.9"
defaultContainerdVersion = "1.4.3"
defaultAmazonContainerdVersion = "1.4.1"
defaultAmazonCrictlVersion = "1.13.0"
)

type dockerConfig struct {
Expand Down
15 changes: 9 additions & 6 deletions pkg/scripts/render.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,20 +65,22 @@ var (

"yum-docker-ce-amzn": heredoc.Docf(`
{{- if or .FORCE .UPGRADE }}
sudo yum versionlock delete docker || true
sudo yum versionlock delete docker cri-tools || true
{{- end }}
{{ $CRICTL_VERSION_TO_INSTALL := "%s" }}
{{ $DOCKER_VERSION_TO_INSTALL := "%s" }}
{{ if semverCompare "< 1.17" .KUBERNETES_VERSION }}
{{ $DOCKER_VERSION_TO_INSTALL = "%s" }}
{{ end }}
sudo yum install -y docker-{{ $DOCKER_VERSION_TO_INSTALL }}ce*
sudo yum versionlock add docker
sudo yum install -y docker-{{ $DOCKER_VERSION_TO_INSTALL }}ce* cri-tools-{{ $CRICTL_VERSION_TO_INSTALL }}*
sudo yum versionlock add docker cri-tools
sudo systemctl daemon-reload
sudo systemctl enable --now docker
`,
defaultAmazonCrictlVersion,
defaultAmazonDockerVersion,
defaultLegacyDockerVersion,
),
Expand Down Expand Up @@ -194,11 +196,11 @@ var (

"yum-containerd-amzn": heredoc.Docf(`
{{- if or .FORCE .UPGRADE }}
sudo yum versionlock delete containerd || true
sudo yum versionlock delete containerd cri-tools || true
{{- end }}
sudo yum install -y containerd-%s*
sudo yum versionlock add containerd
sudo yum install -y containerd-%s* cri-tools-%s*
sudo yum versionlock add containerd cri-tools
cat <<EOF | sudo tee /etc/containerd/config.toml
{{ containerdCfg .INSECURE_REGISTRY -}}
Expand All @@ -220,6 +222,7 @@ var (
sudo systemctl restart containerd
`,
defaultAmazonContainerdVersion,
defaultAmazonCrictlVersion,
),
}
)
Expand Down

0 comments on commit 92277e5

Please sign in to comment.