From b6c581492be0d61ba12afe13683ec0d0198c2121 Mon Sep 17 00:00:00 2001 From: Mayne0213 Date: Thu, 18 Dec 2025 19:08:20 +0900 Subject: [PATCH] FEAT(gitea): add gitea Application to apps reposit - Move gitea Application definition to applications repo - Add gitea resources (helm-values, vault secrets, runner deployment) - Update kustomization.yaml to include gitea Application - This enables ArgoCD to manage gitea with proper Helm chart integration --- gitea/argocd/gitea.yaml | 58 ++++++++ gitea/deployment.yaml | 100 +++++++++++++ gitea/helm-values/gitea.yaml | 172 +++++++++++++++++++++++ gitea/kustomization.yaml | 19 +++ gitea/vault/gitea-admin-secret.yaml | 22 +++ gitea/vault/gitea-minio-credentials.yaml | 18 +++ gitea/vault/gitea-postgres-password.yaml | 18 +++ gitea/vault/gitea-runner-token.yaml | 18 +++ gitea/vault/minio-root-password.yaml | 22 +++ 9 files changed, 447 insertions(+) create mode 100644 gitea/argocd/gitea.yaml create mode 100644 gitea/deployment.yaml create mode 100644 gitea/helm-values/gitea.yaml create mode 100644 gitea/kustomization.yaml create mode 100644 gitea/vault/gitea-admin-secret.yaml create mode 100644 gitea/vault/gitea-minio-credentials.yaml create mode 100644 gitea/vault/gitea-postgres-password.yaml create mode 100644 gitea/vault/gitea-runner-token.yaml create mode 100644 gitea/vault/minio-root-password.yaml diff --git a/gitea/argocd/gitea.yaml b/gitea/argocd/gitea.yaml new file mode 100644 index 0000000..b2a570a --- /dev/null +++ b/gitea/argocd/gitea.yaml @@ -0,0 +1,58 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: gitea + namespace: argocd + finalizers: + - resources-finalizer.argocd.argoproj.io +spec: + project: default + + sources: + # Helm chart from Gitea repository + - repoURL: https://dl.gitea.com/charts/ + chart: gitea + targetRevision: 12.4.0 + helm: + valueFiles: + - $values/gitea/helm-values/gitea.yaml + # Values file from Git repository + - repoURL: https://gitea0213.kro.kr/bluemayne/infrastructure.git + targetRevision: main + ref: values + # Vault secrets from Git repository + - repoURL: https://gitea0213.kro.kr/bluemayne/infrastructure.git + targetRevision: main + path: gitea + + destination: + server: https://kubernetes.default.svc + namespace: gitea + + syncPolicy: + automated: + prune: true + selfHeal: true + allowEmpty: false + + syncOptions: + - CreateNamespace=true + - PrunePropagationPolicy=foreground + - PruneLast=true + + retry: + limit: 5 + backoff: + duration: 5s + factor: 2 + maxDuration: 3m + + revisionHistoryLimit: 10 + + # Ignore differences in checksum annotations and manual restart annotations + ignoreDifferences: + - group: apps + kind: Deployment + jqPathExpressions: + - .spec.template.metadata.annotations + - .metadata.annotations diff --git a/gitea/deployment.yaml b/gitea/deployment.yaml new file mode 100644 index 0000000..d87cd87 --- /dev/null +++ b/gitea/deployment.yaml @@ -0,0 +1,100 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: gitea-runner-config + namespace: gitea +data: + config.yaml: | + log: + level: info + runner: + name: k8s-runner + capacity: 10 + timeout: 3h + insecure: false + fetch_timeout: 5s + fetch_interval: 2s + labels: + - "ubuntu-latest:docker://catthehacker/ubuntu:act-latest" + - "ubuntu-24.04:docker://catthehacker/ubuntu:act-latest" + - "ubuntu-24.04-arm:docker://catthehacker/ubuntu:act-latest" + container: + network: host + options: -e DOCKER_HOST=tcp://localhost:2375 +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: gitea-runner + namespace: gitea + labels: + app: gitea-runner +spec: + replicas: 1 + selector: + matchLabels: + app: gitea-runner + template: + metadata: + labels: + app: gitea-runner + spec: + restartPolicy: Always + volumes: + - name: docker-certs + emptyDir: {} + - name: runner-data + emptyDir: {} + - name: config + configMap: + name: gitea-runner-config + containers: + # Docker daemon (Docker-in-Docker) + - name: docker-daemon + image: docker:dind + env: + - name: DOCKER_TLS_CERTDIR + value: "" + securityContext: + privileged: true + volumeMounts: + - name: docker-certs + mountPath: /certs + + # Gitea Actions runner + - name: runner + image: gitea/act_runner:latest + command: + - sh + - -c + - | + while ! nc -z localhost 2375