helm3安裝gitlab

一、添加helm源node

helm repo add stable https://kubernetes-charts.storage.googleapis.com
helm repo add aliyun https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts
helm repo add  apphub https://apphub.aliyuncs.com/
git

image-20191208143345136.png

二、下載gitlab-ceredis

helm pull stable/gitlab-ce
tar  -zxvf  gitlab-ce-0.2.2.tgzsql

image-20191208162422584.png

三、修改values.yaml文件vim

image-20191208164650121.png

四、安裝api

helm install gitlab gitlab-cebash

備註:因爲我是最新16.3的集羣,因此這裏會報錯。若是你是16如下的版本這裏不會報錯app


grep -irl "extensions/v1beta1" gitlab-ce | grep deployment
grep -irl "extensions/v1beta1" gitlab-ce | grep deploy | xargs sed -i 's#extensions/v1beta1#apps/v1#g'
ide

image-20191208162849870.png

#在進行安裝,錯誤緣由是現有 k8s不支持gitlab-ce的deployment spec
helm install gitlab gitlab-ce
grep -irl "apps/v1" gitlab-ce | grep deployment
gitlab

image-20191208163017603.png

依次修改配置文件:

vim gitlab-ce/templates/deployment.yaml
添加:
  replicas: 1
  selector:
    matchLabels:
      app: {{ template "gitlab-ce.fullname" . }}

image-20191208164344044.png

vim gitlab-ce/charts/postgresql/templates/deployment.yaml
添加:
  selector:
    matchLabels:
      app: {{ template "postgresql.fullname" . }}

image-20191208164456496.png

vim gitlab-ce/charts/redis/templates/deployment.yaml
添加:
  selector:
    matchLabels:
      app: {{ template "redis.fullname" . }}

image-20191208164543666.png

在進行安裝

helm install gitlab gitlab-ce

image-20191208163321853.png

五、查看集羣狀態

kubectl get pod
image-20191208163410784.png

#因爲資源須要請求pv,因此咱們還須要建立pv
kubectl get pv
kubectl get pvc

image-20191208163548128.png

#在worker節點建立hostpath掛在目錄
mkdir  -p  /data/gitlab/pv{1..4}

在master節點建立pv文件

[root@node1 pv]# cat pv1.yaml 
apiVersion: v1
kind: PersistentVolume
metadata:
  name: gitlab-pv1
spec:
  capacity:
    storage: 10Gi
  volumeMode: Filesystem
  accessModes:
  -  ReadWriteOnce
     persistentVolumeReclaimPolicy: Retain
       hostPath:
     path: /data/gitlab/pv1

image-20191208163829783.png

image-20191208163904286.png

再查看集羣狀態

image-20191208163957511.png

登陸界面

image-20191208164012158.png

相關文章
相關標籤/搜索