如何备份极狐GitLab 信任域名证书

生成对抗
• 阅读 126
本文作者:徐晓伟

GitLab 是一个全球知名的一体化 DevOps 平台,很多人都通过私有化部署 GitLab 来进行源代码托管。极狐GitLab GitLab 在中国的发行版,专门为中国程序员服务。可以一键式部署极狐GitLab。

本文主要讲述了如何使用极狐GitLab 备份数据时,信任 MinIO 域名证书。

文档

  1. s3cmd

问题

  1. 参见:极狐GitLab 启用 自动备份功能

配置

查看现有备份

kubectl -n gitlab-test get cronjobs.batch
[root@anolis-7-9 ~]# kubectl -n gitlab-test get cronjobs.batch
NAME                       SCHEDULE    SUSPEND   ACTIVE   LAST SCHEDULE   AGE
my-gitlab-toolbox-backup   0 1 * * *   False     0        <none>          41m
[root@anolis-7-9 ~]# 

修改配置,跳过证书验证

kubectl -n gitlab-test edit cronjobs.batch my-gitlab-toolbox-backup

原始配置

        spec:
          containers:
            - args:
                - /bin/bash
                - -c
                - cp /etc/gitlab/.s3cfg $HOME/.s3cfg && backup-utility

修改后

        spec:
          containers:
            - args:
                - /bin/bash
                - -c
                - cp /etc/gitlab/.s3cfg $HOME/.s3cfg && echo "check_ssl_certificate=false" >> $HOME/.s3cfg && backup-utility

重新执行备份程序

查看日志

