An easy way to install GitLab in Kuberentes. This repository contains manifests for installing GitLab in Kubernetes with one Pod, in fact, the same approach is used as in docker-compose. This installation is not intended for production loads. Use it for tests.
To access SSH Github via NodePort, uncomment the following lines in the service.yaml file:
---
kind: Service
apiVersion: v1
metadata:
name: gitlab-gitlab-shell
namespace: gitlab
spec:
type: NodePort
selector:
app: gitlab
ports:
- port: 2222
targetPort: 22
protocol: TCP
name: ssh
nodePort: 32222
edit ~/.ssh/config
Host kube-gitlab.local #You Host
Port 2222 #NodePort
User git
git clone kube-gitlab.local:[you repo]
kubectl taint nodes worker1.local kube-app=gitlab:NoSchedule
Edit you nginx Ingress controller
- --tcp-services-configmap=$(POD_NAMESPACE)/tcp-services
- --udp-services-configmap=$(POD_NAMESPACE)/udp-services
#kubectl edit deployments -n kube-system ingress-nginx-controller
spec:
containers:
- args:
- /nginx-ingress-controller
- --publish-service=kube-system/ingress-nginx-controller
- --election-id=ingress-controller-leader
- --ingress-class=nginx
- --configmap=kube-system/ingress-nginx-controller
- --tcp-services-configmap=$(POD_NAMESPACE)/tcp-services
- --udp-services-configmap=$(POD_NAMESPACE)/udp-services
- --validating-webhook=:8443
- --validating-webhook-certificate=/usr/local/certificates/cert
- --validating-webhook-key=/usr/local/certificates/key
Use patch Service Ingress Controller
spec:
ports:
- name: proxied-tcp-ssh
port: 2222
targetPort: 2222
protocol: TCP
kubectl -n ingress-nginx patch service ingress-nginx-controller --patch "$(cat service-patch-ssh.yaml)"
Add Configmap:
apiVersion: v1
kind: ConfigMap
metadata:
name: tcp-services
namespace: ingress-nginx
data:
"2222": "gitlab/gitlab-gitlab-shell:2222"