use helm to install gitlab-ce

install gitlab-ce k8s version : v1.16.2

  1. create storageClass use nas
    rbac.yaml:
---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: nfs-client-provisioner
  
---

kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: nfs-client-provisioner-runner
rules:
  - apiGroups: [""]
    resources: ["persistentvolumes"]
    verbs: ["get", "list", "watch", "create", "delete"]
  - apiGroups: [""]
    resources: ["persistentvolumeclaims"]
    verbs: ["get", "list", "watch", "update"]
  - apiGroups: ["storage.k8s.io"]
    resources: ["storageclasses"]
    verbs: ["get", "list", "watch"]
  - apiGroups: [""]
    resources: ["events"]
    verbs: ["list", "watch", "create", "update", "patch"]

---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: run-nfs-client-provisioner
subjects:
  - kind: ServiceAccount
    name: nfs-client-provisioner
    namespace: default
roleRef:
  kind: ClusterRole
  name: nfs-client-provisioner-runner
  apiGroup: rbac.authorization.k8s.io

deploy-mgr-gitlab.yaml

kind: Deployment
apiVersion: apps/v1
metadata:
  name: nfs-gitlab
  namespace: default
  labels:
    app: nfs-gitlab
spec:
  replicas: 1
  selector:
    matchLabels:
      app: nfs-gitlab
      release: base
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: nfs-gitlab
        release: base
    spec:
      serviceAccount: nfs-client-provisioner
      containers:
        - name: nfs-gitlab
          image: nfs/nfs-client-provisioner:v1.1
          imagePullPolicy: IfNotPresent
          volumeMounts:
            - name: nfs-client-root
              mountPath: /persistentvolumes
          resources:
            limits:
              cpu: 2
              memory: 4096Mi
            requests:
              cpu: 500m
              memory: 512Mi
          env:
            - name: PROVISIONER_NAME
              value: fuseim.pri/ifs-gitlab
            - name: NFS_SERVER
              value: xx.xx.xx.xx
            - name: NFS_PATH
              value: /vol/nas_gitlab
      volumes:
        - name: nfs-client-root
          nfs:
            server: xx.xx.xx.xx
            path: /vol/nas_gitlab

nfs-mgr-gitlab.yaml

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: nfs-gitlab
provisioner: fuseim.pri/ifs-gitlab
reclaimPolicy: Retain

apply to k8s cluster with namespace default

kubectl apply -f rbac.yaml 
kubectl apply -f deploy-mgr-gitlab.yaml
kubectl apply -f nfs-mgr-gitlab.yaml

PS: please notice storageclass name must same with env of PROVISIONER_NAME's value

  1. get the charts of gitlab-ce:
    helm fetch stable/gitlab-ce 
    tar -zxvf  gitlab-ce-0.2.1.tgz
  1. modify the template ,and selector info ,and apiVersion. another modify too.
{{- if default "" .Values.externalUrl }}
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ template "gitlab-ce.fullname" . }}
  labels:
    app: {{ template "gitlab-ce.fullname" . }}
    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
    release: "{{ .Release.Name }}"
    heritage: "{{ .Release.Service }}"
spec:
  replicas: 1
  selector:
    matchLabels:
      app: {{ template "gitlab-ce.fullname" . }}

4.create new values.yaml

image: gitlab/gitlab-ce:9.4.1-ce.0
imagePullPolicy: IfNotPresent
externalUrl: http://code.XXXX.com.cn/
gitlabRootPassword: "XXXX"

serviceType: LoadBalancer

##
ingress:
  annotations:
       kubernetes.io/ingress.class: mgr
       kubernetes.io/tls-acme: "true"
  enabled: true
  url: code.XXXX.com.cn

resources:
  requests:
    memory: 4Gi
    cpu: 2
  limits:
    memory: 4Gi
    cpu: 4

persistence:
  gitlabEtc:
    enabled: true
    size: 5Gi
    storageClass: "nfs-gitlab"
    accessMode: ReadWriteOnce
  gitlabData:
    enabled: true
    size: 300Gi
    storageClass: "nfs-gitlab"
    accessMode: ReadWriteOnce
postgresql:
  # 9.6 is the newest supported version for the GitLab container
  image: "postgres"
  imageTag: "9.6"

  cpu: 2
  memory: 4Gi
  postgresUser: gitlab
  postgresPassword: gitlab
  postgresDatabase: gitlab
  persistence:
    storageClass:  "nfs-gitlab"
    size: 50Gi

