mirror of https://github.com/kubernetes/kops.git
Install contained from the release package
Signed-off-by: Ciprian Hacman <ciprian@hakman.dev>
This commit is contained in:
parent
acb79e7197
commit
5746093297
|
|
@ -107,8 +107,12 @@ func (b *ContainerdBuilder) installContainerd(c *fi.ModelBuilderContext) error {
|
|||
|
||||
// Add binaries from assets
|
||||
if b.Cluster.Spec.ContainerRuntime == "containerd" {
|
||||
// Add containerd binaries from containerd package
|
||||
f := b.Assets.FindMatches(regexp.MustCompile(`^(\./)?usr/local/bin/(containerd|crictl|ctr)`))
|
||||
// Add containerd binaries from containerd release package
|
||||
f := b.Assets.FindMatches(regexp.MustCompile(`^bin/(containerd|ctr)`))
|
||||
if len(f) == 0 {
|
||||
// Add containerd binaries from containerd bundle package
|
||||
f = b.Assets.FindMatches(regexp.MustCompile(`^(\./)?usr/local/bin/(containerd|crictl|ctr)`))
|
||||
}
|
||||
if len(f) == 0 {
|
||||
// Add containerd binaries from Docker package (for ARM64 builds < v1.6.0)
|
||||
// https://github.com/containerd/containerd/pull/6196
|
||||
|
|
@ -144,7 +148,7 @@ func (b *ContainerdBuilder) installContainerd(c *fi.ModelBuilderContext) error {
|
|||
}
|
||||
for _, v := range f {
|
||||
fileTask := &nodetasks.File{
|
||||
Path: "/usr/bin/runc",
|
||||
Path: "/usr/sbin/runc",
|
||||
Contents: v,
|
||||
Type: nodetasks.FileType_File,
|
||||
Mode: fi.String("0755"),
|
||||
|
|
|
|||
|
|
@ -154,14 +154,12 @@ func runContainerdBuilderTest(t *testing.T, key string, distro distributions.Dis
|
|||
nodeUpModelContext.Distribution = distro
|
||||
|
||||
nodeUpModelContext.Assets = fi.NewAssetStore("")
|
||||
nodeUpModelContext.Assets.AddForTest("containerd", "usr/local/bin/containerd", "testing containerd content")
|
||||
nodeUpModelContext.Assets.AddForTest("containerd-shim", "usr/local/bin/containerd-shim", "testing containerd content")
|
||||
nodeUpModelContext.Assets.AddForTest("containerd-shim-runc-v1", "usr/local/bin/containerd-shim-runc-v1", "testing containerd content")
|
||||
nodeUpModelContext.Assets.AddForTest("containerd-shim-runc-v2", "usr/local/bin/containerd-shim-runc-v2", "testing containerd content")
|
||||
nodeUpModelContext.Assets.AddForTest("crictl", "usr/local/bin/crictl", "testing containerd content")
|
||||
nodeUpModelContext.Assets.AddForTest("critest", "usr/local/bin/critest", "testing containerd content")
|
||||
nodeUpModelContext.Assets.AddForTest("ctr", "usr/local/bin/ctr", "testing containerd content")
|
||||
nodeUpModelContext.Assets.AddForTest("runc", "usr/local/sbin/runc", "testing containerd content")
|
||||
nodeUpModelContext.Assets.AddForTest("containerd", "bin/containerd", "testing containerd content")
|
||||
nodeUpModelContext.Assets.AddForTest("containerd-shim", "bin/containerd-shim", "testing containerd content")
|
||||
nodeUpModelContext.Assets.AddForTest("containerd-shim-runc-v1", "bin/containerd-shim-runc-v1", "testing containerd content")
|
||||
nodeUpModelContext.Assets.AddForTest("containerd-shim-runc-v2", "bin/containerd-shim-runc-v2", "testing containerd content")
|
||||
nodeUpModelContext.Assets.AddForTest("containerd-stress", "bin/containerd-stress", "testing containerd content")
|
||||
nodeUpModelContext.Assets.AddForTest("ctr", "bin/ctr", "testing containerd content")
|
||||
nodeUpModelContext.Assets.AddForTest("runc.amd64", "https://github.com/opencontainers/runc/releases/download/v1.1.0/runc.amd64", "testing runc content")
|
||||
|
||||
if err := nodeUpModelContext.Init(); err != nil {
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ type: file
|
|||
---
|
||||
contents:
|
||||
Asset:
|
||||
AssetPath: usr/local/bin/containerd
|
||||
AssetPath: bin/containerd
|
||||
Key: containerd
|
||||
mode: "0755"
|
||||
path: /usr/bin/containerd
|
||||
|
|
@ -75,7 +75,7 @@ type: file
|
|||
---
|
||||
contents:
|
||||
Asset:
|
||||
AssetPath: usr/local/bin/containerd-shim
|
||||
AssetPath: bin/containerd-shim
|
||||
Key: containerd-shim
|
||||
mode: "0755"
|
||||
path: /usr/bin/containerd-shim
|
||||
|
|
@ -83,7 +83,7 @@ type: file
|
|||
---
|
||||
contents:
|
||||
Asset:
|
||||
AssetPath: usr/local/bin/containerd-shim-runc-v1
|
||||
AssetPath: bin/containerd-shim-runc-v1
|
||||
Key: containerd-shim-runc-v1
|
||||
mode: "0755"
|
||||
path: /usr/bin/containerd-shim-runc-v1
|
||||
|
|
@ -91,7 +91,7 @@ type: file
|
|||
---
|
||||
contents:
|
||||
Asset:
|
||||
AssetPath: usr/local/bin/containerd-shim-runc-v2
|
||||
AssetPath: bin/containerd-shim-runc-v2
|
||||
Key: containerd-shim-runc-v2
|
||||
mode: "0755"
|
||||
path: /usr/bin/containerd-shim-runc-v2
|
||||
|
|
@ -99,15 +99,15 @@ type: file
|
|||
---
|
||||
contents:
|
||||
Asset:
|
||||
AssetPath: usr/local/bin/crictl
|
||||
Key: crictl
|
||||
AssetPath: bin/containerd-stress
|
||||
Key: containerd-stress
|
||||
mode: "0755"
|
||||
path: /usr/bin/crictl
|
||||
path: /usr/bin/containerd-stress
|
||||
type: file
|
||||
---
|
||||
contents:
|
||||
Asset:
|
||||
AssetPath: usr/local/bin/ctr
|
||||
AssetPath: bin/ctr
|
||||
Key: ctr
|
||||
mode: "0755"
|
||||
path: /usr/bin/ctr
|
||||
|
|
@ -118,7 +118,7 @@ contents:
|
|||
AssetPath: https://github.com/opencontainers/runc/releases/download/v1.1.0/runc.amd64
|
||||
Key: runc.amd64
|
||||
mode: "0755"
|
||||
path: /usr/bin/runc
|
||||
path: /usr/sbin/runc
|
||||
type: file
|
||||
---
|
||||
contents: |2
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ func (b *ContainerdOptionsBuilder) BuildOptions(o interface{}) error {
|
|||
// Set version based on Kubernetes version
|
||||
if fi.StringValue(containerd.Version) == "" {
|
||||
if b.IsKubernetesGTE("1.23") {
|
||||
containerd.Version = fi.String("1.6.0-rc.3")
|
||||
containerd.Version = fi.String("1.6.0-rc.4")
|
||||
} else {
|
||||
containerd.Version = fi.String("1.4.12")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,10 +30,11 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
// containerd packages URLs for v1.6.x+
|
||||
containerdReleaseUrlAmd64 = "https://github.com/containerd/containerd/releases/download/v%s/containerd-%s-linux-amd64.tar.gz"
|
||||
containerdReleaseUrlArm64 = "https://github.com/containerd/containerd/releases/download/v%s/containerd-%s-linux-arm64.tar.gz"
|
||||
// containerd packages URLs for v1.4.x+
|
||||
containerdVersionUrlAmd64 = "https://github.com/containerd/containerd/releases/download/v%s/cri-containerd-cni-%s-linux-amd64.tar.gz"
|
||||
// containerd packages URLs for v1.6.x (ARM64)+
|
||||
containerdVersionUrlArm64 = "https://github.com/containerd/containerd/releases/download/v%s/cri-containerd-cni-%s-linux-arm64.tar.gz"
|
||||
containerdBundleUrlAmd64 = "https://github.com/containerd/containerd/releases/download/v%s/cri-containerd-cni-%s-linux-amd64.tar.gz"
|
||||
// containerd legacy packages URLs for v1.2.x and v1.3.x
|
||||
containerdLegacyUrlAmd64 = "https://storage.googleapis.com/cri-containerd-release/cri-containerd-%s.linux-amd64.tar.gz"
|
||||
// containerd version that is available for both AMD64 and ARM64, used in case the selected version is not available for ARM64
|
||||
|
|
@ -118,14 +119,16 @@ func findContainerdVersionUrl(arch architectures.Architecture, version string) (
|
|||
var u string
|
||||
switch arch {
|
||||
case architectures.ArchitectureAmd64:
|
||||
if sv.GTE(semver.MustParse("1.3.8")) {
|
||||
u = fmt.Sprintf(containerdVersionUrlAmd64, version, version)
|
||||
if sv.GTE(semver.MustParse("1.6.0-beta.2")) {
|
||||
u = fmt.Sprintf(containerdReleaseUrlAmd64, version, version)
|
||||
} else if sv.GTE(semver.MustParse("1.3.8")) {
|
||||
u = fmt.Sprintf(containerdBundleUrlAmd64, version, version)
|
||||
} else {
|
||||
u = fmt.Sprintf(containerdLegacyUrlAmd64, version)
|
||||
}
|
||||
case architectures.ArchitectureArm64:
|
||||
if sv.GTE(semver.MustParse("1.6.0-beta.2")) {
|
||||
u = fmt.Sprintf(containerdVersionUrlArm64, version, version)
|
||||
u = fmt.Sprintf(containerdReleaseUrlArm64, version, version)
|
||||
} else if findAllContainerdHashesAmd64()[version] != "" {
|
||||
if findAllContainerdDockerMappings()[version] != "" {
|
||||
u = fmt.Sprintf(dockerVersionUrlArm64, findAllContainerdDockerMappings()[version])
|
||||
|
|
@ -206,7 +209,7 @@ func findAllContainerdHashesAmd64() map[string]string {
|
|||
"1.5.7": "7fce75bab43a39d6f9efb3c370de2da49723f0e1dbaa9732d68fa7f620d720c8",
|
||||
"1.5.8": "5dbb7f43c0ac1fda79999ff63e648926e3464d7d1034402ee2117e6a93868431",
|
||||
"1.5.9": "f64c8e3b736b370c963b08c33ac70f030fc311bc48fcfd00461465af2fff3488",
|
||||
"1.6.0-rc.3": "ead57ce46ebb92979dfdb35c1a9eac70a3a68086508da693ce75c7d8b7b2e790",
|
||||
"1.6.0-rc.4": "55d0c0abbe6008ce6f687c8b7ad5527256a07b4d1b56414cc467e0d793b9a3b5",
|
||||
}
|
||||
|
||||
return hashes
|
||||
|
|
@ -214,7 +217,7 @@ func findAllContainerdHashesAmd64() map[string]string {
|
|||
|
||||
func findAllContainerdHashesArm64() map[string]string {
|
||||
hashes := map[string]string{
|
||||
"1.6.0-rc.3": "09fdff397546466f3ee76535aad5236192700f65727cd3068193ae204cd8fda9",
|
||||
"1.6.0-rc.4": "9fb80ef87a2fd56bef1fac6b8061541cf9f8339a3d3b73312733fc5f5b16f60a",
|
||||
}
|
||||
|
||||
return hashes
|
||||
|
|
|
|||
Loading…
Reference in New Issue