我尝试使用 docker-autoscaler 执行器运行 gitlab-runner。我使用fenseing-plugin-aws。我遵循此说明https://docs.gitlab.com/runner/executors/docker_autoscaler.html。我已经配置了自动缩放组并且它可以工作。但作业失败并出现错误:
Running with gitlab-runner 16.6.1 (f5da3c5a)
on autoscaler BN9C-ytN8, system ID: s_bf8d3ace2761
Preparing the "docker-autoscaler" executor
00:10
ERROR: Failed to remove network for build
ERROR: Preparation failed: error during connect: Get "http://internel.tunnel.invalid/v1.24/info": dialing environment connection: ssh: rejected: administratively prohibited (open failed) (docker.go:878:0s)
Will be retried in 3s ...
ERROR: Failed to remove network for build
ERROR: Preparation failed: error during connect: Get "http://internel.tunnel.invalid/v1.24/info": dialing environment connection: ssh: rejected: administratively prohibited (open failed) (docker.go:878:0s)
Will be retried in 3s ...
ERROR: Failed to remove network for build
ERROR: Preparation failed: error during connect: Get "http://internel.tunnel.invalid/v1.24/info": dialing environment connection: ssh: rejected: administratively prohibited (open failed) (docker.go:878:0s)
Will be retried in 3s ...
ERROR: Job failed (system failure): error during connect: Get "http://internel.tunnel.invalid/v1.24/info": dialing environment connection: ssh: rejected: administratively prohibited (open failed) (docker.go:878:0s)
我已经检查了 ASG 中执行程序主机和实例之间的连接。配置的用户可以建立ssh连接并有使用docker的权限。
我能够通过添加用于 SSH 的用户(在我的例子中
ubuntu
到 docker 组中来解决这个问题,例如:
sudo usermod -aG docker ubuntu