docker swarm相比k8s而言,部署和使用都要简单很多,比较适合中小研发团队。
通过连接docker swarm和凌鲨,可以让研发过程中的常用操作更加方便。
- 更新容器镜像
- 调整部署规模
- 查看日志
- 运行命令
使用步骤
部署swarm proxy
你可以通过linksaas / swarm_api_proxy · 极狐GitLab下载源代码,然后编译。
bash
git clone https://jihulab.com/linksaas/swarm_api_proxy.git
cd k8s_api_proxy
go mod tidy
go build
编译完代理程序后,需要编写配置文件:
bash
serverUrl: "tcp://your_docker_addr"
certPath: ""
listenAddr: "0.0.0.0:6002"
linkSaasAddr: linksaas_api_addr
serverUrl支持tpc://和unix://,如果留空默认为unix:///var/run/docker.sock
运行程序
bash
./swarm_api_proxy --config config.yaml serv
连接swarm proxy

授权项目访问
运行命令
bash
./swarm_api_proxy --config config.yaml project add your_project_id
使用

