如何使用极狐GitLab 自定义 Pages 根域名

本文作者:徐晓伟

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

本文主要讲述了极狐GitLab Pages 使用独立于极狐GitLab 的根域名。

配置

  1. 导出 helm gitlab 配置

    # 将已配置的值导出到文件中
    helm -n gitlab-test get values my-gitlab > my-gitlab.yaml
    
  2. 更新配置

    此处的根域名设置为:test.helm.xuxiaowei.io

    helm upgrade -n gitlab-test --install my-gitlab gitlab/gitlab --timeout 600s -f my-gitlab.yaml --set global.pages.host=test.helm.xuxiaowei.io --version 7.7.0
    
  3. 等待所有 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     13 (10m ago)   37h     192.168.210.205   anolis-7-9   <none>           <none>
    cm-acme-http-solver-94dv5                            1/1     Running     13 (10m ago)   37h     192.168.210.227   anolis-7-9   <none>           <none>
    cm-acme-http-solver-klkpz                            1/1     Running     13 (10m ago)   37h     192.168.210.232   anolis-7-9   <none>           <none>
    my-gitlab-certmanager-8457bfdc8-w858k                1/1     Running     13 (10m ago)   37h     192.168.240.127   anolis-7-7   <none>           <none>
    my-gitlab-certmanager-cainjector-74df787cf4-j7cfc    1/1     Running     13 (10m ago)   37h     192.168.240.93    anolis-7-7   <none>           <none>
    my-gitlab-certmanager-webhook-7b86db4c96-dhcxl       1/1     Running     13 (10m ago)   37h     192.168.240.109   anolis-7-7   <none>           <none>
    my-gitlab-gitaly-0                                   1/1     Running     13 (10m ago)   37h     192.168.210.212   anolis-7-9   <none>           <none>
    my-gitlab-gitlab-exporter-55dcfcb595-gl6nm           1/1     Running     13 (10m ago)   37h     192.168.210.211   anolis-7-9   <none>           <none>
    my-gitlab-gitlab-pages-f65879869-c9kxd               1/1     Running     0              4m33s   192.168.210.220   anolis-7-9   <none>           <none>
    my-gitlab-gitlab-runner-5f6ff5994c-wdw5l             1/1     Running     2 (10m ago)    3h45m   192.168.210.226   anolis-7-9   <none>           <none>
    my-gitlab-gitlab-shell-55fdc9cb9f-52gnr              1/1     Running     13 (10m ago)   37h     192.168.240.106   anolis-7-7   <none>           <none>
    my-gitlab-gitlab-shell-55fdc9cb9f-cfhsh              1/1     Running     13 (10m ago)   37h     192.168.210.204   anolis-7-9   <none>           <none>
    my-gitlab-issuer-33-jtcbd                            0/1     Completed   0              4m33s   192.168.240.92    anolis-7-7   <none>           <none>
    my-gitlab-kas-688dc97ddd-28gr7                       1/1     Running     37 (10m ago)   37h     192.168.240.65    anolis-7-7   <none>           <none>
    my-gitlab-kas-688dc97ddd-tvkvd                       1/1     Running     43 (10m ago)   37h     192.168.210.229   anolis-7-9   <none>           <none>
    my-gitlab-migrations-33-cnmd7                        0/1     Completed   0              4m33s   192.168.240.91    anolis-7-7   <none>           <none>
    my-gitlab-minio-66f584f746-t6qwb                     1/1     Running     5 (10m ago)    29h     192.168.210.200   anolis-7-9   <none>           <none>
    my-gitlab-minio-create-buckets-33-x7wvv              0/1     Completed   0              4m33s   192.168.240.86    anolis-7-7   <none>           <none>
    my-gitlab-nginx-ingress-controller-6bdd56c45-ch57n   1/1     Running     13 (10m ago)   37h     192.168.240.99    anolis-7-7   <none>           <none>
    my-gitlab-nginx-ingress-controller-6bdd56c45-cm2lz   1/1     Running     13 (10m ago)   37h     192.168.210.201   anolis-7-9   <none>           <none>
    my-gitlab-postgresql-0                               2/2     Running     26 (10m ago)   37h     192.168.210.217   anolis-7-9   <none>           <none>
    my-gitlab-prometheus-server-646489c599-8mgc9         2/2     Running     26 (10m ago)   37h     192.168.210.218   anolis-7-9   <none>           <none>
    my-gitlab-redis-master-0                             2/2     Running     26 (10m ago)   36h     192.168.210.209   anolis-7-9   <none>           <none>
    my-gitlab-registry-78fc549f8d-d2zjv                  1/1     Running     13 (54m ago)   37h     192.168.240.70    anolis-7-7   <none>           <none>
    my-gitlab-registry-78fc549f8d-xbkvh                  1/1     Running     13 (10m ago)   37h     192.168.210.213   anolis-7-9   <none>           <none>
    my-gitlab-sidekiq-all-in-1-v2-589bfd4b96-5kdh7       1/1     Running     0              4m33s   192.168.240.83    anolis-7-7   <none>           <none>
    my-gitlab-toolbox-79c7bf6985-vpkzq                   1/1     Running     0              4m3s    192.168.210.231   anolis-7-9   <none>           <none>
    my-gitlab-webservice-default-654f7fbbbf-pdm5g        2/2     Running     0              2m14s   192.168.240.113   anolis-7-7   <none>           <none>
    my-gitlab-webservice-default-654f7fbbbf-xjk78        2/2     Running     0              4m33s   192.168.210.221   anolis-7-9   <none>           <none>
    [root@anolis-7-9 ~]# 
    
  4. 查看项目 Pages 配置 默认 webservice-default Deployment 只有两个副本,请等待 webservice-default Deployment 恢复正常副本数后再查看, 否则页面数据在每次刷新可能结果不同

  1. 访问新 Pages 域名

    此处访问的域名:用户名.test.helm.xuxiaowei.io

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

本文由博客一文多发平台 OpenWrite 发布!

相关推荐
墨理学AI7 小时前
GitHub 桌面版配置 |可视化界面进行上传到远程仓库 | gitLab 配置【把密码存在本地服务器】
gitlab·github·github 桌面版
月如琉璃9 小时前
1.gitlab 服务器搭建流程
服务器·gitlab
刘大辉在路上9 小时前
突发!!!GitLab停止为中国大陆、港澳地区提供服务,60天内需迁移账号否则将被删除
git·后端·gitlab·版本管理·源代码管理
tingkeiii2 天前
gitlab克隆仓库报错fatal: unable to access ‘仓库地址xxxxxxxx‘
gitlab
dami_king2 天前
项目开源能够带来什么?从中得到了什么?
开源·gitlab·github
月如琉璃3 天前
0.gitlab ubuntu20.04 部署问题解决
gitlab
the丶only3 天前
单点登录平台Casdoor搭建与使用,集成gitlab同步创建删除账号
linux·运维·服务器·docker·gitlab
书生-w3 天前
Docker部署GitLab服务器
服务器·docker·gitlab
isolusion3 天前
gitlab安装
gitlab
Y编程小白3 天前
GitLab的安装和使用
gitlab