[root@anolis-7-9 ~]# kubectl -n gitlab-test logs -f manual-backup-1-9db78
Defaulted container "toolbox-backup" out of: toolbox-backup, certificates (init), configure (init)
Begin parsing .erb templates from /var/opt/gitlab/templates
Writing /srv/gitlab/config/cable.yml
Writing /srv/gitlab/config/database.yml
Writing /srv/gitlab/config/gitlab.yml
Writing /srv/gitlab/config/resque.yml
Begin parsing .tpl templates from /var/opt/gitlab/templates
Copying other config files found in /var/opt/gitlab/templates to /srv/gitlab/config
Copying smtp_settings.rb into /srv/gitlab/config
Attempting to run '/bin/bash -c cp /etc/gitlab/.s3cfg $HOME/.s3cfg && echo "check_ssl_certificate=false" >> $HOME/.s3cfg && backup-utility' as a main process
2023-12-25 14:17:05 +0800 -- Dumping database ...
pg_dump: warning: could not find where to insert IF EXISTS in statement "-- *not* dropping schema, since initdb creates it
"
Dumping PostgreSQL database gitlabhq_production ... [DONE]
2023-12-25 14:17:07 +0800 -- Dumping database ... done
2023-12-25 14:17:07 +0800 -- Deleting backup and restore PID file ... done
2023-12-25 14:17:32 +0800 -- Dumping repositories ...
{"command":"create","gl_project_path":"xuxiaowei-com-cn.wiki","level":"info","msg":"started create","pid":59,"relative_path":"@groups/19/58/19581e27de7ced00ff1ce50b2047e7a567c76b1cbaebabe5ef03f7c3017bb5b7.wiki.git","storage_name":"default","time":"2023-12-25T06:17:32.808Z"}
{"command":"create","gl_project_path":"xuxiaowei-com-cn.wiki","level":"warning","msg":"skipped create","pid":59,"relative_path":"@groups/19/58/19581e27de7ced00ff1ce50b2047e7a567c76b1cbaebabe5ef03f7c3017bb5b7.wiki.git","storage_name":"default","time":"2023-12-25T06:17:32.814Z"}
{"command":"create","gl_project_path":"xuxiaowei/sleep","level":"info","msg":"started create","pid":59,"relative_path":"@hashed/6b/86/6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b.git","storage_name":"default","time":"2023-12-25T06:17:32.929Z"}
{"command":"create","gl_project_path":"xuxiaowei/sleep.wiki","level":"info","msg":"started create","pid":59,"relative_path":"@hashed/6b/86/6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b.wiki.git","storage_name":"default","time":"2023-12-25T06:17:32.934Z"}
{"command":"create","gl_project_path":"xuxiaowei/sleep.wiki","level":"info","msg":"completed create","pid":59,"relative_path":"@hashed/6b/86/6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b.wiki.git","storage_name":"default","time":"2023-12-25T06:17:32.945Z"}
{"command":"create","gl_project_path":"xuxiaowei/cache","level":"info","msg":"started create","pid":59,"relative_path":"@hashed/d4/73/d4735e3a265e16eee03f59718b9b5d03019c07d8b6c51f90da3a666eec13ab35.git","storage_name":"default","time":"2023-12-25T06:17:32.945Z"}
{"command":"create","gl_project_path":"xuxiaowei/sleep","level":"info","msg":"completed create","pid":59,"relative_path":"@hashed/6b/86/6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b.git","storage_name":"default","time":"2023-12-25T06:17:32.950Z"}
{"command":"create","gl_project_path":"xuxiaowei/cache.wiki","level":"info","msg":"started create","pid":59,"relative_path":"@hashed/d4/73/d4735e3a265e16eee03f59718b9b5d03019c07d8b6c51f90da3a666eec13ab35.wiki.git","storage_name":"default","time":"2023-12-25T06:17:32.950Z"}
{"command":"create","gl_project_path":"xuxiaowei/cache.wiki","level":"info","msg":"completed create","pid":59,"relative_path":"@hashed/d4/73/d4735e3a265e16eee03f59718b9b5d03019c07d8b6c51f90da3a666eec13ab35.wiki.git","storage_name":"default","time":"2023-12-25T06:17:32.960Z"}
{"command":"create","gl_project_path":"xuxiaowei/output-limit","level":"info","msg":"started create","pid":59,"relative_path":"@hashed/4e/07/4e07408562bedb8b60ce05c1decfe3ad16b72230967de01f640b7e4729b49fce.git","storage_name":"default","time":"2023-12-25T06:17:32.960Z"}
{"command":"create","gl_project_path":"xuxiaowei/cache","level":"info","msg":"completed create","pid":59,"relative_path":"@hashed/d4/73/d4735e3a265e16eee03f59718b9b5d03019c07d8b6c51f90da3a666eec13ab35.git","storage_name":"default","time":"2023-12-25T06:17:32.969Z"}
{"command":"create","gl_project_path":"xuxiaowei/output-limit.wiki","level":"info","msg":"started create","pid":59,"relative_path":"@hashed/4e/07/4e07408562bedb8b60ce05c1decfe3ad16b72230967de01f640b7e4729b49fce.wiki.git","storage_name":"default","time":"2023-12-25T06:17:32.969Z"}
{"command":"create","gl_project_path":"xuxiaowei/output-limit.wiki","level":"info","msg":"completed create","pid":59,"relative_path":"@hashed/4e/07/4e07408562bedb8b60ce05c1decfe3ad16b72230967de01f640b7e4729b49fce.wiki.git","storage_name":"default","time":"2023-12-25T06:17:32.987Z"}
{"command":"create","gl_project_path":"xuxiaowei/docker","level":"info","msg":"started create","pid":59,"relative_path":"@hashed/4b/22/4b227777d4dd1fc61c6f884f48641d02b4d121d3fd328cb08b5531fcacdabf8a.git","storage_name":"default","time":"2023-12-25T06:17:32.987Z"}
{"command":"create","gl_project_path":"xuxiaowei/output-limit","level":"info","msg":"completed create","pid":59,"relative_path":"@hashed/4e/07/4e07408562bedb8b60ce05c1decfe3ad16b72230967de01f640b7e4729b49fce.git","storage_name":"default","time":"2023-12-25T06:17:32.988Z"}
{"command":"create","gl_project_path":"xuxiaowei/docker.wiki","level":"info","msg":"started create","pid":59,"relative_path":"@hashed/4b/22/4b227777d4dd1fc61c6f884f48641d02b4d121d3fd328cb08b5531fcacdabf8a.wiki.git","storage_name":"default","time":"2023-12-25T06:17:32.988Z"}
{"command":"create","gl_project_path":"xuxiaowei/docker.wiki","level":"info","msg":"completed create","pid":59,"relative_path":"@hashed/4b/22/4b227777d4dd1fc61c6f884f48641d02b4d121d3fd328cb08b5531fcacdabf8a.wiki.git","storage_name":"default","time":"2023-12-25T06:17:33.004Z"}
{"command":"create","gl_project_path":"xuxiaowei/my-vue-app","level":"info","msg":"started create","pid":59,"relative_path":"@hashed/ef/2d/ef2d127de37b942baad06145e54b0c619a1f22327b2ebbcfbec78f5564afe39d.git","storage_name":"default","time":"2023-12-25T06:17:33.004Z"}
{"command":"create","gl_project_path":"xuxiaowei/my-vue-app","level":"info","msg":"completed create","pid":59,"relative_path":"@hashed/ef/2d/ef2d127de37b942baad06145e54b0c619a1f22327b2ebbcfbec78f5564afe39d.git","storage_name":"default","time":"2023-12-25T06:17:33.034Z"}
{"command":"create","gl_project_path":"xuxiaowei/my-vue-app.wiki","level":"info","msg":"started create","pid":59,"relative_path":"@hashed/ef/2d/ef2d127de37b942baad06145e54b0c619a1f22327b2ebbcfbec78f5564afe39d.wiki.git","storage_name":"default","time":"2023-12-25T06:17:33.034Z"}
{"command":"create","gl_project_path":"xuxiaowei/docker","level":"info","msg":"completed create","pid":59,"relative_path":"@hashed/4b/22/4b227777d4dd1fc61c6f884f48641d02b4d121d3fd328cb08b5531fcacdabf8a.git","storage_name":"default","time":"2023-12-25T06:17:33.049Z"}
{"command":"create","gl_project_path":"xuxiaowei/my-maven-app","level":"info","msg":"started create","pid":59,"relative_path":"@hashed/e7/f6/e7f6c011776e8db7cd330b54174fd76f7d0216b612387a5ffcfb81e6f0919683.git","storage_name":"default","time":"2023-12-25T06:17:33.049Z"}
{"command":"create","gl_project_path":"xuxiaowei/my-vue-app.wiki","level":"info","msg":"completed create","pid":59,"relative_path":"@hashed/ef/2d/ef2d127de37b942baad06145e54b0c619a1f22327b2ebbcfbec78f5564afe39d.wiki.git","storage_name":"default","time":"2023-12-25T06:17:33.049Z"}
{"command":"create","gl_project_path":"xuxiaowei/my-maven-app.wiki","level":"info","msg":"started create","pid":59,"relative_path":"@hashed/e7/f6/e7f6c011776e8db7cd330b54174fd76f7d0216b612387a5ffcfb81e6f0919683.wiki.git","storage_name":"default","time":"2023-12-25T06:17:33.049Z"}
{"command":"create","gl_project_path":"xuxiaowei/my-maven-app.wiki","level":"info","msg":"completed create","pid":59,"relative_path":"@hashed/e7/f6/e7f6c011776e8db7cd330b54174fd76f7d0216b612387a5ffcfb81e6f0919683.wiki.git","storage_name":"default","time":"2023-12-25T06:17:33.061Z"}
{"command":"create","gl_project_path":"xuxiaowei/my-maven-app","level":"info","msg":"completed create","pid":59,"relative_path":"@hashed/e7/f6/e7f6c011776e8db7cd330b54174fd76f7d0216b612387a5ffcfb81e6f0919683.git","storage_name":"default","time":"2023-12-25T06:17:33.087Z"}
2023-12-25 14:17:33 +0800 -- Dumping repositories ... done
2023-12-25 14:17:33 +0800 -- Deleting backup and restore PID file ... done
Dumping registry ...
empty
Dumping uploads ...
empty
Dumping artifacts ...
done
Dumping lfs ...
empty
Dumping packages ...
done
Dumping external_diffs ...
empty
Dumping terraform_state ...
empty
Dumping pages ...
done
Dumping ci_secure_files ...
empty
Packing up backup tar
[DONE] Backup can be found at s3://gitlab-backups/1703484999_2023_12_25_16.7.0-ee_gitlab_backup.tar
[root@anolis-7-9 ~]# 

