Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the offline saving and loading method of Kubernetes images

2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "what is the offline saving and loading method of Kubernetes image". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what is the offline preservation and loading method of Kubernetes image".

Save the image of Kubernetes offline to a file, and then load it from the file to install it offline (very quickly).

The image of Kubernetes version 1.12.1 is used here, and the corresponding version number can be changed in other versions.

1. Save to file-Save Images

Use the docker save command to save docker images to a file, and the-o parameter indicates the file name.

Before running the following script, it is recommended that you create a separate directory for the image files.

As follows:

Echo "=" echo "Save Kubernetes images to tar." echo "This tool created by https://my.oschina.net/u/2306127"echo" Please visit https://github.com/openthings/kubernetes-tools"echo "# "echo" Kubernetes core system images. "echo"-"echo" A1. > k8s.gcr.io/kube-apiserver:v1.12.1 "sudo docker save k8s.gcr.io/kube-apiserver:v1.12.1-o A1-k8s-kube-apiserver-v1.12.1.tarecho "" echo "A2. > k8s.gcr.io/kube-controller-manager:v1.12.1" sudo docker save k8s.gcr.io/kube-controller-manager:v1.12.1-o A2-k8s-kube-controller-manager-v1.12.1.tarecho "" echo "A3. > k8s.gcr.io/kube-scheduler:v1.12.1" sudo docker save k8s.gcr.io/kube-scheduler:v1.12.1 -o A3-k8s-kube-scheduler-v1.12.1.tarecho "echo" A 4. > k8s.gcr.io/kube-proxy:v1.12.1 "sudo docker save k8s.gcr.io/kube-proxy:v1.12.1-o A4-k8s-kube-proxy-v1.12.1.tarecho"echo" A 5. > k8s.gcr.io/pause:3.1 "sudo docker save k8s.gcr.io/pause:3.1-o A5-k8s-pause-3.1. Tarecho "" echo "A6. > k8s.gcr.io/etcd:3.2.24" sudo docker save k8s.gcr.io/etcd:3.2.24-o A6-k8s-etcd-3.2.24.tarecho "" echo "A7. > k8s.gcr.io/coredns:1.2.2" sudo docker save k8s.gcr.io/coredns:1.2.2-o A7-k8s-coredns-1.2.2.tarecho "" echo "=" echo "B1. > > quay.io/ Coreos/flannel:v0.10.0-amd64 "sudo docker save quay.io/coreos/flannel:v0.10.0-amd64-o B1-flannel-v0.10.0.tarecho"echo" B2. > k8s.gcr.io/kubernetes-dashboard-amd64:v1.10.0 "sudo docker save k8s.gcr.io/kubernetes-dashboard-amd64:v1.10.0-o B2-dashboard-v1.10.0.tarecho"echo" B 3. > gcr.io/kubernetes-helm/tiller:v2. 11.0 "sudo docker save gcr.io/kubernetes-helm/tiller:v2.11.0-o B3-helm-tiller-v2.11.0.tar echo"echo" B4. > quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.14.0 "sudo docker save quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.14.0-o B4-ingress-controller-0.14.0.tarecho"echo" B5. > > k8s.gcr.io/defaultbackend : 1.3 "sudo docker save k8s.gcr.io/defaultbackend:1.3-o B5-k8s-defaultbackend-1.3.tarecho"echo" = "echo" Save kubernetes images Finished. "echo" This tool created by https://my.oschina.net/u/2306127"echo "Please visit https://github.com/openthings/kubernetes-tools"echo" = "echo"

The above A* is the image of the Kubernetes system, and the B* is the image of several commonly used extension modules. If you need other images, you can write a script like the one above.

Save as a file k8s-images-save.sh, and then execute.

2. Copy images

Use a flash drive or network or other network to send images anywhere.

For the establishment of the initial image, please refer to "Kubernetes 1.12.1 Quick upgrade", which can be downloaded from the image repository I built.

IPFS, https://ipfs.io / ipfs/QmUTm9wHwXcwHNzp7Yv9XtrRq5kr9iwGfdh2XdG25NEg5b k8s-images-1.12.1.zip

Test IPFS http://127.0.0.1:8080/ipfs/QmZP1Gk88qdijGLg8L2NiB6ZqhK4HsUN39DsEdH5rxn9C8

Http://127.0.0.1:8080/ipfs/QmSDhnmQ3oJWpiC1V4DnU7714L6qYUC7JBB4oRLMLLGGYa/Oracle_VM_VirtualBox_Extension_Pack-5.2.18.vbox-extpack

Http://127.0.0.1:8080/ipfs/QmSDhnmQ3oJWpiC1V4DnU7714L6qYUC7JBB4oRLMLLGGYa

Download the network disk (with decompression and recovery script), https://pan.baidu.com/s/1Eo0PAAGcIxOQqHn-QwhDeA

Using the script k8s-images-load.sh in the zip package, you can quickly restore the image to docker images.

3. Load from file-Load Images

Use the docker load command to load the docker images,-i parameter from the file to indicate the source file name. As follows:

Echo "=" echo "Load Kubernetes images from tar." echo "This tool created by https://my.oschina.net/u/2306127"echo" Please visit https://github.com/openthings/kubernetes-tools"echo "# "echo" Kubernetes core system images. "echo"-"echo" A1

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report