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

Install cri-tools on Amazon Linux 2 #1282

Merged
merged 2 commits into from
Mar 19, 2021
Merged
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
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
19 changes: 13 additions & 6 deletions pkg/scripts/render.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,20 +65,26 @@ 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

cat <<EOF | sudo tee /etc/crictl.yaml
runtime-endpoint: unix:///var/run/dockershim.sock
EOF

sudo systemctl daemon-reload
sudo systemctl enable --now docker
`,
defaultAmazonCrictlVersion,
defaultAmazonDockerVersion,
defaultLegacyDockerVersion,
),
Expand Down Expand Up @@ -194,11 +200,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 +226,7 @@ var (
sudo systemctl restart containerd
`,
defaultAmazonContainerdVersion,
defaultAmazonCrictlVersion,
),
}
)
Expand Down
11 changes: 8 additions & 3 deletions pkg/scripts/testdata/TestKubeadmAmazonLinux-force.golden
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,18 @@ cat <<EOF | sudo tee /etc/docker/daemon.json
EOF


sudo yum versionlock delete docker || true
sudo yum versionlock delete docker cri-tools || true




sudo yum install -y docker-19.03.13ce*
sudo yum versionlock add docker

sudo yum install -y docker-19.03.13ce* cri-tools-1.13.0*
sudo yum versionlock add docker cri-tools

cat <<EOF | sudo tee /etc/crictl.yaml
runtime-endpoint: unix:///var/run/dockershim.sock
EOF

sudo systemctl daemon-reload
sudo systemctl enable --now docker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,13 @@ EOF



sudo yum install -y docker-19.03.13ce*
sudo yum versionlock add docker

sudo yum install -y docker-19.03.13ce* cri-tools-1.13.0*
sudo yum versionlock add docker cri-tools

cat <<EOF | sudo tee /etc/crictl.yaml
runtime-endpoint: unix:///var/run/dockershim.sock
EOF

sudo systemctl daemon-reload
sudo systemctl enable --now docker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,13 @@ EOF



sudo yum install -y docker-19.03.13ce*
sudo yum versionlock add docker

sudo yum install -y docker-19.03.13ce* cri-tools-1.13.0*
sudo yum versionlock add docker cri-tools

cat <<EOF | sudo tee /etc/crictl.yaml
runtime-endpoint: unix:///var/run/dockershim.sock
EOF

sudo systemctl daemon-reload
sudo systemctl enable --now docker
Expand Down
9 changes: 7 additions & 2 deletions pkg/scripts/testdata/TestKubeadmAmazonLinux-proxy.golden
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,13 @@ EOF



sudo yum install -y docker-19.03.13ce*
sudo yum versionlock add docker

sudo yum install -y docker-19.03.13ce* cri-tools-1.13.0*
sudo yum versionlock add docker cri-tools

cat <<EOF | sudo tee /etc/crictl.yaml
runtime-endpoint: unix:///var/run/dockershim.sock
EOF

sudo systemctl daemon-reload
sudo systemctl enable --now docker
Expand Down
9 changes: 7 additions & 2 deletions pkg/scripts/testdata/TestKubeadmAmazonLinux-simple.golden
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,13 @@ EOF



sudo yum install -y docker-19.03.13ce*
sudo yum versionlock add docker

sudo yum install -y docker-19.03.13ce* cri-tools-1.13.0*
sudo yum versionlock add docker cri-tools

cat <<EOF | sudo tee /etc/crictl.yaml
runtime-endpoint: unix:///var/run/dockershim.sock
EOF

sudo systemctl daemon-reload
sudo systemctl enable --now docker
Expand Down
9 changes: 7 additions & 2 deletions pkg/scripts/testdata/TestKubeadmAmazonLinux-v1.16.1.golden
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,13 @@ EOF



sudo yum install -y docker-18.09.9ce*
sudo yum versionlock add docker

sudo yum install -y docker-18.09.9ce* cri-tools-1.13.0*
sudo yum versionlock add docker cri-tools

cat <<EOF | sudo tee /etc/crictl.yaml
runtime-endpoint: unix:///var/run/dockershim.sock
EOF

sudo systemctl daemon-reload
sudo systemctl enable --now docker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ sudo yum install -y \



sudo yum install -y containerd-1.4.1*
sudo yum versionlock add containerd
sudo yum install -y containerd-1.4.1* cri-tools-1.13.0*
sudo yum versionlock add containerd cri-tools

cat <<EOF | sudo tee /etc/containerd/config.toml
version = 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ sudo yum install -y \



sudo yum install -y containerd-1.4.1*
sudo yum versionlock add containerd
sudo yum install -y containerd-1.4.1* cri-tools-1.13.0*
sudo yum versionlock add containerd cri-tools

cat <<EOF | sudo tee /etc/containerd/config.toml
version = 2
Expand Down
11 changes: 8 additions & 3 deletions pkg/scripts/testdata/TestUpgradeKubeadmAndCNIAmazonLinux.golden
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,18 @@ cat <<EOF | sudo tee /etc/docker/daemon.json
EOF


sudo yum versionlock delete docker || true
sudo yum versionlock delete docker cri-tools || true




sudo yum install -y docker-19.03.13ce*
sudo yum versionlock add docker

sudo yum install -y docker-19.03.13ce* cri-tools-1.13.0*
sudo yum versionlock add docker cri-tools

cat <<EOF | sudo tee /etc/crictl.yaml
runtime-endpoint: unix:///var/run/dockershim.sock
EOF

sudo systemctl daemon-reload
sudo systemctl enable --now docker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,18 @@ cat <<EOF | sudo tee /etc/docker/daemon.json
EOF


sudo yum versionlock delete docker || true
sudo yum versionlock delete docker cri-tools || true




sudo yum install -y docker-19.03.13ce*
sudo yum versionlock add docker

sudo yum install -y docker-19.03.13ce* cri-tools-1.13.0*
sudo yum versionlock add docker cri-tools

cat <<EOF | sudo tee /etc/crictl.yaml
runtime-endpoint: unix:///var/run/dockershim.sock
EOF

sudo systemctl daemon-reload
sudo systemctl enable --now docker
Expand Down