Repository navigation
feat(k8s): the homelab runs gitea under argo cd as a read-write internal forge, served in-cluster over http and to workstations at https://git.<domain> through the cloudflare tunnel, with its admin secret pushed from the keyring #1081
Description
Problem
Checked: release/v0.2.25 at e9973c7 (every cited line is the same at 132ecc5); Gitea's chart v12.7.0 (values.yaml, templates/_helpers.tpl) and Gitea v1.27.3; the Argo CD v3.5.3 docs. Read-only on the live setup: devops cloudflare tunnel routes, access status and access policies, and kubectl get svc,nodes on the cluster's context. All on 2026-10-03.
Owner directions (2026-10-06 update).
- When Gitea is implemented, Argo CD applications will point to Gitea for git and container registries.
- Gitea container registry will be enabled, and development versions will be available to the cluster for all open pull requests.
- Gitea will be used for internal iterative development that happens without going out to GitHub, so read-only does not apply; every git repository under
repos/gets multiple remotes. Gitea is a writable forge, hosting both Git repositories and the internal container registry. - Gitea communicates inside the cluster over HTTP, and the devops-cli configuration uses the Cloudflare tunnel domain alias over HTTPS. Gitea gets no NodePort: pods and Argo CD use the in-cluster Service over HTTP, and workstations use
https://git.<domain>, as the CLI already useshttps://ai.<domain>/v1forai.gateway_url. - The owner noted that a NAS on the local network could hold the cluster's backups later, once there are production artifacts worth keeping outside GitHub. Backups are out of scope for now (see Strategic alignment).
What changes because Gitea is writable.
- Pull mirrors no longer fit. A Gitea pull mirror refuses pushes. Push mirrors don't fit either: Gitea's docs say a push mirror "will force push to the remote repository. This will overwrite any changes in the remote repository" (usage/repository/repo-mirror), and
CreatePushMirrorOptionhas no branch filter (swagger at v1.27.3). GitHub would lose its own merges. - No mirror machinery. No PostSync Job, mirror script, mirror list, GitHub token for Gitea or
argocdreader account. Repositories are created bydevops repos(feat(repos): Add a gitea remote to every clone under repos/ #1090). Argo CD's read access is feat(k8s): Point Argo CD to Gitea for git and PR dev images #1082. - Gitea needs no egress. With mirrors, migrations and the update checker off, Gitea calls nothing outside its namespace.
The database choice is made now. Gitea's docs say converting between database types "is not well-tested, which is why it is recommended to choose the final database type during the first installation" (administration/backup-and-restore).
How workstations reach cluster services today.
- The tunnel.
cloudflaredruns a token-managed tunnel (k8s/cloudflared/deployment.yaml:33-44). Its routes live in Cloudflare, not in git. The documented route is one wildcard public hostname to Traefik (k8s/README.md:239-247), anddevops cloudflare tunnel syncanddns syncdefault to the subdomains*and@(CONST_CLOUDFLARE_DEFAULT_SUBDOMAINS, src/devops_cli/config/constants.py:543). cloudflared may forward only to Traefik (k8s/cloudflared/networkpolicy.yaml:43-55).- Live, 2026-10-03. The tunnel routes
*.<domain>and<domain>tohttp://traefik.kube-system.svc.cluster.local:80, astunnel syncwrites them. The README's dashboard steps and diagram (k8s/README.md:214-247) still name*.homelab.<domain>; the guide below uses the<name>.<k8s.domain>form the other Ingress hosts use. - No plain-HTTP way in from the LAN. Traefik's Service is
ClusterIP(k8s/ingress/traefik-values.yaml:9-11; live: ClusterIP, ports 80 and 443), so the Ingress below is reached only through the tunnel.
- Live, 2026-10-03. The tunnel routes
- Hosts. Traefik routes
<name>.example.comIngress hosts (k8s/ingress/ingress-routes.yaml), withexample.comreplaced byk8s.domainat apply time (src/devops_cli/k8s/template.py:66-70). feat(k8s): argo cd keeps the homelab cluster at the current release branch, with automated sync, prune and self-heal that never delete data #755 moves that replacement into the homelab overlays. A new host under the same wildcard needs only an Ingress: no new tunnel route, DNS record or certificate. - Settings.
devops k8s configure-urls --addressing fqdnreads the Ingress hosts and writeshttps://<host>intoargocd.url,grafana.url,ai.gateway_urland the others (src/devops_cli/commands/k8s/networking.py:698-786). - Cloudflare Access. One self-hosted Access application covers the wildcard (k8s/README.md:249-254).
devops cloudflare access syncgives it an email allow policy and, when bypass IPs are configured, ahomelab-public-ip-bypasspolicy with decisionbypass(src/devops_cli/cloudflare/client.py:693-788). The CLI sends no Access headers anywhere: noCF-Access-Client-Idor service token is in src/. So the CLI'shttps://<name>.<domain>URLs work today only from the address in the bypass policy.- Live, 2026-10-03. Two Access applications exist:
<domain>(apex) and*.<domain>(wildcard). The wildcard's policies arehomelab-public-ip-bypass(bypass, aniprule) andAllow homelab authorized emails(allow,emailrules). From the devcontainer, theargocd,grafanaandaihosts answer directly, with no Access redirect. access synctargets the apex unless told otherwise. It finds the application by--domain, which defaults tocloudflare.domain, the apex (src/devops_cli/commands/cloudflare.py:725). It also rewrites the allow policy from--allowed-emailsorcloudflare.access.allowed_emailson every run (cloudflare/client.py:767-773); with no emails given, the allow policy's rules would be replaced by an empty list. Refreshing the wildcard's bypass therefore takes--domain '*.<domain>'and the allowed emails as well.
- Live, 2026-10-03. Two Access applications exist:
What this means for git. Git over HTTPS cannot follow the Access login redirect, and git's credential helpers supply only a username and password, not extra headers. Gitea's host can sit behind the same Access application as the other hosts: the workstation passes the IP bypass, and Gitea's own token authentication then applies. Browsers elsewhere sign in through Access SSO first and then through Gitea. No secret goes into git config.
Gitea's URLs. The chart derives DOMAIN from the first Ingress host. It builds ROOT_URL as http:// unless the Ingress has a tls block (templates/_helpers.tpl:244-252 and :401-441 at v12.7.0). TLS ends at Cloudflare, so ROOT_URL is set explicitly to https://git.<domain>/. Otherwise the clone URLs Gitea shows and the links its push hooks print would be http://. The rootless image starts Gitea's built-in SSH server by default (the same lines).
Outcome:
- Gitea runs in namespace
giteafrom its official chart, managed by one Argo CD Application in feat(k8s): argo cd keeps the homelab cluster at the current release branch, with automated sync, prune and self-heal that never delete data #755's app-of-apps. - Gitea provides both an internal Git forge and an in-cluster container registry.
- Argo CD applications point to Gitea for git and container registries, making development versions available to the cluster for all open pull requests.
- Pods and Argo CD reach it at
http://gitea-http.gitea.svc.cluster.local:3000. - Workstations reach it at
https://git.<domain>through the tunnel and Traefik. feat(repos): Add a gitea remote to every clone under repos/ #1090'sgitea.urlsetting holds that URL. - It is a normal, writable forge with private repositories, running on SQLite in WAL mode on a protected PVC. SSH is off.
- The admin credential lives in the keyring and reaches the cluster only through
push-secrets.
Acceptance criteria
In the gate.
-
These tests touch no cluster and no network, and use structural tuple assertions.
-
Together they add under 1 s, checked with
uv run pytest tests/test_k8s_gitea.py tests/test_k8s_network_policies.py tests/test_third_party_telemetry.py tests/test_k8s_push_secrets.py --durations=0. -
Manifests.
k8s/gitea/holdsnamespace.yaml,values.yaml,networkpolicy.yamlandkustomization.yaml.namespace.yamlcreates namespacegiteawith Pod Securityrestrictedfor enforce, warn and audit (as k8s/namespaces.yaml:24-32 does forotel). It is annotatedargocd.argoproj.io/sync-options: Prune=false,Delete=false.- The kustomization's
resourcesare exactlynamespace.yamlandnetworkpolicy.yaml. - The root
k8s/kustomization.yamlleavesgiteaout, because it is also applied to minikube._HELM_RELEASES_BY_STACK(src/devops_cli/commands/k8s/stack_lifecycle.py:63) gets no Gitea entry.
-
Homelab values.
k8s/overlays/homelab/gitea/values.yaml, beside feat(k8s): argo cd keeps the homelab cluster at the current release branch, with automated sync, prune and self-heal that never delete data #755's homelab overlays, holds only the domain:ingress.hosts[0].host: git.<domain>;gitea.config.server.ROOT_URL: https://git.<domain>/.<domain>is the same domain feat(k8s): argo cd keeps the homelab cluster at the current release branch, with automated sync, prune and self-heal that never delete data #755'sk8s/overlays/homelab/ingresspatches in. The test asserts that the host andROOT_URLname the same domain and that it equals that overlay's.
-
Application.
k8s/argocd/apps/gitea.yaml, projecthomelab. tests/test_k8s_gitea.py asserts:- the chart source is
giteafromhttps://dl.gitea.com/charts/at an exact version (^\d+\.\d+\.\d+$), with value files$values/k8s/gitea/values.yamland then$values/k8s/overlays/homelab/gitea/values.yaml; - the git sources (the
valuesref and the pathk8s/gitea) readhttps://github.com/dan-petty/devops-cli.gitat the revision feat(k8s): argo cd keeps the homelab cluster at the current release branch, with automated sync, prune and self-heal that never delete data #755's Applications use. The Application that runs Gitea never reads Gitea; - the destination namespace is
gitea, and the finalizer, the automated prune and selfHeal, and theretrywith backoff match feat(k8s): argo cd keeps the homelab cluster at the current release branch, with automated sync, prune and self-heal that never delete data #755's leaf Applications; - feat(k8s): argo cd keeps the homelab cluster at the current release branch, with automated sync, prune and self-heal that never delete data #755's
homelabAppProject listsgiteaamong its destinations andhttps://dl.gitea.com/charts/among its sourceRepos.
- the chart source is
-
Values. The same test asserts, on
values.yamlmerged with the homelab file:- Bundled services off. Every bundled service the pinned chart has is disabled:
postgresql,postgresql-ha,valkey, andvalkey-clusteron 12.x. - Database.
database.DB_TYPEissqlite3anddatabase.SQLITE_JOURNAL_MODEisWAL.SQLITE_TIMEOUTkeeps its default of 20000 ms.session.PROVIDERisdb, so a restart does not sign anyone out.cache.ADAPTERismemoryandqueue.TYPEislevel.server.APP_DATA_PATH,repository.ROOTanddatabase.PATHare not overridden.
- Rollout. One replica, with strategy
Recreate(strategy.typeon 12.x,deployment.strategy.typeon 13.x). - Storage.
- Persistence is on (13.x defaults it to off), with claim
gitea-shared-storageat 10Gi. - The PVC is annotated
argocd.argoproj.io/sync-options: Prune=false,Delete=false.
- Persistence is on (13.x defaults it to off), with claim
- Admin. The admin comes from the existing Secret
gitea-admin, with no password inline. - In-cluster Service.
service.http.typeisClusterIPon port 3000 (the chart's defaults, asserted). No Service of typeNodePortorLoadBalanceris rendered. - Ingress.
ingress.enabledis true,ingress.classNameistraefik, and the annotationtraefik.ingress.kubernetes.io/router.entrypoints: webmatches k8s/ingress/ingress-routes.yaml.- One host, path
/withpathType: Prefix, and notlsblock (TLS ends at Cloudflare). - In
values.yamlalone the host is the placeholdergit.example.com. After the merge, no value containsexample.com.
- URLs. After the merge,
gitea.config.server.ROOT_URLishttps://+ the Ingress host +/.DOMAINis left to the chart, which takes the Ingress host. - SSH off.
server.DISABLE_SSHis true andserver.START_SSH_SERVERis false. The rootless image would otherwise start the built-in server on 2222. - Image. The rootless image, with
image.tagset explicitly. - Locked down.
service.DISABLE_REGISTRATIONandservice.REQUIRE_SIGNIN_VIEWare true.repository.DEFAULT_PRIVATEisprivate.repository.ENABLE_PUSH_CREATE_USERandENABLE_PUSH_CREATE_ORGstay false, so a mistyped remote cannot create a repository.repository.DISABLE_MIGRATIONSis true andmirror.ENABLEDis false.actions.ENABLEDis false, andpackages.ENABLEDis true (enabling Gitea container registry for development images).
- Phone-home.
cron.update_checker.ENABLEDis false. This assertion lives in tests/test_third_party_telemetry.py, beside the other opt-outs. - Security context. The pod and container security contexts follow k8s/llm/gateway/deployment.yaml:22-39: non-root 1000, RuntimeDefault seccomp, no privilege escalation, read-only root filesystem, all capabilities dropped.
- Resources. Requests of 100m CPU and 256Mi; limits of 1 CPU and 1Gi.
- Bundled services off. Every bundled service the pinned chart has is disabled:
-
Network policy.
networkpolicy.yaml, selecting Gitea's pods:- Membership.
giteajoinsTARGET_NAMESPACES(tests/test_k8s_network_policies.py:16). It does not join the external-egress namespaces. - Ingress on TCP 3000 only, from:
- Traefik's pods in
kube-system(namespace and pod selector in one peer, as k8s/monitoring/networkpolicy.yaml:25-31): the path from the tunnel; argocd-repo-serverpods inargocd: the path feat(k8s): Point Argo CD to Gitea for git and PR dev images #1082 uses;- pods in
gitea.
- Traefik's pods in
- No peer is an
ipBlock: kube-router matches ingress CIDRs against pod addresses (k8s/README.md:155), so a range would admit every pod. - Egress. DNS, and pods in
gitea. - The test asserts these peers and ports as tuples, and that 22 and 2222 are admitted from nowhere.
- Membership.
-
push-secrets row. feat(k8s): devops-cli runs in the homelab cluster as Jobs, and every cluster Secret is pushed from the keyring, also by deploy-stack (devops k8s push-secrets, devops k8s run-job) #741's table gains
gitea/gitea-admin, stackgitea:username← configgitea.admin_username(not a secret). It must not be a name Gitea reserves, such asadmin;password← keyringgitea_admin_password, a managed optiongitea.admin_passwordinSECRET_CONFIG_OPTIONS, with its env name fromOPTION_TO_ENV_VARand its keyring key fromKEYRING_KEYS. It is required and never generated;- on chart 13.x,
email= a fixed placeholder at example.com; - it restarts
deployment/giteawhen it changes. - tests/test_k8s_push_secrets.py asserts the row and its env name, and that
--dry-runlists the Secret without a value. - feat(k8s): argo cd keeps the homelab cluster at the current release branch, with automated sync, prune and self-heal that never delete data #755's orphan-ignore list, which is built from the push table, covers it.
-
Guide. A "Gitea" section in k8s/README.md covers:
- What Gitea is for. The internal forge for iteration branches. GitHub stays authoritative for
main, tags, PRs, CI and releases. feat(repos): Add a gitea remote to every clone under repos/ #1090 describes the remotes. - Addresses. In the cluster:
http://gitea-http.gitea.svc.cluster.local:3000. From a workstation:https://git.<domain>, held ingitea.url(feat(repos): Add a gitea remote to every clone under repos/ #1090). The tunnel diagram (k8s/README.md:214-235) gainsgit.<domain>→ gitea. TLS ends at Cloudflare; from cloudflared on, requests are plain HTTP on the pod network, which flannel'svxlanbackend carries between nodes unencrypted. - What a person configures in Cloudflare. Nothing new, when the existing setup is in place:
- the tunnel's wildcard public hostname to Traefik, and the wildcard DNS record (
devops cloudflare tunnel routes,devops cloudflare dns list;tunnel syncanddns synccreate them); - the Access application covering the wildcard, with the
homelab-public-ip-bypasspolicy naming the workstation's current public address (devops cloudflare access status --jsongives the application's ID, thendevops cloudflare access policies <app-id>). - When that address changes, git and the API answer with a redirect to the Access login. Set
cloudflare.access.allowed_emailsandcloudflare.access.bypass_ips(the new address), then rundevops cloudflare access sync --domain '*.<domain>' --dry-runand, if it names the wildcard and both lists, the same without--dry-run. Without--domainthe command updates the apex application, and without the emails it would empty the allow policy. - If git receives a Cloudflare challenge page instead of Gitea's reply, the zone's bot or WAF settings are challenging git's client. Exempt host
git.<domain>from that challenge.
- the tunnel's wildcard public hostname to Traefik, and the wildcard DNS record (
- Why git needs no Access headers. As above: the bypass admits the workstation, and Gitea's token does the authentication.
- Rollout order.
uv run devops config set gitea.admin_passwordandgitea.admin_username.- Merge. feat(k8s): argo cd keeps the homelab cluster at the current release branch, with automated sync, prune and self-heal that never delete data #755's
clusterApplication creates namespacegitea. The Gitea pod waits inCreateContainerConfigErroruntil its Secret exists. uv run devops k8s push-secrets --stack gitea --context <context>. The pod then starts without further action. From then on every deploy-stack run pushes thegitearow too, since namespacegiteaexists (feat(k8s): devops-cli runs in the homelab cluster as Jobs, and every cluster Secret is pushed from the keyring, also by deploy-stack (devops k8s push-secrets, devops k8s run-job) #741).- Set the bound PV's reclaim policy to Retain, as feat(k8s): argo cd keeps the homelab cluster at the current release branch, with automated sync, prune and self-heal that never delete data #755 asks for every PV.
- Rotating the admin password. Update the keyring and run
push-secrets --stack gitea. It restarts Gitea (feat(k8s): devops-cli runs in the homelab cluster as Jobs, and every cluster Secret is pushed from the keyring, also by deploy-stack (devops k8s push-secrets, devops k8s run-job) #741). - No backups yet. Gitea's data lives on one node's
local-pathvolume. An iteration branch also exists in the clone that pushed it. Issues and pull requests created in Gitea do not, so they are lost if the node is lost. Backups follow in a later item. - Upgrading the chart. Note that 13.0.0 replaces
gitea.adminwithsecrets.admin.
- What Gitea is for. The internal forge for iteration branches. GitHub stays authoritative for
-
devops pr check-readinesspasses. -
uv run devops cipasses within its 5-minute budget.
Checks a person runs on the homelab (the cluster's kube context):
-
Run these after feat(k8s): argo cd keeps the homelab cluster at the current release branch, with automated sync, prune and self-heal that never delete data #755 and feat(k8s): devops-cli runs in the homelab cluster as Jobs, and every cluster Secret is pushed from the keyring, also by deploy-stack (devops k8s push-secrets, devops k8s run-job) #741 have landed and the push above has succeeded, from the devcontainer.
-
$GITEAishttps://git.<domain>. -
$ADMINis<admin-user>:<password>; read the password withuv run keyring get devops-cli gitea_admin_password. -
Pending a person, Sync:
kubectl -n argocd get application gitea -o jsonpath='{.status.sync.status} {.status.health.status}{"\n"}'printsSynced Healthy. -
Pending a person, Pod Security:
kubectl label --dry-run=server --overwrite ns gitea pod-security.kubernetes.io/enforce=restrictedprints no warning. -
Pending a person, Data kept: both of these print
Prune=false,Delete=false, andkubectl get pv <bound-pv> -o jsonpath='{.spec.persistentVolumeReclaimPolicy}'printsRetain:kubectl -n gitea get pvc gitea-shared-storage -o jsonpath='{.metadata.annotations.argocd\.argoproj\.io/sync-options}{"\n"}'kubectl get ns gitea -o jsonpath='{.metadata.annotations.argocd\.argoproj\.io/sync-options}{"\n"}'
-
Pending a person, Cloudflare: the tunnel's routes include the wildcard to Traefik, and the Access application covering the wildcard has the bypass policy with the current public address (commands in the guide).
-
Pending a person, Reachable through the tunnel and locked:
curl -s -o /dev/null -w '%{http_code}\n' "$GITEA/api/v1/repos/search"prints401or403, never200, and never a redirect.curl -s -u "$ADMIN" "$GITEA/api/v1/version" | jq -r .versionprints the pinned tag.
-
Pending a person, Fenced by Access elsewhere: from a network outside the bypass (a phone hotspot),
curl -s -o /dev/null -w '%{http_code} %{redirect_url}\n' "$GITEA/api/v1/version"prints a redirect to the Access login, not Gitea's reply. -
Pending a person, URLs: create a test repository in the UI.
curl -s -u "$ADMIN" "$GITEA/api/v1/repos/<admin-user>/<test-repo>" | jq -r .clone_urlstarts withhttps://git.<domain>/, and the repository page offers no SSH clone URL. Delete the repository. -
Pending a person, In-cluster HTTP:
kubectl -n argocd exec deploy/argocd-repo-server -- env GIT_TERMINAL_PROMPT=0 git ls-remote http://gitea-http.gitea.svc.cluster.local:3000/<admin-user>/<test-repo>.gitfails with an authentication error, not "connection refused" or a timeout. -
Pending a person, WAL:
kubectl -n gitea exec deploy/gitea -- ls /data/gitea.db-walsucceeds after the first sign-in. -
Pending a person, No egress:
kubectl -n gitea exec deploy/gitea -- curl -s -m 5 -o /dev/null -w '%{http_code}\n' https://github.comfails. -
Pending a person, Restart: run
kubectl -n gitea rollout restart deploy/gitea.kubectl -n gitea get pods -wnever shows two Running Gitea pods.
Key questions
- How do pods and workstations reach Gitea? Decided (owner, 2026-10-03): Gitea communicates inside the cluster over HTTP, and the devops-cli configuration uses the Cloudflare tunnel domain alias over HTTPS.
- In the cluster: the chart's
gitea-httpClusterIP Service on port 3000, over HTTP. The earlier NodePort is dropped. - From a workstation:
https://git.<domain>, through the tunnel's wildcard route, Traefik and the chart's Ingress. - No workstation request leaves the cluster in plain HTTP: TLS runs from the workstation to Cloudflare, and the tunnel is encrypted from there to cloudflared.
gitea.urland feat(repos): Add a gitea remote to every clone under repos/ #1090's credential helper accept onlyhttps. - Inside the cluster it is plain HTTP, as the owner chose. From cloudflared on, the request, with the token in its
Authorizationheader, goes cloudflared → Traefik → Gitea over the pod network. The homelab's four nodes run flannel'svxlanbackend (node annotationflannel.alpha.coreos.com/backend-type, 2026-10-03), which does not encrypt, so a hop between pods on different nodes crosses the LAN in clear. The same holds today for every host behind the tunnel and for in-cluster callers such as Argo CD (feat(k8s): Point Argo CD to Gitea for git and PR dev images #1082).
- In the cluster: the chart's
- How does git get through Cloudflare Access? Proposed: through the existing public-IP bypass on the wildcard Access application, with Gitea's token as the authentication. Nothing new is configured in Cloudflare.
- Why not a service token. Access would need
CF-Access-Client-IdandCF-Access-Client-Secreton every git request. Git sends extra headers only throughhttp.extraHeader, which writes the secret into git config, and credential helpers cannot supply headers. That is a second credential on disk for every clone. - Why not a bypass for everyone on the git paths. Smart HTTP uses
/<owner>/<repo>.git/info/refs,git-upload-packandgit-receive-pack, and feat(repos): Add a gitea remote to every clone under repos/ #1090's client uses/api/v1/. A bypass that admits git and the API from anywhere would expose Gitea's whole surface to the internet, guarded by Gitea alone. - The limit. Git works only from the bypassed address, as the CLI's other
https://URLs do today. Git from elsewhere would need a service token and a header-capable client, which is a later item if it is ever wanted. - Owner decision: keep Gitea on the IP bypass.
- Why not a service token. Access would need
- Is in-cluster HTTP across nodes acceptable? Proposed: yes, per the owner's direction, with the limit stated in the guide. Gitea's pod, Traefik's and Argo CD's repo-server can sit on different nodes, and flannel's
vxlanbackend carries their traffic over the LAN unencrypted. Encrypting it (flannel'swireguard-nativebackend) would change the whole cluster, so it would be its own item.- Owner decision: accept, or file the
wireguard-nativeitem.
- Owner decision: accept, or file the
- Ingress in the chart, or in k8s/ingress/ingress-routes.yaml? Proposed: the chart's Ingress, set in
values.yamland given its host by the homelab values file. Gitea exists only on the homelab, and ingress-routes.yaml is also applied to minikube, where namespacegiteadoes not exist. The host still follows the<name>.<domain>pattern and feat(k8s): argo cd keeps the homelab cluster at the current release branch, with automated sync, prune and self-heal that never delete data #755's rule that the domain lives only in the homelab overlays. - Why set
ROOT_URL? Proposed: TLS ends at Cloudflare, so the chart would buildhttp://git.<domain>. Gitea usesROOT_URLfor the clone URLs it shows and the links its push hooks print. In-cluster clients name their URL themselves, so the fixedhttps://root does not affect them. - HTTPS or SSH? Proposed: HTTPS only. SSH through the tunnel would need
cloudflared access sshon every client, plus host keys and per-user key management.DISABLE_SSHandSTART_SSH_SERVER: falsekeep the rootless image's built-in server off. The chart's SSH Service remains but answers nothing, and the network policy admits only 3000. - Which pods may call Gitea? Proposed: Traefik (the tunnel), Argo CD's repo-server (feat(k8s): Point Argo CD to Gitea for git and PR dev images #1082) and Gitea's own namespace. Any other in-cluster client adds its peer in the item that needs it.
- Why still Gitea's own chart, and which version? Proposed:
giteafromhttps://dl.gitea.com/charts/(source gitea.com/gitea/helm-gitea).- Pin. Pin the newest release when work starts, and set
image.tagto the newest patch of its Gitea line. - Maintained. 12 releases from v12.1.1 (2025-06-27) to v12.7.0 (2026-07-19), commits on main on 2026-10-03, three named maintainers.
- Next major. Chart 13.0.0 (main) moves to Gitea 28, replaces
gitea.adminwithsecrets.admin, turns persistence off by default and movesstrategyunderdeployment. The values file is written for whichever chart is pinned.
- Pin. Pin the newest release when work starts, and set
- SQLite or PostgreSQL? Proposed: SQLite in WAL mode, decided now, because changing later "is not well-tested".
- The load. One owner and a few agents. A push writes git objects to disk and only a few database rows, so writes are short and seldom concurrent. WAL lets readers run during a write, and
SQLITE_TIMEOUTwaits up to 20 s for a lock. - Why not the bundled PostgreSQL. On 12.x it is Bitnami with
bitnamilegacy/*images, which "will receive no further updates or support" (Upcoming changes to the Bitnami catalog (effective August 28th, 2025) bitnami/charts#35164). 13.x keeps Bitnami PostgreSQL. Both fail the maintained-dependency rule. - If PostgreSQL is needed later. CloudNativePG (CNCF) is the maintained route. A second human user, Gitea Actions turned on, or
database is lockedin Gitea's log would open a migration item.
- The load. One owner and a few agents. A push writes git objects to disk and only a few database rows, so writes are short and seldom concurrent. WAL lets readers run during a write, and
- Backups? Decided (owner, 2026-10-03): later. The owner noted that a NAS on the local network could hold the cluster's backups later, once there are production artifacts worth keeping outside GitHub. Until then the Namespace and PVC carry
Prune=false,Delete=falseand the PV is set to Retain, so neither Argo CD nor a deleted claim removes the data. - Who creates repositories? Proposed:
devops repos(feat(repos): Add a gitea remote to every clone under repos/ #1090), through Gitea's API with the owner's token. Push-to-create stays off, so a typo in a remote fails instead of creating a repository. - Replicas, CPU and memory? Proposed: one replica with
Recreate. The chart's defaultRollingUpdatewithmaxSurge: 100%would briefly run two pods on one SQLite file. Requests of 100m CPU and 256Mi and limits of 1 CPU and 1Gi; Gitea's docs say "2 CPU cores and 1GB RAM is typically sufficient for small teams/projects". Revisit after a week withkubectl -n gitea top pod. - Phone-home? Proposed: off.
[cron.update_checker]is disabled, per AGENTS.md's telemetry rule, andOFFLINE_MODEis on by default.
Strategic alignment
- Priority: P2. Nothing breaks without it. It is the base for internal iteration, feat(repos): Add a gitea remote to every clone under repos/ #1090 and feat(k8s): Point Argo CD to Gitea for git and PR dev images #1082.
- Value / Effort: Medium-High / Medium.
- Dropped since the previous version: the backup CronJob, the restore example, restic and the bucket, four credentials and the drills, and the NodePort.
- Added: the chart's Ingress, a homelab values file with the domain, and a guide paragraph on Cloudflare.
- Depends on:
- feat(k8s): argo cd keeps the homelab cluster at the current release branch, with automated sync, prune and self-heal that never delete data #755: the app-of-apps, AppProject
homelab, the homelab overlays with the domain, and PV Retain. - feat(k8s): devops-cli runs in the homelab cluster as Jobs, and every cluster Secret is pushed from the keyring, also by deploy-stack (devops k8s push-secrets, devops k8s run-job) #741:
push-secretsandconfig setwith a hidden prompt.
- feat(k8s): argo cd keeps the homelab cluster at the current release branch, with automated sync, prune and self-heal that never delete data #755: the app-of-apps, AppProject
- Blocks: feat(repos): Add a gitea remote to every clone under repos/ #1090's person checks and feat(k8s): Point Argo CD to Gitea for git and PR dev images #1082.
- Children (this item is their parent; order: feat(k8s): argo cd keeps the homelab cluster at the current release branch, with automated sync, prune and self-heal that never delete data #755 and feat(k8s): devops-cli runs in the homelab cluster as Jobs, and every cluster Secret is pushed from the keyring, also by deploy-stack (devops k8s push-secrets, devops k8s run-job) #741, then this item, then feat(repos): Add a gitea remote to every clone under repos/ #1090, then feat(k8s): Point Argo CD to Gitea for git and PR dev images #1082):
- Related:
- fix(k8s): cloudflared egress NetworkPolicy silently blocks Traefik traffic #725: blocked connections are refused, and a NetworkPolicy matches container ports.
- feat(release): production service image for scheduled jobs and webhook handlers #753: Gitea's container registry is enabled to host development container images for all open pull requests, while production releases continue to publish to GHCR. Argo CD applications point to Gitea for git and container registries.
- fix(security): the devcontainer no longer starts the git daemon stub meant for argo cd, which served every clone under repos/ without authentication on port 9418 #1122 removes the devcontainer git daemon, with no dependency on this one.
- Out of scope:
- Backups and restore. A later item, when Gitea holds work worth keeping that is not on GitHub. The owner named a NAS on the local network as the likely target.
- Git from outside the bypassed address (a service token).
- Source: the owner, 2026-10-03 (quotes above).
Update 2026-10-08: refinement
The 'Homelab values' criterion contradicts #1290. It becomes: k8s/gitea/values.yaml names only git.example.com, no file under k8s/ names the homelab domain, and deploy-stack supplies the host and ROOT_URL. (proposed) The Ingress moves to k8s/overlays/homelab/ingress (AppProject homelab-system lists gitea), and the URL comes from a ConfigMap via gitea.additionalConfigFromEnvs. Applications track main; tests/test_k8s_argocd_apps.py:92-100 allows one git source with ref: values.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsIn Review
Activity
[-]feat(k8s): the homelab runs gitea under argo cd as a read-only mirror of its github repos[/-][+]feat(k8s): the homelab runs gitea under argo cd as a read-write internal forge, backed up nightly off the cluster, with its secrets pushed from the keyring[/+][-]feat(k8s): the homelab runs gitea under argo cd as a read-write internal forge, backed up nightly off the cluster, with its secrets pushed from the keyring[/-][+]feat(k8s): the homelab runs gitea under argo cd as a read-write internal forge, served in-cluster over http and to workstations at https://git.<domain> through the cloudflare tunnel, with its admin secret pushed from the keyring[/+]dan-petty commentedon Oct 3, 2026
Consolidation (2026-10-03): this item is the parent of the Gitea family. #1090 (repos/ remotes) and #1082 (Argo CD trials) become its sub-issues. Order: #755 and #741, then this item, then #1090, then #1082.
The family uses one URL scheme:
http://gitea-http.gitea.svc.cluster.local:3000.https://git.<domain>.It uses one secret path: #741's push-secrets rows
gitea/gitea-admin,gitea/gitea-backupandargocd/gitea-repo-creds.This item, #1090 and #1082 were rewritten on 2026-10-03 to the owner's direction of that day, and this item's body now lists both children as "- [ ]" lines. #1082's title no longer says "and the devcontainer git daemon is gone": the git daemon removal is its own security item, #1122, with no dependency on this family. It is linked, not a child, and it can land first.
If the roadmap tooling expects a parent to close last, use the blocked-by links written in the rewritten bodies instead of sub-issues.
fix(k8s): the unauthenticated in-cluster image registry leaves the cl…
feat(k8s): the homelab runs gitea under argo cd as a read-write inter…
chore(main): release 0.4.0 (#1960)
feat(k8s): devops k8s doctor checks the gitea stack: tunnel host, ano…