Rancher creates a downstream k8s cluster of arm architecture

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:

  1. Make sure the network can pull the required image normally
  2. The pulled image must support the arm architecture
    , otherwise an error will be reported: exec /pause: exec format error
  3. 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.
insert image description here

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.
insert image description here

Use a docker image that supports the ARM architecture

docker ps -a |grep ExitedDuring the cluster deployment process, use the and command on the node docker logsto observe the logs of those stopped running containers. If you find exec format errorsuch 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.6this image does not support the arm architecture, and the corresponding arm version can be found in the official website.
    insert image description here
  • docker pull rancher/mirrored-pause:3.6-arm64
    Then docker tag rancher/mirrored-pause:3.6-arm64 rancher/mirrored-pause:3.6replace the mirror.

I have come across images that need to be handled manually:

  • rancher/nginx-ingress-controller
  • rancher/mirrored-pause

Guess you like

Origin blog.csdn.net/l2931050/article/details/131316275