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