号外号外!
极狐GitLab 正在推出DevSecOps 成熟度测评!链接:https://gitlab.cn/devsecops-assessment/ 测评非常全面并提供了可靠建议,即使不付费买产品,对自己想要落地 DevSecOps 的用户具有很高的参考意义!快来动手试试吧!

如何备份极狐GitLab 信任域名证书

点赞
收藏
评论区
推荐文章
blmius blmius
4年前
MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1
文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s
美凌格栋栋酱 美凌格栋栋酱
7个月前
Oracle 分组与拼接字符串同时使用
SELECTT.,ROWNUMIDFROM(SELECTT.EMPLID,T.NAME,T.BU,T.REALDEPART,T.FORMATDATE,SUM(T.S0)S0,MAX(UPDATETIME)CREATETIME,LISTAGG(TOCHAR(
添砖java的啾 添砖java的啾
4年前
distinct效率更高还是group by效率更高?
目录00结论01distinct的使用02groupby的使用03distinct和groupby原理04推荐groupby的原因00结论先说大致的结论(完整结论在文末):在语义相同,有索引的情况下groupby和distinct都能使用索引,效率相同。在语义相同,无索引的情况下:distinct效率高于groupby。原因是di
Stella981 Stella981
3年前
GitLab+Rancher实践DevOps【转载】
摘要本文描述使用自建GitLab和Rancher实践持续集成/持续交付流水线的过程,并用Rancher实现容器编排和蓝绿发布。GitLab持续集成GitLab持续集成/持续交付流程图:!image(https://docs.gitlab.com/ee/ci/img/cicd_pipeline_infograp
Stella981 Stella981
3年前
GitLab私服搭建
GitLab私服搭建我这里服务器系统是CentOS7,所以我搭建私服参考的是https://about.gitlab.com/downloads/centos7(https://www.oschina.net/action/GoToLink?urlhttps%3A%2F%2Fabout.gitlab.com%2Fdownl
Stella981 Stella981
3年前
Docker安装Gitlab服务
1、安装建议:版本:GitLab分为社区版(CE)和企业版(EE)。配置:建议CPU2核,内存2G以上。2、使用Docker安装Gitlab2.1:拉取Gitlab镜像拉取中文版gitlab镜像,需要注意的是这个版本的镜像已经2年没有更新了。dockerpulltwang2218/gitl
Wesley13 Wesley13
3年前
03.Android崩溃Crash库之ExceptionHandler分析
目录总结00.异常处理几个常用api01.UncaughtExceptionHandler02.Java线程处理异常分析03.Android中线程处理异常分析04.为何使用setDefaultUncaughtExceptionHandler前沿上一篇整体介绍了crash崩溃
Stella981 Stella981
3年前
OFBiz 快速入门——续二
OFBiz快速入门——续二2011年03月17日星期四00:03OFBiz 快速入门2.5 创建一个文件,取名为(controller.xml),被OFBiz webapp控制器使用的。在没有额外增加功能时,这个文件内容非常的小与简单,如下:<?xml version"1.0" encoding"UTF8"?<siteco
Wesley13 Wesley13
3年前
Java日期时间API系列36
  十二时辰,古代劳动人民把一昼夜划分成十二个时段,每一个时段叫一个时辰。二十四小时和十二时辰对照表:时辰时间24时制子时深夜11:00凌晨01:0023:0001:00丑时上午01:00上午03:0001:0003:00寅时上午03:00上午0
十月飞翔 十月飞翔
3年前
Gitlab 相关FAQ
1.gitlab网址:https://code.cestc.cn/zhujinqiang/ownproject2.本地安装好git后,在C:\Users\admin下运行sshkeygentrsaC"comment"生成.ssh文件夹,将生成的公钥上传到自己的gitlab密钥位置。此时还不
飞龙AI 飞龙AI
3个月前
DevEcoStudio 中使用模拟器时如何过滤日志
DevEcoStudio中使用模拟器时如何过滤日志鸿蒙核心技术鸿蒙开发者工具DevEcoStudio在HilogSettingsFilter设置Logmessage:A03d00/JSAPP当你看到不断更新的日志时,你会不会崩溃因为Nofilters模式下
生成对抗
生成对抗
Lv1
我住长江头,君住长江尾;日日思君不见君,共饮长江水。
文章
4
粉丝
0
获赞
0