helm 安装gitlab
时间: 2023-11-21 11:57:34 浏览: 174
helm部署gitlab.md
以下是使用Helm安装GitLab的步骤:
1. 添加GitLab Helm仓库
```shell
helm repo add gitlab https://charts.gitlab.io
```
2. 创建GitLab命名空间
```shell
kubectl create namespace gitlab
```
3. 为GitLab创建一个values.yaml文件,其中包含必要的配置选项。例如:
```yaml
global:
edition: ce
minio:
enabled: false
postgresql:
install: true
postgresUser: gitlab
postgresPassword: gitlab
postgresDatabase: gitlabhq_production
redis:
install: true
certmanager-issuer:
email: you@example.com
ingress:
configureCertmanager: true
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/proxy-body-size: "0"
nginx.ingress.kubernetes.io/proxy-read-timeout: "600"
nginx.ingress.kubernetes.io/proxy-send-timeout: "600"
nginx.ingress.kubernetes.io/ssl-redirect: "true"
nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
nginx.ingress.kubernetes.io/secure-backends: "true"
nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
nginx.ingress.kubernetes.io/proxy-buffering: "on"
nginx.ingress.kubernetes.io/proxy-buffer-size: "16k"
nginx.ingress.kubernetes.io/proxy-buffers-number: "4"
nginx.ingress.kubernetes.io/proxy-request-buffering: "on"
nginx.ingress.kubernetes.io/proxy-request-buffer-size: "16k"
nginx.ingress.kubernetes.io/proxy-response-buffering: "on"
nginx.ingress.kubernetes.io/proxy-response-buffer-size: "16k"
nginx.ingress.kubernetes.io/proxy-send-timeout: "600"
nginx.ingress.kubernetes.io/proxy-read-timeout: "600"
nginx.ingress.kubernetes.io/proxy-connect-timeout: "75"
nginx.ingress.kubernetes.io/proxy-next-upstream: "error timeout invalid_header http_500 http_502 http_503 http_504"
nginx.ingress.kubernetes.io/rewrite-target: /$2
nginx.ingress.kubernetes.io/configuration-snippet: |
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Ssl on;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_http_version 1.1;
client_max_body_size 0;
chunked_transfer_encoding on;
gitlab:
webservice:
ingress:
enabled: true
annotations:
nginx.ingress.kubernetes.io/ssl-redirect: "true"
nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
nginx.ingress.kubernetes.io/rewrite-target: /$2
nginx.ingress.kubernetes.io/configuration-snippet: |
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Ssl on;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_http_version 1.1;
client_max_body_size 0;
chunked_transfer_encoding on;
hosts:
- host: gitlab.example.com
paths:
- path: /gitlab(/|$)(.*)
backend:
serviceName: gitlab-webservice
servicePort: http
```
4. 安装GitLab
```shell
helm upgrade --install gitlab gitlab/gitlab \
--namespace=gitlab \
--set gitlab-runner.install=true \
--set gitlab-runner.certsSecretName=gitlab-runner-certs \
--reuse-values \
-f values.yaml
```
请注意,这里的values.yaml文件中的配置选项仅供参考,您需要根据自己的需求进行修改。
阅读全文