我们通过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 ”
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
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.
vim /etc/gitlab/gitlab.rb
......
nginx['client_max_body_size'] = '2048m'
.....
#重新加载配置
gitlab-ctl reconfigure
#重启gitlab
gitlab-ctl restart
#查看状态
gitlab-ctl status