我们通过gitlab CICD部署服务到kubernetes,使用gitlab-runner执行构建任务时,如果提供了中间缓存服务,将caches缓存文件上传到缓存服务,通常会出现下面的报错
“ Uploading cache.zip to http://storage.123.art/gitlab-runner-caches/project/23/maven-caches FATAL: received: 413 Request Entity Too Large ”
image.png

我们通常可以采用下面两种方式来解决:

Step 1: Set the maximum artifacts size

In your gitlab, go to Settings > Continuous Integration and Deployment > Maximum artifacts size (MB) and set it to the desired value. The default is 100MB
image.png

Step 2: Set the nginx upload size

In the gitlab.rb file, mine at /etc/gitlab/gitlab.rb等同与/var/opt/gitlab/nginx/conf/nginx.conf, set or uncomment the following line.

  1. vim /etc/gitlab/gitlab.rb
  2. ......
  3. nginx['client_max_body_size'] = '2048m'
  4. .....
  5. #重新加载配置
  6. gitlab-ctl reconfigure
  7. #重启gitlab
  8. gitlab-ctl restart
  9. #查看状态
  10. gitlab-ctl status