3-4 years old:
https://github.com/adavarski/k3s-GitLab-development
2023:
https://dev.to/glasskube/gitlab-on-kubernetes-the-ultimate-deployment-guide-188b
- A Kubernetes cluster
- Helm
- kubectl
- A domain name
- An SSL certificate for the domain name (from Ryan)
helm repo add gitlab https://charts.gitlab.io/
helm install gitlab gitlab/gitlab \
--set global.hosts.domain=10.1.10.33.nip.io \
--set certmanager-issuer.email=me@example.com
- Obtain cert from Ryan
kubectl create secret tls gitlab-cert --cert=<path/to-full-chain.crt> --key=<path/to.key>
or generate a self-signed cert
openssl req -x509 -nodes -days 365 -newkey rsa:4096 -keyout tls.key -out tls.crt -subj "/CN=10.1.10.33.nip.io"
kubectl create secret tls gitlab-cert --cert=tls.crt --key=tls.key
- Enable stuff
k3s
1. Add the Gitlab Helm repository
```bash
helm repo add gitlab https://charts.gitlab.io/
- Install the Gitlab chart
kubectl create namespace gitlab
helm install gitlab gitlab/gitlab --namespace gitlab -f gitlab.yaml
- Wait for the pods to be ready
kubectl get pods -n gitlab
- Get the root password
kubectl get secret gitlab-gitlab-initial-root-password -n gitlab -ojsonpath='{.data.password}' | base64 --decode ; echo
Then open a browser and go to http://localhost:8080
and log in with the root password.
kubectl patch deployment metrics-server -n kube-system --type json -p '[
{ "op": "add", "path": "/spec/template/spec/containers/0/args/-", "value": "--kubelet-insecure-tls" },
{ "op": "add", "path": "/spec/template/spec/containers/0/args/-", "value": "--kubelet-preferred-address-types=InternalIP,ExternalIP" }
]'
kubectl edit deployment/gitlab-gitlab-runner -n gitlab
helm uninstall gitlab
kubectl delete pvc -l release=gitlab
kubectl delete pv -l release=gitlab