Skip to content

Commit 8d79f1c

Browse files
author
Lis
authored
feat(platform): support containerd as runtime (#1390)
1 parent 7976f7d commit 8d79f1c

File tree

32 files changed

+884
-401
lines changed

32 files changed

+884
-401
lines changed

api/openapi/zz_generated.openapi.go

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/platform/types.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,13 @@ const (
227227
GPUVirtual GPUType = "Virtual"
228228
)
229229

230+
type ContainerRuntimeType = string
231+
232+
const (
233+
Containerd ContainerRuntimeType = "containerd"
234+
Docker ContainerRuntimeType = "docker"
235+
)
236+
230237
// ClusterPhase defines the phase of cluster constructor.
231238
type ClusterPhase string
232239

@@ -384,6 +391,8 @@ type ClusterFeature struct {
384391
// +optional
385392
EnableCilium bool
386393
// +optional
394+
ContainerRuntime ContainerRuntimeType
395+
// +optional
387396
IPv6DualStack bool
388397
// Upgrade control upgrade process.
389398
// +optional

api/platform/v1/generated.pb.go

Lines changed: 406 additions & 365 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/platform/v1/generated.proto

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/platform/v1/types.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,13 @@ const (
233233
GPUVirtual GPUType = "Virtual"
234234
)
235235

236+
type ContainerRuntimeType = string
237+
238+
const (
239+
Containerd ContainerRuntimeType = "containerd"
240+
Docker ContainerRuntimeType = "docker"
241+
)
242+
236243
// ClusterPhase defines the phase of cluster constructor.
237244
type ClusterPhase string
238245

@@ -391,6 +398,8 @@ type ClusterFeature struct {
391398
IPv6DualStack bool `json:"ipv6DualStack,omitempty" protobuf:"bytes,13,opt,name=ipv6DualStack"`
392399
// +optional
393400
EnableCilium bool `json:"enableCilium,omitempty" protobuf:"bytes,14,opt,name=enableCilium"`
401+
// +optional
402+
ContainerRuntime ContainerRuntimeType `json:"containerRuntime,omitempty" protobuf:"bytes,15,opt,name=containerRuntime"`
394403
// Upgrade control upgrade process.
395404
// +optional
396405
Upgrade Upgrade `json:"upgrade,omitempty" protobuf:"bytes,22,opt,name=upgrade"`

api/platform/v1/zz_generated.conversion.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/docker/tools/provider-res/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ COPY linux-arm64/conntrack-tools-*.tar.gz res/linux-arm64/
2929
COPY linux-amd64/docker-*.tar.gz res/linux-amd64/
3030
COPY linux-arm64/docker-*.tar.gz res/linux-arm64/
3131

32+
COPY linux-amd64/containerd-*.tar.gz res/linux-amd64/
33+
COPY linux-arm64/containerd-*.tar.gz res/linux-arm64/
34+
35+
COPY linux-amd64/critools-*.tar.gz res/linux-amd64/
36+
COPY linux-arm64/critools-*.tar.gz res/linux-arm64/
37+
3238
COPY linux-amd64/kubernetes-*.tar.gz res/linux-amd64/
3339
COPY linux-arm64/kubernetes-*.tar.gz res/linux-arm64/
3440

build/docker/tools/provider-res/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# specific language governing permissions and limitations under the License.
1616

1717
IMAGE = provider-res
18-
VERSION = v1.20.4-1
18+
VERSION = v1.20.4-2
1919
REGISTRY_PREFIX ?= tkestack
2020

2121
COMMON_SELF_DIR := $(dir $(lastword $(MAKEFILE_LIST)))

build/docker/tools/provider-res/download.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,38 @@ function download::docker() {
5656
done
5757
}
5858

59+
function download::containerd() {
60+
if [ "${arch}" == "amd64" ]; then
61+
containerd_arch=amd64
62+
elif [ "${arch}" == "arm64" ]; then
63+
containerd_arch=amd64
64+
else
65+
echo "[ERROR] Fail to get containerd ${arch} on ${platform} platform."
66+
exit 255
67+
fi
68+
69+
for version in ${CONTAINERD_VERSIONS}; do
70+
wget -c "https://github.com/containerd/containerd/releases/download/v${version}/containerd-${version}-linux-${containerd_arch}.tar.gz" \
71+
-O "containerd-${platform}-${version}.tar.gz"
72+
done
73+
}
74+
75+
function download::critools() {
76+
if [ "${arch}" == "amd64" ]; then
77+
critools_arch=amd64
78+
elif [ "${arch}" == "arm64" ]; then
79+
critools_arch=arm
80+
else
81+
echo "[ERROR] Fail to get critools ${arch} on ${platform} platform."
82+
exit 255
83+
fi
84+
85+
for version in ${CRITOOLS_VERSIONS}; do
86+
wget -c "https://github.com/kubernetes-sigs/cri-tools/releases/download/${version}/crictl-${version}-linux-${critools_arch}.tar.gz" \
87+
-O "critools-${platform}-${version}.tar.gz"
88+
done
89+
}
90+
5991
function download::kubernetes() {
6092
for version in ${K8S_VERSIONS}; do
6193
if [[ "${version}" =~ "tke" ]]; then
@@ -115,6 +147,8 @@ for os in ${OSS}; do
115147

116148
download::cni_plugins
117149
download::docker
150+
download::containerd
151+
download::critools
118152
download::kubernetes
119153
download::nvidia_driver
120154
download::nvidia_container_runtime

build/docker/tools/tke-installer/release.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ set -o pipefail
2323
REGISTRY_PREFIX=${REGISTRY_PREFIX:-tkestack}
2424
BUILDER=${BUILDER:-default}
2525
VERSION=${VERSION:-$(git describe --dirty --always --tags | sed 's/-/./g')}
26-
PROVIDER_RES_VERSION=v1.20.4-1
26+
PROVIDER_RES_VERSION=v1.20.4-2
2727
K8S_VERSION=${PROVIDER_RES_VERSION%-*}
2828
DOCKER_VERSION=19.03.14
2929
OSS=(linux)

0 commit comments

Comments
 (0)