下载离线k8s1.31的镜像包

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
#!/bin/sh
for image in `kubeadm config images list --kubernetes-version=$1`
do
  image_name=`echo ${image} | sed "s/k8s.gcr.io.//g"`
  docker pull "${image}"
  docker tag "${image}" "${image_name}"
  file_name="${image_name}.tgz"
  docker save "${image_name}" | gzip > "${file_name}"
  docker rmi "${image}"
  docker rmi "${image_name}"
done

启用下载镜像

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
./downk8simg.sh v1.31.0
./downk8simg.sh: line 8: registry.k8s.io/kube-apiserver:v1.31.0.tgz: No such file or directory
Untagged: registry.k8s.io/kube-apiserver:v1.31.0
Deleted: sha256:470179274deb9dc3a81df55cfc24823ce153147d4ebf2ed649a4f271f51eaddf
Error response from daemon: No such image: registry.k8s.io/kube-apiserver:v1.31.0
v1.31.0: Pulling from kube-controller-manager
cc5896ab1d4b: Download complete
2bdf44d7aa71: Download complete
4aa0ea1413d3: Download complete
9aee425378d2: Download complete
5664b15f108b: Download complete
27be814a09eb: Download complete
058cf3d8c2ba: Download complete
3f4e2c586348: Download complete
b6824ed73363: Download complete
8801f2e6d7f8: Download complete
b2ce0e066077: Download complete
33e068de2649: Download complete
7c12895b777b: Download complete
Digest: sha256:f6f3c33dda209e8434b83dacf5244c03b59b0018d93325ff21296a142b68497d
Status: Downloaded newer image for registry.k8s.io/kube-controller-manager:v1.31.0
registry.k8s.io/kube-controller-manager:v1.31.0
./downk8simg.sh: line 8: registry.k8s.io/kube-controller-manager:v1.31.0.tgz: No such file or directory
Untagged: registry.k8s.io/kube-controller-manager:v1.31.0
Deleted: sha256:f6f3c33dda209e8434b83dacf5244c03b59b0018d93325ff21296a142b68497d
Error response from daemon: No such image: registry.k8s.io/kube-controller-manager:v1.31.0
v1.31.0: Pulling from kube-scheduler
7c12895b777b: Download complete
9aee425378d2: Download complete
4aa0ea1413d3: Download complete
b6824ed73363: Download complete
058cf3d8c2ba: Download complete
b2ce0e066077: Download complete
2bdf44d7aa71: Download complete
52e1437459d6: Downloading [=======================================>           ]  14.68MB/18.64MB
5664b15f108b: Download complete
33e068de2649: Download complete
27be814a09eb: Download complete
8801f2e6d7f8: Download complete
3f4e2c586348: Download complete
Licensed under CC BY-NC-SA 4.0
最后更新于 Feb 25, 2025 00:42 UTC
comments powered by Disqus
Built with Hugo
主题 StackJimmy 设计
Caret Up