From 3f074ea30680a1dbcd00756a35e9f2bcc54742f1 Mon Sep 17 00:00:00 2001 From: TapTap Date: Mon, 19 Oct 2026 20:19:21 +0200 Subject: [PATCH] add gitea --- argocd/applicationset.yaml | 1 + gitea/external-secret.yaml | 15 +++++ gitea/gitea.yaml | 116 +++++++++++++++++++++++++++++++++++++ gitea/kustomization.yaml | 6 ++ 4 files changed, 138 insertions(+) create mode 100644 gitea/external-secret.yaml create mode 100644 gitea/gitea.yaml create mode 100644 gitea/kustomization.yaml diff --git a/argocd/applicationset.yaml b/argocd/applicationset.yaml index 61d0c93..13754e5 100644 --- a/argocd/applicationset.yaml +++ b/argocd/applicationset.yaml @@ -19,6 +19,7 @@ spec: - path: "plex" - path: "cert-manager" - path: "cloudflare-ddns" + - path: "gitea" template: metadata: name: "{{ index .path.segments 0 }}" diff --git a/gitea/external-secret.yaml b/gitea/external-secret.yaml new file mode 100644 index 0000000..1f54cbd --- /dev/null +++ b/gitea/external-secret.yaml @@ -0,0 +1,15 @@ +apiVersion: external-secrets.io/v1 +kind: ExternalSecret +metadata: + name: gitea-runner-registration-token +spec: + refreshPolicy: CreatedOnce + secretStoreRef: + name: vault-backend + kind: ClusterSecretStore + target: + name: gitea-runner-registration-token + dataFrom: + - extract: + key: gitea + diff --git a/gitea/gitea.yaml b/gitea/gitea.yaml new file mode 100644 index 0000000..13dec35 --- /dev/null +++ b/gitea/gitea.yaml @@ -0,0 +1,116 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: gitea +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: gitea-deployment + labels: + app: gitea +spec: + replicas: 1 + selector: + matchLabels: + app: gitea + template: + metadata: + labels: + app: gitea + spec: + containers: + - name: gitea + image: gitea/gitea:latest + ports: + - name: http + containerPort: 3000 + - name: ssh + containerPort: 2222 + env: + - name: TZ + value: Europe/Berlin + volumeMounts: + - name: gitea-data + mountPath: /data + volumes: + - name: gitea-data + hostPath: + path: /root/kubernetes/gitea/data/data +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: gitea-runner-deployment + labels: + app: gitea-runner +spec: + replicas: 1 + selector: + matchLabels: + app: gitea-runner + template: + metadata: + labels: + app: gitea-runner + spec: + containers: + - name: gitea-runner + image: gitea/runner:latest + env: + - name: GITEA_INSTANCE_URL + value: http://gitea-service:80 + - name: DOCKER_HOST + value: tcp://localhost:2375 + - secretRef: + name: gitea-runner-registration-token + resources: + limits: + memory: "2Gi" + - name: dind + image: docker:dind + securityContext: + privileged: true + env: + - name: DOCKER_TLS_CERTDIR + value: "" + resources: + limits: + memory: "2Gi" +--- +apiVersion: v1 +kind: Service +metadata: + name: gitea-service +spec: + selector: + app: gitea + ports: + - name: http + protocol: TCP + port: 80 + targetPort: 3000 +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: gitea-ingress + annotations: + cert-manager.io/cluster-issuer: "letsencrypt-issuer" +spec: + ingressClassName: "traefik" + tls: + - hosts: + - gitea.tap-tap.win + secretName: gitea-tls-secret + rules: + - host: gitea.tap-tap.win + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: gitea-service + port: + number: 80 diff --git a/gitea/kustomization.yaml b/gitea/kustomization.yaml new file mode 100644 index 0000000..ff75b07 --- /dev/null +++ b/gitea/kustomization.yaml @@ -0,0 +1,6 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: gitea +resources: + - gitea.yaml + - external-secret.yaml