kubernetes-sigs / kind

Kubernetes IN Docker - local clusters for testing Kubernetes
https://kind.sigs.k8s.io/
Apache License 2.0
13.32k stars 1.54k forks source link

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

Closed YunShiHang closed 11 months ago

YunShiHang commented 2 years ago

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:

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:

harshanarayana commented 2 years ago

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

https://github.com/kubernetes-sigs/kind/blob/74a8ae82b36e815bff02a7d839c1d518532c922d/pkg/cmd/kind/load/image-archive/image-archive.go#L82-L86

https://github.com/kubernetes-sigs/kind/blob/74a8ae82b36e815bff02a7d839c1d518532c922d/pkg/cmd/kind/load/image-archive/image-archive.go#L120-L126

This can be fixed.

/assign

BenTheElder commented 2 years ago

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

YunShiHang commented 2 years ago

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 commented 2 years ago

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

https://github.com/kubernetes-sigs/kind/blob/74a8ae82b36e815bff02a7d839c1d518532c922d/pkg/cmd/kind/load/image-archive/image-archive.go#L82-L86

https://github.com/kubernetes-sigs/kind/blob/74a8ae82b36e815bff02a7d839c1d518532c922d/pkg/cmd/kind/load/image-archive/image-archive.go#L120-L126

This can be fixed.

/assign

Thanks,It has been very helpful to me