Skip to content

Commit

Permalink
[release/v1.2] Install cri-tools on Amazon Linux 2 (#1283)
Browse files Browse the repository at this point in the history
* Install cri-tools on Amazon Linux 2

Signed-off-by: Marko Mudrinić <mudrinic.mare@gmail.com>

* Update test fixtures

Signed-off-by: Marko Mudrinić <mudrinic.mare@gmail.com>

Co-authored-by: Marko Mudrinić <mudrinic.mare@gmail.com>
  • Loading branch information
kubermatic-bot and xmudrii authored Mar 19, 2021
1 parent 2254855 commit 7c76ddb
Show file tree
Hide file tree
Showing 12 changed files with 77 additions and 29 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
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

0 comments on commit 7c76ddb

Please sign in to comment.