helm repo add aliyun https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts
helm repo add? apphub https://apphub.aliyuncs.com/
2、下載gitlab-ce
helm pull stable/gitlab-ce
tar? -zxvf? gitlab-ce-0.2.2.tgz
3、修改values.yaml文件
4、安裝
helm install gitlab gitlab-ce
備注:由于我是最新16.3的集群,所以這里會報錯。如果你是16以下的版本這里不會報錯
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\\\’
#在進行安裝,錯誤原因是現(xiàn)有 k8s不支持gitlab-ce的deployment spec
helm install gitlab gitlab-ce
grep -irl apps/v1 gitlab-ce | grep deployment
依次修改配置文件:
vim gitlab-ce/templates/deployment.yaml
添加:
? replicas: 1
? selector:
? matchLabels:
? app: {{ template gitlab-ce.fullname . }}
vim gitlab-ce/charts/postgresql/templates/deployment.yaml
添加:
? selector:
? matchLabels:
? app: {{ template postgresql.fullname . }}
vim gitlab-ce/charts/Redis/templates/deployment.yaml
添加:
? selector:
? matchLabels:
? app: {{ template redis.fullname . }}
在進行安裝
helm install gitlab gitlab-ce
5、查看集群狀態(tài)
kubectl get pod
#由于資源需要請求pv,所以我們還需要創(chuàng)建pv
kubectl get pv
kubectl get pvc
#在worker節(jié)點創(chuàng)建hostpath掛在目錄
mkdir? -p? /data/gitlab/pv{1..4}
在master節(jié)點創(chuàng)建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
再查看集群狀態(tài)
登錄界面
更多關(guān)于云服務(wù)器,域名注冊,虛擬主機的問題,請訪問西部數(shù)碼官網(wǎng):www.ps-sw.cn