From d48e491be9666fb84a3068b95352ed6f33ea1ed2 Mon Sep 17 00:00:00 2001 From: TapTap Date: Tue, 20 Oct 2026 15:37:30 +0200 Subject: [PATCH] add gitlab --- gitlab/configmap.yaml | 16 ++++++++++++++ gitlab/deployment.yaml | 43 +++++++++++++++++++++++++++++++++++++ gitlab/external-secret.yaml | 14 ++++++++++++ gitlab/ingress.yaml | 17 +++++++++++++++ gitlab/kustomization.yaml | 10 +++++++++ gitlab/namespace.yaml | 4 ++++ gitlab/service.yaml | 11 ++++++++++ 7 files changed, 115 insertions(+) create mode 100644 gitlab/configmap.yaml create mode 100644 gitlab/deployment.yaml create mode 100644 gitlab/external-secret.yaml create mode 100644 gitlab/ingress.yaml create mode 100644 gitlab/kustomization.yaml create mode 100644 gitlab/namespace.yaml create mode 100644 gitlab/service.yaml diff --git a/gitlab/configmap.yaml b/gitlab/configmap.yaml new file mode 100644 index 0000000..1f5e772 --- /dev/null +++ b/gitlab/configmap.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: gitlab-configmap +data: + GITLAB_ROOT_EMAIL: taptap.programming@gmail.com + GITLAB_OMNIBUS_CONFIG: | + external_url 'https://gitlab.tap-tap.win' + nginx['listen_https'] = false + nginx['listen_port'] = 80 + nginx['real_ip_trusted_addresses'] = [ '10.42.0.0/16', '10.43.0.0/16', '172.16.0.0/12' ] + nginx['real_ip_header'] = 'X-Forwarded-For' + registry_nginx['listen_https'] = false + registry_external_url 'https://registry.tap-tap.win' + GITLAB_REGISTRY_ENABLED: "true" + GITLAB_REGISTRY_HOST: "registry.tap-tap.win" diff --git a/gitlab/deployment.yaml b/gitlab/deployment.yaml new file mode 100644 index 0000000..f949d87 --- /dev/null +++ b/gitlab/deployment.yaml @@ -0,0 +1,43 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: gitlab-deployment + labels: + app: gitlab +spec: + replicas: 0 + selector: + matchLabels: + app: gitlab + template: + metadata: + labels: + app: gitlab + spec: + containers: + - name: gitlab + image: gitlab/gitlab-ce:18.11.2-ce.0 + ports: + - containerPort: 80 + envFrom: + - secretRef: + name: gitlab-secret + - configMapRef: + name: gitlab-configmap + volumeMounts: + - name: gitlab-volume-config + mountPath: /etc/gitlab + - name: gitlab-volume-logs + mountPath: /var/log/gitlab + - name: gitlab-volume-data + mountPath: /var/opt/gitlab + volumes: + - name: gitlab-volume-config + hostPath: + path: /root/kubernetes/gitlab/data/config + - name: gitlab-volume-logs + hostPath: + path: /root/kubernetes/gitlab/data/logs + - name: gitlab-volume-data + hostPath: + path: /root/kubernetes/gitlab/data/data diff --git a/gitlab/external-secret.yaml b/gitlab/external-secret.yaml new file mode 100644 index 0000000..4ec81b4 --- /dev/null +++ b/gitlab/external-secret.yaml @@ -0,0 +1,14 @@ +apiVersion: external-secrets.io/v1alpha1 +kind: ExternalSecret +metadata: + name: gitlab-root-password +spec: + secretStoreRef: + name: vault-backend + kind: ClusterSecretStore + target: + name: gitlab-root-password + refreshPolicy: CreatedOnce + dataFrom: + - extract: + key: gitlab diff --git a/gitlab/ingress.yaml b/gitlab/ingress.yaml new file mode 100644 index 0000000..b831fda --- /dev/null +++ b/gitlab/ingress.yaml @@ -0,0 +1,17 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: gitlab-ingress +spec: + ingressClassName: "traefik" + rules: + - host: gitlab.tap-tap.win + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: gitlab-service + port: + number: 80 \ No newline at end of file diff --git a/gitlab/kustomization.yaml b/gitlab/kustomization.yaml new file mode 100644 index 0000000..12c79b7 --- /dev/null +++ b/gitlab/kustomization.yaml @@ -0,0 +1,10 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: gitlab +resources: + - namespace.yaml + - secret.yaml + - configmap.yaml + - deployment.yaml + - service.yaml + - ingress.yaml diff --git a/gitlab/namespace.yaml b/gitlab/namespace.yaml new file mode 100644 index 0000000..d0fbd68 --- /dev/null +++ b/gitlab/namespace.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: gitlab \ No newline at end of file diff --git a/gitlab/service.yaml b/gitlab/service.yaml new file mode 100644 index 0000000..d31ed3d --- /dev/null +++ b/gitlab/service.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: gitlab-service +spec: + selector: + app: gitlab + ports: + - protocol: TCP + port: 80 + targetPort: 80 \ No newline at end of file