如何在极狐GitLab 配置 邮件功能

本文作者:徐晓伟

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

本文主要讲述了在极狐GitLab用户找回密码、流水线失败等需要提醒时发送邮件。

说明

启用前查看后台任务,查看已停滞历史邮件

  • 如果不进行干预,当邮件配置生效后,可以重试历史邮件


    file
  • 如果不想发送大量历史电子邮件,可删除未发送的电子邮件


    file

文档

  1. 电子邮件
  2. 电子邮件配置

配置

  1. 以下配置使用 Microsoft Office 365 IMAP 配置,其他配置雷同,参见: 电子邮件

  2. 创建 Microsoft Office 365 IMAP 密码 secret

    kubectl -n gitlab-test create secret generic smtp-password --from-literal=password=你的密码
    
  3. 导出 helm gitlab 配置

    helm -n gitlab-test get values my-gitlab > my-gitlab.yaml
    
  4. 修改 helm gitlab 配置

    global:
      smtp:
        address: smtp.office365.com
        authentication: login
        domain: test.helm.xuxiaowei.cn
        enabled: true
        openssl_verify_mode: peer
        password:
          key: password
          secret: smtp-password
        port: 587
        starttls_auto: true
        user_name: gitlab@test.helm.xuxiaowei.cn
    
  5. 更新 helm gitlab 配置

    helm upgrade -n gitlab-test --install my-gitlab gitlab/gitlab -f my-gitlab.yaml --timeout 600s --version 7.7.0
    
  6. 等待所有 pod 更新完成

    [root@anolis-7-9 ~]# kubectl -n gitlab-test get pod -o wide
    NAME                                                 READY   STATUS      RESTARTS       AGE     IP                NODE         NOMINATED NODE   READINESS GATES
    cm-acme-http-solver-2ldtp                            1/1     Running     14 (24m ago)   2d10h   192.168.210.255   anolis-7-9   <none>           <none>
    cm-acme-http-solver-94dv5                            1/1     Running     14 (24m ago)   2d10h   192.168.210.194   anolis-7-9   <none>           <none>
    cm-acme-http-solver-klkpz                            1/1     Running     14 (24m ago)   2d10h   192.168.210.253   anolis-7-9   <none>           <none>
    my-gitlab-certmanager-8457bfdc8-w858k                1/1     Running     14 (24m ago)   2d10h   192.168.240.118   anolis-7-7   <none>           <none>
    my-gitlab-certmanager-cainjector-74df787cf4-j7cfc    1/1     Running     14 (24m ago)   2d10h   192.168.240.66    anolis-7-7   <none>           <none>
    my-gitlab-certmanager-webhook-7b86db4c96-dhcxl       1/1     Running     14 (24m ago)   2d10h   192.168.240.98    anolis-7-7   <none>           <none>
    my-gitlab-gitaly-0                                   1/1     Running     14 (24m ago)   2d10h   192.168.210.196   anolis-7-9   <none>           <none>
    my-gitlab-gitlab-exporter-55dcfcb595-gl6nm           1/1     Running     14 (24m ago)   2d10h   192.168.210.230   anolis-7-9   <none>           <none>
    my-gitlab-gitlab-pages-f65879869-c9kxd               1/1     Running     1 (24m ago)    21h     192.168.210.236   anolis-7-9   <none>           <none>
    my-gitlab-gitlab-runner-5f6ff5994c-wdw5l             1/1     Running     4 (19m ago)    25h     192.168.210.216   anolis-7-9   <none>           <none>
    my-gitlab-gitlab-shell-55fdc9cb9f-52gnr              1/1     Running     14 (21h ago)   2d10h   192.168.240.125   anolis-7-7   <none>           <none>
    my-gitlab-gitlab-shell-55fdc9cb9f-cfhsh              1/1     Running     14 (24m ago)   2d10h   192.168.210.219   anolis-7-9   <none>           <none>
    my-gitlab-issuer-38-h4pdv                            0/1     Completed   0              8m41s   192.168.240.114   anolis-7-7   <none>           <none>
    my-gitlab-kas-688dc97ddd-28gr7                       1/1     Running     38 (24m ago)   2d10h   192.168.240.95    anolis-7-7   <none>           <none>
    my-gitlab-kas-688dc97ddd-tvkvd                       1/1     Running     45 (18m ago)   2d10h   192.168.210.243   anolis-7-9   <none>           <none>
    my-gitlab-migrations-38-8fnqg                        0/1     Completed   0              8m41s   192.168.240.81    anolis-7-7   <none>           <none>
    my-gitlab-minio-66f584f746-t6qwb                     1/1     Running     7 (19m ago)    2d2h    192.168.210.237   anolis-7-9   <none>           <none>
    my-gitlab-minio-create-buckets-38-nfs8t              0/1     Completed   0              8m41s   192.168.240.78    anolis-7-7   <none>           <none>
    my-gitlab-nginx-ingress-controller-6bdd56c45-ch57n   1/1     Running     14 (24m ago)   2d10h   192.168.240.124   anolis-7-7   <none>           <none>
    my-gitlab-nginx-ingress-controller-6bdd56c45-cm2lz   1/1     Running     15 (19m ago)   2d10h   192.168.210.193   anolis-7-9   <none>           <none>
    my-gitlab-postgresql-0                               2/2     Running     30 (19m ago)   2d10h   192.168.210.250   anolis-7-9   <none>           <none>
    my-gitlab-prometheus-server-646489c599-8mgc9         2/2     Running     30 (19m ago)   2d10h   192.168.210.248   anolis-7-9   <none>           <none>
    my-gitlab-redis-master-0                             2/2     Running     30 (19m ago)   2d10h   192.168.210.252   anolis-7-9   <none>           <none>
    my-gitlab-registry-78fc549f8d-d2zjv                  1/1     Running     14 (24m ago)   2d10h   192.168.240.67    anolis-7-7   <none>           <none>
    my-gitlab-registry-78fc549f8d-xbkvh                  1/1     Running     14 (24m ago)   2d10h   192.168.210.247   anolis-7-9   <none>           <none>
    my-gitlab-sidekiq-all-in-1-v2-7b6d5575fb-kwvtf       1/1     Running     0              8m41s   192.168.240.77    anolis-7-7   <none>           <none>
    my-gitlab-toolbox-658f8894ff-tzlct                   1/1     Running     0              8m40s   192.168.240.79    anolis-7-7   <none>           <none>
    my-gitlab-webservice-default-fd8948f47-jkm44         2/2     Running     0              7m45s   192.168.240.73    anolis-7-7   <none>           <none>
    my-gitlab-webservice-default-fd8948f47-mxjz6         2/2     Running     0              8m41s   192.168.210.195   anolis-7-9   <none>           <none>
    [root@anolis-7-9 ~]#
    
  7. 重试一个历史任务或者重试一个异常流水线,即可发送邮件

    1. 发送邮件


      file
    2. 接收邮件


      file

号外号外!
极狐GitLab 正在推出DevSecOps 成熟度测评! 测评非常全面并提供了可靠建议,即使不付费买产品,对自己想要落地 DevSecOps 的用户具有很高的参考意义!快来动手试试吧!在极狐GitLab 官网就能找到。


file
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 219,635评论 6 508
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 93,628评论 3 396
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 165,971评论 0 356
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 58,986评论 1 295
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 68,006评论 6 394
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 51,784评论 1 307
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 40,475评论 3 420
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 39,364评论 0 276
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 45,860评论 1 317
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 38,008评论 3 338
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 40,152评论 1 351
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 35,829评论 5 346
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 41,490评论 3 331
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 32,035评论 0 22
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 33,156评论 1 272
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 48,428评论 3 373
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 45,127评论 2 356

推荐阅读更多精彩内容