Table of contents
foreword
It took some time to successfully build a k8s cluster on a Huawei Cloud arm architecture server. During this period, problems continued. The following are three key points:
- Make sure the network can pull the required image normally
- The pulled image must support the arm architecture
, otherwise an error will be reported: exec /pause: exec format error - The cluster network driver should choose flannel
Add a custom cluster
Rancher version: v2.5.15
I won’t go into details about the specific operations on Rancher. If you don’t understand, please refer to "Rancher Operation Guide (1): Quickly Build a k8s Cluster" . If you don’t use Rancher, you can use RKE to deploy a k8s cluster. The problems you encounter are similar.
The following is a key point. The cluster network driver should choose flannel. The default Cannal has been unsuccessful before.
Mirror source configuration
The k8s cluster server must ensure that the image can be pulled normally. Due to the network problem of the private image warehouse I use, some images cannot be pulled. I checked the container log to find the problem.
After trying several domestic image sources, I couldn’t download the image normally. Finally, after configuring the image accelerator of Alibaba Cloud, it became normal.
Open the accelerator address: https://cr.console.aliyun.com/cn-hangzhou/instances/mirrors
need to open the mirror service first, this is free.
Use a docker image that supports the ARM architecture
docker ps -a |grep Exited
During the cluster deployment process, use the and command on the node docker logs
to observe the logs of those stopped running containers. If you find exec format error
such errors, it means that the image does not support the arm architecture. You need to obtain the image corresponding to the arm architecture from the official warehouse, and overwrite the original image.
- For example,
rancher/mirrored-pause:3.6
this image does not support the arm architecture, and the corresponding arm version can be found in the official website.
docker pull rancher/mirrored-pause:3.6-arm64
Thendocker tag rancher/mirrored-pause:3.6-arm64 rancher/mirrored-pause:3.6
replace the mirror.
I have come across images that need to be handled manually:
- rancher/nginx-ingress-controller
- rancher/mirrored-pause