在Kubernetes部署GitLab

前置条件

已安装Helm工具
已部署NFS自动创建PVC

使用HELM安装


[root@k8s-master01 ~]# helm repo add gitlab https://charts.gitlab.io/
"gitlab" has been added to your repositories [root@k8s-master01 ~]# helm repo update
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "gitlab" chart repository
...Successfully got an update from the "cilium" chart repository
Update Complete. ⎈Happy Helming!⎈ [root@k8s-master01 ~]# helm upgrade --install gitlab gitlab/gitlab \
--timeout 600s \
--set global.hosts.domain=git.oiox.cn \
--set global.hosts.externalIP=192.168.1.61 \
--set certmanager-issuer.email=cby@chenby.cn NAME: gitlab
LAST DEPLOYED: Mon Sep 12 19:49:30 2022
NAMESPACE: default
STATUS: deployed
REVISION: 1
NOTES:
=== NOTICE
The minimum required version of PostgreSQL is now 12. See https://gitlab.com/gitlab-org/charts/gitlab/-/blob/master/doc/installation/upgrade.md for more details. === NOTICE
You've installed GitLab Runner without the ability to use 'docker in docker'.
The GitLab Runner chart (gitlab/gitlab-runner) is deployed without the `privileged` flag by default for security purposes. This can be changed by setting `gitlab-runner.runners.privileged` to `true`. Before doing so, please read the GitLab Runner chart's documentation on why we
chose not to enable this by default. See https://docs.gitlab.com/runner/install/kubernetes.html#running-docker-in-docker-containers-with-gitlab-runners
Help us improve the installation experience, let us know how we did with a 1 minute survey:https://gitlab.fra1.qualtrics.com/jfe/form/SV_6kVqZANThUQ1bZb?installation=helm&release=15-3 === NOTICE
The in-chart NGINX Ingress Controller has the following requirements:
- Kubernetes version must be 1.19 or newer.
- Ingress objects must be in group/version `networking.k8s.io/v1`.
[root@k8s-master01 ~]#

查看POD情况


[root@k8s-master01 ~]# kubectl get pod -A
NAMESPACE NAME READY STATUS RESTARTS AGE
cilium-monitoring grafana-59957b9549-6zzqh 1/1 Running 1 (6m28s ago) 8h
cilium-monitoring prometheus-7c8c9684bb-4v9cl 1/1 Running 1 (4m49s ago) 8h
default chenby-75b5d7fbfb-7zjsr 1/1 Running 1 (6m15s ago) 35h
default chenby-75b5d7fbfb-hbvr8 1/1 Running 1 (5m27s ago) 35h
default chenby-75b5d7fbfb-ppbzg 1/1 Running 1 (5m57s ago) 35h
default cm-acme-http-solver-8b6lg 1/1 Running 1 (4m49s ago) 11m
default cm-acme-http-solver-9sd7r 1/1 Running 1 (4m49s ago) 11m
default cm-acme-http-solver-tx5x2 1/1 Running 1 (5m27s ago) 11m
default cm-acme-http-solver-w74zd 1/1 Running 1 (4m49s ago) 11m
default echo-a-6799dff547-pnx6w 1/1 Running 1 (6m28s ago) 8h
default echo-b-fc47b659c-4bdg9 1/1 Running 1 (4m49s ago) 8h
default echo-b-host-67fcfd59b7-28r9s 1/1 Running 1 (4m49s ago) 8h
default gitlab-certmanager-7cb7797848-fgdff 1/1 Running 1 (5m27s ago) 12m
default gitlab-certmanager-cainjector-5968cb88f9-qw4d7 1/1 Running 2 (5m57s ago) 12m
default gitlab-certmanager-webhook-797bcff548-t266p 1/1 Running 1 (6m15s ago) 12m
default gitlab-gitaly-0 1/1 Running 1 (6m28s ago) 12m
default gitlab-gitlab-exporter-58fc5779d7-lbl4s 1/1 Running 1 (5m27s ago) 12m
default gitlab-gitlab-runner-5484688b78-d5gmt 0/1 Running 3 (2m8s ago) 12m
default gitlab-gitlab-shell-7578c56d55-p5fvp 1/1 Running 1 (5m27s ago) 12m
default gitlab-gitlab-shell-7578c56d55-vzbrb 1/1 Running 1 (4m49s ago) 12m
default gitlab-issuer-1-sw7nm 0/1 Completed 0 12m
default gitlab-kas-85f677867b-sjxqv 1/1 Running 1 (4m49s ago) 12m
default gitlab-kas-85f677867b-wwlsl 1/1 Running 1 (6m28s ago) 12m
default gitlab-migrations-1-hpsc8 0/1 Completed 2 12m
default gitlab-minio-74467697bb-76xcb 1/1 Running 1 (4m49s ago) 12m
default gitlab-minio-create-buckets-1-nwzh2 0/1 Completed 0 12m
default gitlab-nginx-ingress-controller-77589fdd6f-7rk5f 1/1 Running 1 (5m27s ago) 12m
default gitlab-nginx-ingress-controller-77589fdd6f-lk96x 1/1 Running 1 (4m49s ago) 12m
default gitlab-postgresql-0 2/2 Running 2 (5m27s ago) 12m
default gitlab-prometheus-server-6bf4fffc55-ww59q 2/2 Running 2 (6m14s ago) 12m
default gitlab-redis-master-0 2/2 Running 2 (4m49s ago) 12m
default gitlab-registry-54899b8c96-gkmm2 1/1 Running 1 (5m27s ago) 12m
default gitlab-registry-54899b8c96-pzxcd 1/1 Running 1 (5m57s ago) 12m
default gitlab-sidekiq-all-in-1-v2-64cbbc8cd8-4pmm9 1/1 Running 1 (5m57s ago) 12m
default gitlab-sidekiq-all-in-1-v2-64cbbc8cd8-fr2wn 1/1 Running 0 81s
default gitlab-sidekiq-all-in-1-v2-64cbbc8cd8-sx8b6 1/1 Running 0 81s
default gitlab-toolbox-746c98d8f6-cxwl9 1/1 Running 1 (5m27s ago) 12m
default gitlab-webservice-default-6998494449-9hrtc 2/2 Running 1 (6m28s ago) 12m
default gitlab-webservice-default-6998494449-kdbbq 2/2 Running 2 (6m14s ago) 12m
default host-to-b-multi-node-clusterip-69c57975d6-z4j2z 1/1 Running 3 (4m6s ago) 8h
default host-to-b-multi-node-headless-865899f7bb-frrmc 1/1 Running 2 (4m16s ago) 8h
default nfs-client-provisioner-665598d599-4xwmf 1/1 Running 3 (5m57s ago) 52m
default pod-to-a-allowed-cnp-5f9d7d4b9d-hcd8x 1/1 Running 4 (3m54s ago) 8h
default pod-to-a-denied-cnp-65cc5ff97b-2rzb8 1/1 Running 1 (6m28s ago) 8h
default pod-to-a-dfc64f564-p7xcn 1/1 Running 3 (4m6s ago) 8h
default pod-to-b-intra-node-nodeport-677868746b-trk2l 1/1 Running 1 (4m49s ago) 8h
default pod-to-b-multi-node-clusterip-76bbbc677b-knfq2 1/1 Running 2 (4m2s ago) 8h
default pod-to-b-multi-node-headless-698c6579fd-mmvd7 1/1 Running 2 (4m48s ago) 8h
default pod-to-b-multi-node-nodeport-5dc4b8cfd6-8dxmz 1/1 Running 2 (4m48s ago) 8h
default pod-to-external-1111-8459965778-pjt9b 1/1 Running 13 (5m57s ago) 8h
default pod-to-external-fqdn-allow-google-cnp-64df9fb89b-l9l4q 1/1 Running 15 (4m39s ago) 8h
kube-system cilium-7rfj6 1/1 Running 1 (5m27s ago) 8h
kube-system cilium-d4cch 1/1 Running 1 (6m28s ago) 8h
kube-system cilium-h5x8r 1/1 Running 1 (5m57s ago) 8h
kube-system cilium-operator-5dbddb6dbf-flpl5 1/1 Running 1 (6m28s ago) 8h
kube-system cilium-operator-5dbddb6dbf-gcznc 1/1 Running 2 (4m49s ago) 8h
kube-system cilium-t2xlz 1/1 Running 1 (4m49s ago) 8h
kube-system cilium-z65z7 1/1 Running 1 (6m15s ago) 8h
kube-system coredns-665475b9f8-jkqn8 1/1 Running 2 (4m49s ago) 44h
kube-system hubble-relay-59d8575-9pl9z 1/1 Running 1 (6m28s ago) 8h
kube-system hubble-ui-64d4995d57-nsv9j 2/2 Running 2 (6m28s ago) 8h
kube-system metrics-server-776f58c94b-c6zgs 1/1 Running 2 (6m14s ago) 45h
[root@k8s-master01 ~]#

查看INGRESS情况


[root@k8s-master01 ~]# kubectl  get svc -A | grep ingress
default gitlab-nginx-ingress-controller LoadBalancer 10.111.0.148 <pending> 80:32002/TCP,443:31390/TCP,22:30887/TCP 26m
default gitlab-nginx-ingress-controller-metrics ClusterIP 10.104.165.192 <none> 10254/TCP 26m # 修改为NodePort
[root@k8s-master01 ~]# kubectl edit svc gitlab-nginx-ingress-controller
service/gitlab-nginx-ingress-controller edited
[root@k8s-master01 ~]#
[root@k8s-master01 ~]# kubectl get svc -A | grep ingress
default gitlab-nginx-ingress-controller NodePort 10.111.0.148 <none> 80:32002/TCP,443:31390/TCP,22:30887/TCP 26m
default gitlab-nginx-ingress-controller-metrics ClusterIP 10.104.165.192 <none> 10254/TCP 26m
[root@k8s-master01 ~]#
[root@k8s-master01 ~]# # 查看有哪些域名
[root@k8s-master01 ~]# kubectl get ingress
NAME CLASS HOSTS ADDRESS PORTS AGE
cm-acme-http-solver-84tql gitlab-nginx minio.git.oiox.cn 10.111.0.148 80 25m
cm-acme-http-solver-c4n6s gitlab-nginx kas.git.oiox.cn 10.111.0.148 80 25m
cm-acme-http-solver-vwn4s gitlab-nginx gitlab.git.oiox.cn 10.111.0.148 80 25m
cm-acme-http-solver-zccvm gitlab-nginx registry.git.oiox.cn 10.111.0.148 80 25m
gitlab-kas gitlab-nginx kas.git.oiox.cn 10.111.0.148 80, 443 27m
gitlab-minio gitlab-nginx minio.git.oiox.cn 10.111.0.148 80, 443 27m
gitlab-registry gitlab-nginx registry.git.oiox.cn 10.111.0.148 80, 443 27m
gitlab-webservice-default gitlab-nginx gitlab.git.oiox.cn 10.111.0.148 80, 443 27m
[root@k8s-master01 ~]#

本地写入域名


[root@k8s-master01 ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 # 没有IPv6选择不配置即可
2409:8a10:9e10:8700::10 k8s-master01
2409:8a10:9e10:8700::20 k8s-master02
2409:8a10:9e10:8700::30 k8s-master03
2409:8a10:9e10:8700::40 k8s-node01
2409:8a10:9e10:8700::50 k8s-node02 192.168.1.61 k8s-master01
192.168.1.62 k8s-master02
192.168.1.63 k8s-master03
192.168.1.64 k8s-node01
192.168.1.65 k8s-node02
192.168.1.66 lb-vip 192.168.1.61 kas.git.oiox.cn
192.168.1.61 minio.git.oiox.cn
192.168.1.61 registry.git.oiox.cn
192.168.1.61 gitlab.git.oiox.cn
[root@k8s-master01 ~]#

测试访问


# 查看密码
[root@k8s-master01 ~]# kubectl get secret gitlab-gitlab-initial-root-password -ojsonpath='{.data.password}' | base64 --decode ; echo
Hh7EjzH01T7DJw7TutWG6ynAU8yoGYcxNcV0cADCIpRCPeuFA5DBTC1I5V4T4gz4
[root@k8s-master01 ~]# # 访问
https://gitlab.git.oiox.cn:31390/

关于

https://www.oiox.cn/

https://www.oiox.cn/index.php/start-page.html

CSDN、GitHub、知乎、开源中国、思否、掘金、简书、华为云、阿里云、腾讯云、哔哩哔哩、今日头条、新浪微博、个人博客

全网可搜《小陈运维》

文章主要发布于微信公众号

在Kubernetes部署GitLab的更多相关文章

  1. kubernetes部署jenkins(Docker in Docker)及认证

    引言 Jenkins是一款开源 CI&CD 软件,用于自动化各种任务,包括构建.测试和部署软件. 本文将Jenkins的master与slave置于Pod中,部署在namespace:jenk ...

  2. openshift 平台上部署 gitlab代码仓库服务

    背景: 本文档将以在openshift 平台上部署 gitlab 服务来验证集群各个服务组件的可用性以及熟悉openshift的使用方法.服务部署方式可以多种多样,灵活部署.本篇以常见的镜像部署方式来 ...

  3. K8s 部署 Gitlab CI Runner

    K8s 版本:1.20.6 GitLab CI 最大的作用是管理各个项目的构建状态.因此,运行构建任务这种浪费资源的事情交给一个独立的 Gitlab Runner 来做就会好很多,而且 Gitlab ...

  4. rpm,docker,k8s三种方式安装部署GitLab服务

    rpm方式 源地址:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/ wget https://mirrors.tuna.tsinghua ...

  5. [系统集成] 基于Kubernetes 部署 jenkins 并动态分配资源

    基于kubernetes 部署 jenkins master 比较简单,难点是为 jenkins 动态分配资源.基于kubernetes 为 jenkins 动态分配资源需要实现下述功能: 资源分配: ...

  6. omnibus方式部署gitlab

    omnibus方式部署gitlab Posted on 2015 年 1 月 10 日   4233 Views 这几天折腾搭建git服务器,选择了比较流行的gitlab,一开始就直奔一键安装脚本去了 ...

  7. kubernetes 部署

    kubernetes 部署(Centos 7) 一个或者多个兼容 deb 或者 rpm 软件包的操作系统,比如 Ubuntu 或者 CentOS 每台机器 2 GB 以上的内存,内存不足时应用会受限制 ...

  8. Windows 下 docker 部署 gitlab ci

    一.安装 1. 安装 docker Docker下载 注意:Windows 10 家庭版获取 之前的版本不能直接安装 Docker ,而是需要去安装 Docker Toolbox 我这里安装的是 Do ...

  9. [转]Centos 7 安装部署 GitLab 服务器

    Centos 7 安装部署 GitLab 服务器 转自:https://www.jianshu.com/p/79bfded68899 文前说明 作为码农中的一员,需要不断的学习,我工作之余将一些分析总 ...

  10. Docker-compose部署gitlab中文版

    目录 Docker-compose部署gitlab 1.安装Docker 2.安装Docker-compose 3.安装Gitlab Docker-compose部署gitlab 1.安装Docker ...

随机推荐

  1. Element-ui树形控件el-tree鼠标移入显示隐藏效果超简单

    显示效果: 废话不多说,直接上代码 <template> <el-tree default-expand-all :data="data"> <spa ...

  2. Array of products

    refer to: https://www.algoexpert.io/questions/Array%20Of%20Products Problem Statement Sample input A ...

  3. Python 爬虫代码应该怎么写?

    对于入行已久的老程序员也并不一定精通爬虫代码,这些需要时间的沉淀还需要更多的实战案例,简单的问句你真的会写爬虫么?下面就是我日常写的一个y文件加上几个请求并且把需要的功能全部实现模块化,可以让我们爬虫 ...

  4. 阿里云Linux服务器部署JDK8实战教程

    下载地址 https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html 文件上传 把下载的文 ...

  5. 使用navicat连接本地数据库时,出现错误1251错误

    在安装完MySQL的时候,我们现在一般都使用Navicat来连接数据库,可惜出现下面的错误:1251-Client does not support authentication protocol r ...

  6. 批量cp时中断,原来是被cp的alias干扰了

    背景 批量复制一批数据的质控结果的时候,由于表格中出现一个重复项,导致卡在是否覆盖的提示这里 结果该重复项之后的样本都没有复制成功,差点就漏掉一部分样本啊-- cat ../sampleList|wh ...

  7. 入门文章学习(一)-Beginner Tutorial

    Abstract: 参照"背景知识查阅"一文的学习路径,对几篇文章的学习做了记录.这是"Beginner Tutorial"一文的学习笔记. 文章链接: htt ...

  8. 读取nrf52832的ADC,并且获取N个数组中的中间值

    //****读取中间值****// short GetMedianNum(short * bArray, short iFilterLen) { short i,j,bTemp;// 排序循环 for ...

  9. PCB封装设计建议:

    1,通孔型元器件建议孔直径比元器件管脚直径大0.2-0.3mm左右,焊盘铜皮外沿一般是0.3-1mm(相当于直径应该加0.6-2mm)宽大元件可再大一点,对于设计单面板的,则最小铜皮外沿应大于1mm以 ...

  10. [Windows] Visual Studio 类库Xml文档免费翻译工具 《Xml文档翻译器2.1》

    谷歌Chrome翻译功能失效用不了,我们一起来恢复翻译功能! 可用的谷歌国内 IP: 142.250.4.90 translate.googleapis.com 142.250.30.90 trans ...