redis:
  image: "bitnami/redis:3.2.9-r2"

  redisPassword: "gitlab"
  resources:
    requests:
      memory: 3Gi
  persistence:
    storageClass: "nfs-gitlab"
    size: 50Gi
  1. create gitlab namespace
kubectl create namespace gitlab 
helm install --name gitlab --namespace gitlab  stable/nginx-ingress -f values.yaml
  1. get the pods info:
[root@k8s-mgr-01 gitlab-ce]# kubectl get pods
NAME                                 READY   STATUS    RESTARTS   AGE
gitlab-gitlab-ce-d5dd48f4c-k4qv8     1/1     Running   0          65m
gitlab-postgresql-7d67dd4f86-lrz9p   1/1     Running   0          23h
gitlab-redis-64bd9f877b-84q96        1/1     Running   0          23h
  1. sign in web with root and password
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末驮俗,一起剝皮案震驚了整個(gè)濱河市,隨后出現(xiàn)的幾起案子允跑,更是在濱河造成了極大的恐慌王凑,老刑警劉巖,帶你破解...
    沈念sama閱讀 212,884評(píng)論 6 492
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件聋丝,死亡現(xiàn)場(chǎng)離奇詭異索烹,居然都是意外死亡,警方通過查閱死者的電腦和手機(jī)弱睦,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 90,755評(píng)論 3 385
  • 文/潘曉璐 我一進(jìn)店門百姓,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人况木,你說我怎么就攤上這事垒拢。” “怎么了火惊?”我有些...
    開封第一講書人閱讀 158,369評(píng)論 0 348
  • 文/不壞的土叔 我叫張陵求类,是天一觀的道長(zhǎng)。 經(jīng)常有香客問我矗晃,道長(zhǎng)仑嗅,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 56,799評(píng)論 1 285
  • 正文 為了忘掉前任,我火速辦了婚禮仓技,結(jié)果婚禮上鸵贬,老公的妹妹穿的比我還像新娘。我一直安慰自己脖捻,他們只是感情好阔逼,可當(dāng)我...
    茶點(diǎn)故事閱讀 65,910評(píng)論 6 386
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著地沮,像睡著了一般嗜浮。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上摩疑,一...
    開封第一講書人閱讀 50,096評(píng)論 1 291
  • 那天危融,我揣著相機(jī)與錄音,去河邊找鬼雷袋。 笑死吉殃,一個(gè)胖子當(dāng)著我的面吹牛,可吹牛的內(nèi)容都是我干的楷怒。 我是一名探鬼主播蛋勺,決...
    沈念sama閱讀 39,159評(píng)論 3 411
  • 文/蒼蘭香墨 我猛地睜開眼,長(zhǎng)吁一口氣:“原來是場(chǎng)噩夢(mèng)啊……” “哼鸠删!你這毒婦竟也來了抱完?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 37,917評(píng)論 0 268
  • 序言:老撾萬榮一對(duì)情侶失蹤刃泡,失蹤者是張志新(化名)和其女友劉穎巧娱,沒想到半個(gè)月后,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體捅僵,經(jīng)...
    沈念sama閱讀 44,360評(píng)論 1 303
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡家卖,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 36,673評(píng)論 2 327
  • 正文 我和宋清朗相戀三年,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了庙楚。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片上荡。...
    茶點(diǎn)故事閱讀 38,814評(píng)論 1 341
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡,死狀恐怖馒闷,靈堂內(nèi)的尸體忽然破棺而出酪捡,到底是詐尸還是另有隱情,我是刑警寧澤纳账,帶...
    沈念sama閱讀 34,509評(píng)論 4 334
  • 正文 年R本政府宣布逛薇,位于F島的核電站,受9級(jí)特大地震影響疏虫,放射性物質(zhì)發(fā)生泄漏永罚。R本人自食惡果不足惜啤呼,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 40,156評(píng)論 3 317
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望呢袱。 院中可真熱鬧官扣,春花似錦、人聲如沸羞福。這莊子的主人今日做“春日...
    開封第一講書人閱讀 30,882評(píng)論 0 21
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽治专。三九已至卖陵,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間张峰,已是汗流浹背泪蔫。 一陣腳步聲響...
    開封第一講書人閱讀 32,123評(píng)論 1 267
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留挟炬,地道東北人鸥滨。 一個(gè)月前我還...
    沈念sama閱讀 46,641評(píng)論 2 362
  • 正文 我出身青樓,卻偏偏與公主長(zhǎng)得像谤祖,于是被迫代替她去往敵國和親。 傳聞我的和親對(duì)象是個(gè)殘疾皇子老速,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 43,728評(píng)論 2 351