File tree Expand file tree Collapse file tree 11 files changed +141
-7
lines changed
runtime/rootfs/etc/systemd/system Expand file tree Collapse file tree 11 files changed +141
-7
lines changed Original file line number Diff line number Diff line change 2222| ` cache_container_images ` | |
2323| ` cni_plugin_version ` | |
2424| ` containerd_version ` | |
25+ | ` install_containerd_from_s3 ` | |
2526| ` creator ` | |
2627| ` docker_version ` | Docker is not installed on Kubernetes v1.25+ |
2728| ` enable_fips ` | Install openssl and enable fips related kernel parameters |
Original file line number Diff line number Diff line change 1919| ` binary_bucket_name ` | |
2020| ` binary_bucket_region ` | |
2121| ` containerd_version ` | |
22+ | ` install_containerd_from_s3 ` | |
2223| ` creator ` | |
2324| ` enable_accelerator ` | Vendor that provides the GPU or accelerator hardware. Currently we support Neuron and NVIDIA. |
2425| ` enable_efa ` | Valid options are ``` true ``` or ``` false ``` . Wheather or not to install the software needed to use AWS Elastic Fabric Adapter (EFA) network interfaces. |
Original file line number Diff line number Diff line change @@ -149,8 +149,27 @@ sudo yum install -y runc-${RUNC_VERSION}
149149sudo yum versionlock runc-*
150150
151151# install containerd and lock version
152- sudo yum install -y containerd-${CONTAINERD_VERSION}
153- sudo yum versionlock containerd-*
152+ if [[ " $INSTALL_CONTAINERD_FROM_S3 " == " true" ]]; then
153+ CONTAINERD_BINARIES=(
154+ containerd
155+ containerd-shim-runc-v2
156+ ctr
157+ )
158+ echo " Installing containerd from S3..."
159+ for binary in " ${CONTAINERD_BINARIES[@]} " ; do
160+ aws s3 cp --region ${BINARY_BUCKET_REGION} s3://${BINARY_BUCKET_NAME} /containerd/${CONTAINERD_VERSION} /${MACHINE} /${binary} .
161+ sudo chmod +x $binary
162+ sudo mv $binary /usr/bin/
163+ done
164+ sudo mkdir -p /var/lib/containerd
165+ sudo mv $WORKING_DIR /containerd.service /etc/systemd/system/containerd.service
166+ sudo chown root:root /etc/systemd/system/containerd.service
167+ # exclude containerd from yum.conf as versionlock doesn't work in this case
168+ echo " exclude=containerd*,docker*" | sudo tee -a /etc/yum.conf
169+ else
170+ sudo yum install -y containerd-${CONTAINERD_VERSION}
171+ sudo yum versionlock containerd-*
172+ fi
154173
155174# install cri-tools for crictl, needed to interact with containerd's CRI server
156175sudo yum install -y cri-tools
Original file line number Diff line number Diff line change 1+ # Copyright The containerd Authors.
2+ #
3+ # Licensed under the Apache License, Version 2.0 (the "License");
4+ # you may not use this file except in compliance with the License.
5+ # You may obtain a copy of the License at
6+ #
7+ # http://www.apache.org/licenses/LICENSE-2.0
8+ #
9+ # Unless required by applicable law or agreed to in writing, software
10+ # distributed under the License is distributed on an "AS IS" BASIS,
11+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ # See the License for the specific language governing permissions and
13+ # limitations under the License.
14+
15+ [Unit]
16+ Description =containerd container runtime
17+ Documentation =https://containerd.io
18+ After =network.target local-fs.target dbus.service
19+
20+ [Service]
21+ #uncomment to enable the experimental sbservice (sandboxed) version of containerd/cri integration
22+ #Environment="ENABLE_CRI_SANDBOXES=sandboxed"
23+ ExecStartPre =-/sbin/modprobe overlay
24+ ExecStart =/usr/bin/containerd
25+
26+ Type =notify
27+ Delegate =yes
28+ KillMode =process
29+ Restart =always
30+ RestartSec =5
31+ # Having non-zero Limit*s causes performance problems due to accounting overhead
32+ # in the kernel. We recommend using cgroups to do container-local accounting.
33+ LimitNPROC =infinity
34+ LimitCORE =infinity
35+ LimitNOFILE =infinity
36+ # Comment TasksMax if your systemd version does not supports it.
37+ # Only systemd 226 and above support this version.
38+ TasksMax =infinity
39+ OOMScoreAdjust =-999
40+
41+ [Install]
42+ WantedBy =multi-user.target
Original file line number Diff line number Diff line change 1818 "cache_container_images" : null ,
1919 "cni_plugin_version" : null ,
2020 "containerd_version" : null ,
21+ "install_containerd_from_s3" : null ,
2122 "creator" : null ,
2223 "docker_version" : null ,
2324 "enable_fips" : null ,
205206 " CACHE_CONTAINER_IMAGES={{user `cache_container_images`}}" ,
206207 " CNI_PLUGIN_VERSION={{user `cni_plugin_version`}}" ,
207208 " CONTAINERD_VERSION={{user `containerd_version`}}" ,
209+ " INSTALL_CONTAINERD_FROM_S3={{user `install_containerd_from_s3`}}" ,
208210 " DOCKER_VERSION={{user `docker_version`}}" ,
209211 " KUBERNETES_BUILD_DATE={{user `kubernetes_build_date`}}" ,
210212 " KUBERNETES_VERSION={{user `kubernetes_version`}}" ,
Original file line number Diff line number Diff line change 1313 "binary_bucket_region" : " us-west-2" ,
1414 "cache_container_images" : " false" ,
1515 "cni_plugin_version" : " v1.2.0" ,
16- "containerd_version" : " 1.7.*" ,
16+ "containerd_version" : " 1.7.27" ,
17+ "install_containerd_from_s3" : " false" ,
1718 "creator" : " {{env `USER`}}" ,
1819 "docker_version" : " none" ,
1920 "enable_fips" : " false" ,
Original file line number Diff line number Diff line change 146146# ##############################################################################
147147# ## Containerd setup ##########################################################
148148# ##############################################################################
149-
150149sudo dnf install -y runc-${RUNC_VERSION}
151- sudo dnf install -y containerd-${CONTAINERD_VERSION}
152- sudo dnf versionlock containerd-*
150+ if [[ " $INSTALL_CONTAINERD_FROM_S3 " == " true" ]]; then
151+ CONTAINERD_BINARIES=(
152+ containerd
153+ containerd-shim-runc-v2
154+ ctr
155+ )
156+ for binary in " ${CONTAINERD_BINARIES[@]} " ; do
157+ echo " Installing containerd from S3..."
158+ aws s3 cp --region ${BINARY_BUCKET_REGION} s3://${BINARY_BUCKET_NAME} /containerd/${CONTAINERD_VERSION} /${MACHINE} /${binary} .
159+ sudo chmod +x $binary
160+ sudo mv $binary /usr/bin/
161+ # exclude containerd from yum.conf as versionlock doesn't work in this case
162+ echo " exclude=containerd*" | sudo tee -a /etc/dnf/dnf.conf
163+ done
164+ sudo mkdir -p /var/lib/containerd
165+ else
166+ sudo dnf install -y containerd-${CONTAINERD_VERSION}
167+ sudo dnf versionlock containerd-*
168+ fi
153169
154170sudo systemctl enable ebs-initialize-bin@containerd
155171
Original file line number Diff line number Diff line change 1+ # Copyright The containerd Authors.
2+ #
3+ # Licensed under the Apache License, Version 2.0 (the "License");
4+ # you may not use this file except in compliance with the License.
5+ # You may obtain a copy of the License at
6+ #
7+ # http://www.apache.org/licenses/LICENSE-2.0
8+ #
9+ # Unless required by applicable law or agreed to in writing, software
10+ # distributed under the License is distributed on an "AS IS" BASIS,
11+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ # See the License for the specific language governing permissions and
13+ # limitations under the License.
14+
15+ [Unit]
16+ Description =containerd container runtime
17+ Documentation =https://containerd.io
18+ After =network.target local-fs.target dbus.service
19+
20+ [Service]
21+ #uncomment to enable the experimental sbservice (sandboxed) version of containerd/cri integration
22+ #Environment="ENABLE_CRI_SANDBOXES=sandboxed"
23+ ExecStartPre =-/sbin/modprobe overlay
24+ ExecStart =/usr/bin/containerd
25+
26+ Type =notify
27+ Delegate =yes
28+ KillMode =process
29+ Restart =always
30+ RestartSec =5
31+ # Having non-zero Limit*s causes performance problems due to accounting overhead
32+ # in the kernel. We recommend using cgroups to do container-local accounting.
33+ LimitNPROC =infinity
34+ LimitCORE =infinity
35+ LimitNOFILE =infinity
36+ # Comment TasksMax if your systemd version does not supports it.
37+ # Only systemd 226 and above support this version.
38+ TasksMax =infinity
39+ OOMScoreAdjust =-999
40+
41+ [Install]
42+ WantedBy =multi-user.target
Original file line number Diff line number Diff line change 1515 "binary_bucket_name" : null ,
1616 "binary_bucket_region" : null ,
1717 "containerd_version" : null ,
18+ "install_containerd_from_s3" : null ,
1819 "creator" : null ,
1920 "enable_accelerator" : null ,
2021 "enable_efa" : null ,
208209 " BINARY_BUCKET_NAME={{user `binary_bucket_name`}}" ,
209210 " BINARY_BUCKET_REGION={{user `binary_bucket_region`}}" ,
210211 " CONTAINERD_VERSION={{user `containerd_version`}}" ,
212+ " INSTALL_CONTAINERD_FROM_S3={{user `install_containerd_from_s3`}}" ,
211213 " KUBERNETES_BUILD_DATE={{user `kubernetes_build_date`}}" ,
212214 " KUBERNETES_VERSION={{user `kubernetes_version`}}" ,
213215 " RUNC_VERSION={{user `runc_version`}}" ,
Original file line number Diff line number Diff line change 1010 "aws_session_token" : " {{env `AWS_SESSION_TOKEN`}}" ,
1111 "binary_bucket_name" : " amazon-eks" ,
1212 "binary_bucket_region" : " us-west-2" ,
13- "containerd_version" : " 1.7.*" ,
13+ "containerd_version" : " 1.7.27" ,
14+ "install_containerd_from_s3" : " false" ,
1415 "creator" : " {{env `USER`}}" ,
1516 "enable_accelerator" : " " ,
1617 "enable_efa" : " false" ,
You can’t perform that action at this time.
0 commit comments