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

kind load image-archive xx1.tar xx2.tar , cannot find xx2.tar's image in container of kind-node #2881

Closed
YunShiHang opened this issue Aug 17, 2022 · 4 comments · May be fixed by #2891
Closed
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@YunShiHang
Copy link

YunShiHang commented Aug 17, 2022

What happened:
docker pull ghcr.io/kubean-io/kubean/spray-job:v0.1.0
docker pull ghcr.io/kubean-io/kubean/kubean-operator:v0.1.0
docker save ghcr.io/kubean-io/kubean/spray-job:v0.1.0 > kubean-job-v0.1.0.tar
docker save ghcr.io/kubean-io/kubean/kubean-operator:v0.1.0 > kubean-operator-v0.1.0.tar

cat /tmp/kind_config.yaml
apiVersion: kind.x-k8s.io/v1alpha4
kind: Cluster
nodes:

  • role: control-plane
    extraPortMappings:
    • containerPort: 30080
      hostPort: 80

kind create cluster --name my-mgmt-cluster-installer --image kindest/node:v1.21.1 --config /tmp/kind_config.yaml

kind load image-archive offline/kubean/kubean-job-v0.1.0.tar offline/kubean/kubean-operator-v0.1.0.tar --name=my-mgmt-cluster-installer

####it's happened:####
docker exec -it my-mgmt-cluster-installer-control-plane bash
crictl images|grep kubean
企业微信截图_16607079917370

####I'll import it offline/kubean/kubean-operator-v0.1.0.tar####

kind load image-archive offline/kubean/kubean-operator-v0.1.0.tar --name=my-mgmt-cluster-installer

####it's happened:####
docker exec -it my-mgmt-cluster-installer-control-plane bash
crictl images|grep kubean
企业微信截图_16607080606723

What you expected to happen:

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

Environment:

  • kind version: (use kind version):
    kind v0.14.0 go1.18.2 linux/amd64

  • Kubernetes version: (use kubectl version):
    Client Version: version.Info{Major:"1", Minor:"24", GitVersion:"v1.24.3", GitCommit:"aef86a93758dc3cb2c658dd9657ab4ad4afc21cb", GitTreeState:"clean", BuildDate:"2022-07-13T14:30:46Z", GoVersion:"go1.18.3", Compiler:"gc", Platform:"linux/amd64"}

  • Docker version: (use docker info):
    Client: Docker Engine - Community
    Version: 20.10.17
    Server: Docker Engine - Community
    Engine:
    Version: 20.10.17

  • OS (e.g. from /etc/os-release):
    [root@shihang-operation ~/dce5-installer/offline]# cat /etc/os-release
    NAME="CentOS Linux"
    VERSION="7 (Core)"
    ID="centos"
    ID_LIKE="rhel fedora"
    VERSION_ID="7"
    PRETTY_NAME="CentOS Linux 7 (Core)"
    ANSI_COLOR="0;31"
    CPE_NAME="cpe:/o:centos:centos:7"
    HOME_URL="https://www.centos.org/"
    BUG_REPORT_URL="https://bugs.centos.org/"
    CENTOS_MANTISBT_PROJECT="CentOS-7"
    CENTOS_MANTISBT_PROJECT_VERSION="7"
    REDHAT_SUPPORT_PRODUCT="centos"
    REDHAT_SUPPORT_PRODUCT_VERSION="7"

@YunShiHang YunShiHang added the kind/bug Categorizes issue or PR as related to a bug. label Aug 17, 2022
@YunShiHang YunShiHang changed the title kind load image-archive xx1 xx2 , cannot find xx2 in container of kind-node kind load image-archive xx1.tar xx2.tar , cannot find xx2.tar's image in container of kind-node Aug 17, 2022
@harshanarayana
Copy link
Contributor

@YunShiHang That is because the code only seem to support loading one archive at a time.

// Check if file exists
imageTarPath := args[0]
if _, err := os.Stat(imageTarPath); err != nil {
return err
}

fns := []func() error{}
for _, selectedNode := range selectedNodes {
selectedNode := selectedNode // capture loop variable
fns = append(fns, func() error {
return loadImage(imageTarPath, selectedNode)
})
}

This can be fixed.

/assign

@BenTheElder
Copy link
Member

FYI you can docker save two images to one tarball which is also more efficient as it deduplicates shared layers

@YunShiHang
Copy link
Author

FYI you can docker save two images to one tarball which is also more efficient as it deduplicates shared layers

Thanks,It has been very helpful to me

@YunShiHang
Copy link
Author

YunShiHang commented Aug 22, 2022

@YunShiHang That is because the code only seem to support loading one archive at a time.

// Check if file exists
imageTarPath := args[0]
if _, err := os.Stat(imageTarPath); err != nil {
return err
}

fns := []func() error{}
for _, selectedNode := range selectedNodes {
selectedNode := selectedNode // capture loop variable
fns = append(fns, func() error {
return loadImage(imageTarPath, selectedNode)
})
}

This can be fixed.

/assign

Thanks,It has been very helpful to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants