k8s安装gitlab-ce
docker镜像打包
根据官方说明:gitlaby docker镜像中已经不包含邮件代理传输,需要重新打包镜像
FROM gitlab/gitlab-ce
RUN apt-get update && apt-get install postf
官方说明:https://docs.gitlab.cn/jh/install/docker.html 官方说明
创建pvc 采用的是阿里云的nas 可以更换其他的
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
annotations:
k8s.kuboard.cn/pvcType: Dynamic
pv.kubernetes.io/bind-completed: 'yes'
pv.kubernetes.io/bound-by-controller: 'yes'
volume.beta.kubernetes.io/storage-provisioner: nasplugin.csi.alibabacloud.com
finalizers:
- kubernetes.io/pvc-protection
name: gitlab-ce
namespace: gitlab
resourceVersion: '1233054'
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 100Gi
storageClassName: alibabacloud-cnfs-nas
volumeMode: Filesystem
volumeName: nas-xxxxxxxxx
status:
accessModes:
- ReadWriteMany
capacity:
storage: 100Gi
phase: Bound
部署pgsql
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: postgresql
name: postgresql
namespace: gitlab
spec:
replicas: 1
selector:
matchLabels:
app: postgresql
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
template:
metadata:
labels:
app: postgresql
spec:
containers:
- env:
- name: POSTGRES_DB
value: gitlab
- name: POSTGRES_USER
value: gitlabuser
- name: POSTGRES_PASSWORD
value: '123456'
- name: POSTGRES_HOST_AUTH_METHOD
value: trust
image: 'postgres:10'
imagePullPolicy: IfNotPresent
name: postgresql
ports:
- containerPort: 5432
protocol: TCP
volumeMounts:
- mountPath: /var/lib/postgresql/data
name: pgdata
subPath: postgresql
volumes:
- name: pgdata
persistentVolumeClaim:
claimName: gitlab-ce
---
apiVersion: v1
kind: Service
metadata:
annotations: {}
labels:
app: postgresql
name: postgresql
namespace: gitlab
spec: ports:
- name: pg
port: 5432
protocol: TCP
targetPort: 5432
selector:
app: postgresql
type: ClusterIP
部署redis
apiVersion: apps/v1
kind: StatefulSet
metadata:
annotations: {}
labels:
app: redis
k8s.kuboard.cn/name: redis
name: redis
namespace: gitlab
spec:
replicas: 1
selector:
matchLabels:
app: redis
serviceName: redis
template:
metadata:
labels:
app: redis
spec:
containers:
- env:
- name: REDIS_PASSWORD
value: '123456'
image: 'bitnami/redis:5.0'
imagePullPolicy: IfNotPresent
name: redis
ports:
- containerPort: 6379
protocol: TCP
volumeMounts:
- mountPath: /bitnami/redis/data
name: redis-data
subPath: redis
volumes:
- name: redis-data
persistentVolumeClaim:
claimName: gitlab-ce
---
apiVersion: v1
kind: Service
metadata:
annotations: {}
labels:
app: redis
name: redis
namespace: gitlab
spec:
- port: 6379
protocol: TCP
targetPort: 6379
selector:
app: redis
type: ClusterIP
部署gitlab
---
apiVersion: v1
data:
gitlab.rb: |+
external_url 'https://gitsm.com'
gitlab_rails['gitlab_email_from'] = 'xxxxx@xxxxx-inc.com'
gitlab_rails['ldap_enabled'] = true
gitlab_rails['ldap_servers'] = YAML.load <<-'EOS'
label: 'LDAP'
host: 'ldap://xxxxx:389'
port: 399
uid: 'uid'
bind_dn: 'cn=root,dc=xxxxxx,dc=com'
verify_certificates: true
active_directory: true
allow_username_or_email_login: false
block_auto_created_users: false
base: 'dc=xxxxx,dc=com'
user_filter: ''
group_base: ''
admin_group: ''
sync_ssh_keys: false
EOS
gitlab_rails['db_adapter'] = "postgresql"
gitlab_rails['db_encoding'] = "utf8"
gitlab_rails['db_username'] = "gitlabuser"
gitlab_rails['db_password'] = "123456"
gitlab_rails['db_host'] = "postgresql"
gitlab_rails['db_port'] = "5432"
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "xxxxx.xxxxx-inc.com"
gitlab_rails['smtp_port'] = 465
gitlab_rails['smtp_user_name'] = "xxxxx@xxxxx-inc.com"
gitlab_rails['smtp_password'] = "xxxxx"
gitlab_rails['smtp_domain'] = "xxxxx-inc.com"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = true
user['git_user_email'] = "xxxxx@xxxxx-inc.com"
postgresql['enable'] = false
redis['enable'] = true
gitlab_rails['redis_host'] = 'redis'
gitlab_rails['redis_port'] = 6379
gitlab_rails['redis_password'] = '123456' kind: ConfigMap
metadata:
name: gitlab-config
namespace: gitlab
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
annotations: {}
labels:
app: gitlab-ce
name: gitlab-ce
namespace: gitlab
spec:
replicas: 1
selector:
matchLabels:
app: gitlab-ce
serviceName: gitlab-ce
template:
metadata:
labels:
app: gitlab-ce
spec:
containers:
- env:
- name: GITLAB_ROOT_PASSWORD
value: gitlab123456
- name: GITLAB_ROOT_EMAIL
value: gitlab@xianlai-inc.com
envFrom:
- configMapRef:
name: gitlab-config
prefix: GITLAB_OMNIBUS_CONFIG
image: 'xxxxxxxxx/gitlab-ce:latest'
imagePullPolicy: IfNotPresent
name: gitlab-ce
ports:
- containerPort: 80
name: http
protocol: TCP
- containerPort: 443
name: https
protocol: TCP
- containerPort: 22
name: ssh
protocol: TCP
volumeMounts:
- mountPath: /etc/gitlab
name: data
subPath: gitlab/conf
- mountPath: /var/opt/gitlab
name: data
subPath: gitlab/data
restartPolicy: Always
volumes:
- name: data
persistentVolumeClaim:
claimName: gitlab-ce ---
apiVersion: v1
kind: Service
metadata:
annotations: {}
labels:
app: gitlab-ce
name: gitlab-ce
namespace: gitlab
spec:
ports:
- name: http
port: 80
protocol: TCP
targetPort: 80
- name: https
port: 443
protocol: TCP
targetPort: 443
selector:
app: gitlab-ce
type: ClusterIP
邮箱验证
QQ邮箱
需要先登录qq邮箱开启smtp,会生成一个 smtp_password
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.qq.com"
gitlab_rails['smtp_port'] = 465
gitlab_rails['smtp_user_name'] = "xxx@qq.com"
gitlab_rails['smtp_password'] = "xxxxxx"
gitlab_rails['smtp_domain'] = "qq.com"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = true
gitlab_rails['gitlab_email_from'] = "xxx@qq.com"
user["git_user_email"] = "xxx@qq.com"
阿里云企业邮箱
可以先在阿里云域名解析中查看smtp配置,一般情况和下面一样的。
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.mxhichina.com"
gitlab_rails['smtp_port'] = 465
gitlab_rails['smtp_user_name'] = "gitlab@xxx.com"
gitlab_rails['smtp_password'] = "xxx"
gitlab_rails['smtp_domain'] = "smtp.mxhichina.com"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = true
gitlab_rails['gitlab_email_from'] = "gitlab@xxx.com"
user["git_user_email"] = "gitlab@xxx.com"
邮箱测试
# 重启配置
gitlab-ctl reconfigure
gitlab-ctl restart
# 进入控制台(等待进入控制台)
gitlab-rails console
# 执行测试
Notify.test_email("接收邮箱","标题","内容").deliver_now
k8s安装gitlab-ce的更多相关文章
- 安装gitlab ce
切换到root用户,安装相关依赖 yum install curl policycoreutils openssh-server openssh-clients service sshd restar ...
- Mac安装GitLab CE记录
0 REF REF1 原始的GitLab Documentation REF2 Installation-guide-for-GitLab-on-OS-X REF3 如何在Mac 终端升级ruby版本 ...
- ubunut18.04 下安装 gitlab ce版,使用清华源
gitlab官方的ubuntu安装说明 https://about.gitlab.com/install/#ubuntu 该安装说明介绍的是gitlab-ee版本 按照该说明也能安装gitlab-ce ...
- Centos6安装Gitlab
安装参考 https://about.gitlab.com/downloads/ 可以从清华的镜像下载安装包, 注意区分自己用的是哪个发行版 https://mirror.tuna.tsinghua. ...
- gitlab ce 中删除空项目之后,没有删除掉,访问500
在VirtualBox中的gitlab ce,在管理页面的操作如下: 新建一个仓库名为test的仓库,并从gitlab中导入 导入失败,使用root用户登录,在 Admin Area -> Pr ...
- Ubuntu Docker 简单安装 GitLab
相关博文: Ubuntu 简单安装 Docker Ubuntu 简单安装和配置 GitLab 服务器版本 Ubuntu 16.04 LTS. 1. 安装和配置 安装命令: sudo docker ru ...
- Centos7安装GitLab
GitLab CE Download Archives gitlab安装调试小记 Gitlab Free Trial GitLab搭建手记 Gitlab社区版的使用 GUI PNG Gitlab升级到 ...
- Centos 6 搭建安装 Gitlab
官方安装教程 gitlab / gitlab-ce 官网下载:https://www.gitlab.cc/downloads 官网安装说明:https://doc.gitlab.cc/ce/insta ...
- git----------如何安装gitlab,使用步骤。
1.配置yum源 vim /etc/yum.repos.d/gitlab-ce.repo 2.复制以下内容到打开的文件中: [gitlab-ce] name=Gitlab CE ...
- Linux安装Gitlab,附iSCSI分区挂载说明
因为Gitlab数据要存放在共享存储,所以本次配置的重头戏倒变成了挂载ISCSI了. OS:CentOS 7.2IP:172.16.1.191/192.168.2.191 iSCSI分Target(服 ...
随机推荐
- 【RocketMQ】负载均衡源码分析
RocketMQ在集群模式下,同一个消费组内,一个消息队列同一时间只能分配给组内的某一个消费者,也就是一条消息只能被组内的一个消费者进行消费,为了合理的对消息队列进行分配,于是就有了负载均衡. 接下来 ...
- AIGC 很火,想微调个自己的模型试试看?(不是卖课的)
去年,我们发布过一篇关于 DreamBooth 编程马拉松的活动通知,获得了全球社区的广泛关注和参与,中国社区的成员们也对这个活动有非常高的热情.同时我们也收到了后台留言反馈说参与活动需要使用的 Go ...
- Ubuntu 安装 office
推荐安装 LibreOffice wget https://free.nchc.org.tw/tdf/libreoffice/stable/7.4.3/deb/x86_64/LibreOffice_7 ...
- SpringCloud NetFlix学习
SpringCloud NetFlix 遇到记录不完全的可以看看这个人的博客 学相伴SpringCloud 微服务架构的4个核心问题? 服务很多,客户端该怎么访问? 负载均衡.反向代理,用户请求的永远 ...
- Java入门与进阶P-5.7+P-5.8
素数 去掉偶数后,从3到x-1 每次加2 ·如果×是偶数,立刻 ·否则要循环(n-3)/2+1遍 ·当n很大时就是n/2遍 构造素数表 欲构造n以内的素数表 1. 令x为2 2. 将2x/ 3x. 4 ...
- vue学习笔记(二) ---- vue实例的生命周期
vue实例的生命周期 什么是生命周期:从Vue实例创建.运行.到销毁期间,总是伴随着各种各样的事件,这些事件,统称为生命周期! 生命周期钩子:就是生命周期事件的别名而已: 生命周期钩子 = 生命周期函 ...
- MD5在Python中的简单使用
MD5不是加密 https://draveness.me/whys-the-design-password-with-md5/ 参考为什么这么设计 Message-Digest Algorithm 5 ...
- 【HMS Core】一张图片带你玩转机器学习服务
1.介绍 总览 Cloud DB(云数据库)是一款端云协同的数据库产品,提供端云数据的协同管理.统一的数据模型和丰富的数据管理API接口等能力.在保证数据的可用性.可靠性.一致性,以及安全等特性基础 ...
- 【学习日志】MongoDB为什么选择B树,而MySQL选择B+树实现索引
先说B树和B+树的区别 B树:非叶子节点也存储数据 B+树:只有叶子节点存储数据,且所有叶子节点通过指针相连接. 为什么MongoDB选择B树而,MySQL选择B+树呢?两种数据结构的区别摆在上面了, ...
- JAVA虚拟机05-内存溢出示例(jdk1.8)
1.JAVA虚拟机堆内存溢出OutOfMemoryError 1.1设置参数 -Xms20m -Xmx20m -XX:+HeapDumpOnOutOfMemoryError 最小堆的大小20m 最大堆 ...