Skip to content

Build Nacos-peer-finder-plugin for ARM64 architecture

In the previous article, we have learnt how to install Nacos on the single node of the Kubernetes environment, which was an x86 platform. but with the architecture and ecosystem of ARM is getting better now, deploying applications on the arm64 environment is becoming popular. When deploying Nacos on the arm64 server, I didn’t find any Docker image for Nacos peer finder plugin, officials didn’t provide either. I had to ‘DIY’ it. This was one of our projects and it has been running well in the production environment.

What Nacos-peer-finder-plugin

Nacos peer finder plugin is used to search other Nacos pods. the core of this plugin is peer-finder, an open-source software, written by Go. all it does is watch DNS for changes in the set of endpoints that are part of the service of Statefulset. It periodically looks up the SRV record of DNS entry that corresponds to a Kubernetes service which lists the set of peers for this specified service.

Dockerfile

The peer-finder has a pre-build application for arm64, we don’t need to compile it again. the only thing we need to do is write a Dockerfile and build. you can clone all files from my repository, nacos-peer-finder-plugin-arm64.

FROM centos:7
LABEL maintainer="liuzheng <anson.liu@live.com>"
ADD ./on-start.sh /
ADD ./on-change.sh /
ADD ./plugin.sh /
COPY ./peer-finder /
ADD install.sh /
RUN chmod  755 /install.sh /on-start.sh /on-change.sh /plugin.sh /peer-finder
ENTRYPOINT ["/install.sh"]

Build and Push

use docker build command to build image and then push to Docker Hub. the image tag is the same as the peer-finder version.

docker build -t nacos-peer-finder-plugin-arm64:1.1 .
docker push nacos-peer-finder-plugin-arm64:1.1

You can pull this image from Docker Hub directly.