如何使用极狐GitLab Runner 修改日志大小限制

2024-04-09 14:33:22
本文作者:徐晓伟 GitLab 是一个全球知名的一体化 DevOps 平台,很多人都通过私有化部署 GitLab 来进行源代码托管。极狐GitLab 是 GitLab 在中国的发行版,专门为中国程序员服务。可以一键式部署极狐GitLab。 本文讲述了如何调整极狐Gitlab Runner 日志大小限制 问题 测试项目:https://framagit.org/xuxiaowei-com-cn/output-limit ,分支:count-168000 作业异常 说明 根据文档 GitLab Runner 高级配置 的 output_limit 属性可知,日志默认最大大小是 4M 直接下载原始日志,日志大小也是 4M 解决方案 导出 helm gitlab 配置 helm -n gitlab-test get values my-gitlab > my-gitlab.yaml 查看 [极狐gitlab runner 默认配置] # 此处为节选,不同版本可能会存在差异,请以 https://artifacthub.io/packages/helm/gitlab/gitlab?modal=values 中的配置为准 gitlab-runner: runners: config: | [[runners]] [runners.kubernetes] image = "ubuntu:22.04" {{- if .Values.global.minio.enabled }} [runners.cache] Type = "s3" Path = "gitlab-runner" Shared = true [runners.cache.s3] ServerAddress = {{ include "gitlab-runner.cache-tpl.s3ServerAddress" . }} BucketName = "runner-cache" BucketLocation = "us-east-1" Insecure = false {{ end }} 修改 helm gitlab 配置​ gitlab-runner: runners: config: | [[runners]] output_limit = 41943040 [runners.kubernetes] image = "ubuntu:22.04" {{- if .Values.global.minio.enabled }} [runners.cache] Type = "s3" Path = "gitlab-runner" Shared = true [runners.cache.s3] ServerAddress = {{ include "gitlab-runner.cache-tpl.s3ServerAddress" . }} BucketName = "runner-cache" BucketLocation = "us-east-1" Insecure = false {{ end }} 更新 helm gitlab 配置 helm upgrade -n gitlab-test --install my-gitlab gitlab/gitlab -f my-gitlab.yaml --timeout 600s --version 7.7.0 查看修改结果 等待所有 gitlab-runner 旧 pod 删除完成,新 pod 正常运行时,重试流水线,看到没有触发流水线日志大小的限制了 下载日志,可以看到日志大小为 4104 KB,已经超过了 4M 查看产物,可以看到日志大小超过 4M  更多关于极狐GitLab 的最佳实践,请搜索关注【极狐GitLab】公众号或者登录极狐GitLab 官网 https://gitlab.cn 进行学习。
作者:小李
点赞1049
已输入3个字
全部评论
快来抢沙发