Apinto 完全基于 Golang 开发,不基于现有第三方产品,因此具有外部依赖少,部署简单等特点。
各位可以通过以下方式进行部署:
下载官方提供的安装包安装(推荐)
1.下载安装包并解压,
wget https://github.com/eolinker/apinto/releases/download/v0.12.1/apinto_v0.12.1_linux_amd64.tar.gz && tar -zxvf apinto_v0.12.1_linux_amd64.tar.gz && cd apinto
Apinto 支持在 arm64、amd64 架构上运行。
请根据需要下载对应架构及系统的安装包,安装包下载请前往:https://github.com/eolinker/apinto
2.安装网关:
./install.sh install
执行该步骤将会生成配置文件 /etc/apinto/apinto.yml
和 /etc/apinto/config.yml
,可根据需要修改。
3.启动
apinto start
备注:若网关启动不成功可以在 /var/log/apinto 目录下的日志文件排查原因,一般是路由监听端口被占用的情况,可以在 apinto 执行文件相同目录下的 config.yml 修改路由监听端口。
编译源码进行安装
访问 https://github.com/eolinker/apinto,下载源码后可执行编译脚本或者打包成安装包
1.从官方 github 仓库 clone 源码并且进入到项目中
git clone https://github.com/eolinker/apinto.git && cd apinto
2.编译脚本,编译后的可执行文件输出到当前目录下的 out 文件夹内
./build/cmd/build.sh
3.进入程序所在目录并且运行程序
cd out
cd apinto-{time_stamp} #apinto-{time_stamp}目录是按编译时间生成的
cp config.yml.tmp config.yml #拷贝模板配置文件作为程序运行的配置文件
./apinto start
备注:由于代码会不定时更新,不推荐使用该方式进行安装。
Docker
Docker 部署教程点此进行跳转
Kubernetes 集群部署应用
APINTO 容器有两个可挂载的目录:
-
/var/lib/apinto
:目录内有 data(数据文件放置目录),log(日志放置目录),extends(扩展仓库目录) -
/etc/apinto
:存放了config.yml 文件,该文件用于指定节点的路由监听端口,ssl 证书等信息。
备注:/etc/apinto
目录不挂载的话将会使用默认配置文件,默认 admin 端口为 9400,http 端口为 8080。
创建 Service
以 NodePort 类型为例,端口配置请以应用的配置文件为标准。
注意:该服务需要与 APINTO 的 pod 在同一命名空间内。
apiVersion: v1
kind: Service
metadata:
name: apinto-gateway-svc #服务名
spec:
selector:
app: apinto-gate